2 DSOURCES
= brmon.c brstate.c libnetlink.c epoll_loop.c bridge_track.c ctl_socket.c netif_utils.c main.c
4 DOBJECTS
= $(DSOURCES
:.c
=.o
)
6 CTLSOURCES
= ctl_main.c ctl_cli_wrap.c ctl_socket_client.c
8 CTLOBJECTS
= $(CTLSOURCES
:.c
=.o
)
11 CFLAGS
= -Wall
-Werror
-O2
-g
-D_REENTRANT
-D__LINUX__
-DVERSION
=$(version
) -DBUILD
=$(build
) -DSTP_DBG
=1 -I.
-I.
/include -I.
/rstplib
16 make
-C rstplib librstp.a
20 rstpd
: $(DOBJECTS
) rstplib
21 $(CC
) -o
$@
$(DOBJECTS
) -L .
/rstplib
-lrstp
23 rstpctl
: $(CTLOBJECTS
)
24 $(CC
) -o
$@
$(CTLOBJECTS
)
27 rm -f
*.o rstpd rstpctl
29 rm -fr
$(TOPDIR
) $(BUILDDIR
)
32 install -m
755 -d
$(INSTALLPREFIX
)/sbin
33 install -m
755 rstpd
$(INSTALLPREFIX
)/sbin
34 install -m
755 rstpctl
$(INSTALLPREFIX
)/sbin
35 install -m
755 -d
$(INSTALLPREFIX
)/usr
/share
/man
/man8
36 install -m
644 rstpd
.8 $(INSTALLPREFIX
)/usr
/share
/man
/man8
37 install -m
644 rstpctl
.8 $(INSTALLPREFIX
)/usr
/share
/man
/man8
39 # RPM Building, as non root
43 BUILDROOT
:= $(CURDIR
)/rpm_buildroot
44 TOPDIR
:= $(CURDIR
)/rpm_topdir
48 --buildroot
=$(BUILDROOT
) \
49 --define='_topdir $(TOPDIR)' \
50 --define='VERSION $(version)' \
51 --define='BUILD $(build)'
54 mkdir
-p
$(BUILDROOT
) $(TOPDIR
)/BUILD
$(TOPDIR
)/SOURCES
$(TOPDIR
)/RPMS
55 (cd ..
; tar cfz
$(TOPDIR
)/SOURCES
/rstp-
$(version
).tgz
--exclude rstp-
$(version
)/rpm_buildroot
--exclude rstp-
$(version
)/rpm_topdir rstp-
$(version
))
56 $(RPMBUILD
) $(RPMDEFS
) -bb rstp.spec
57 cp
$(TOPDIR
)/RPMS
/*/rstp-
$(version
)-$(build
).
*.rpm .
58 cp
$(TOPDIR
)/RPMS
/*/rstp-debuginfo-
$(version
)-$(build
).
*.rpm .