2 bindir = $(DESTDIR
)/usr
/sbin
3 etcdir
= $(DESTDIR
)/etc
/l2tpns
4 libdir = $(DESTDIR
)/usr
/lib
/l2tpns
7 DEFINES
= -DBGP
-DRINGBUFFER
-DSTAT_CALLS
-DSTATISTICS
8 OPTIM
= -g
-O3
-funroll-loops
-fomit-frame-pointer
-finline-functions
9 CFLAGS
= -Wall
$(OPTIM
) $(DEFINES
)
12 INSTALL
= /usr
/bin
/install -c
30 PLUGINS
=garden.so autothrottle.so autosnoop.so
32 all: l2tpns nsctl
$(PLUGINS
)
35 $(CC
) $(CFLAGS
) -o
$@
$^
$(LIBS
) $(DEFS
)
37 nsctl
: nsctl.o control.o
38 $(CC
) $(CFLAGS
) -o
$@
$^
$(DEFS
)
41 /bin
/rm -f
*.o
*.so l2tpns nsctl
44 (sed
-n
'p; /^## Dependencies: (autogenerated) ##/q' Makefile
&& \
45 gcc
-MM
$(DEFINES
) $(OBJS
:.o
=.c
) && \
46 gcc
-MM
$(DEFINES
) $(PLUGINS
:.so
=.c
) | sed
's/\.o/.so/') >Makefile.tmp
47 mv Makefile Makefile.bak
48 mv Makefile.tmp Makefile
51 $(INSTALL
) -D
-o root
-g root
-m
0755 l2tpns
$(bindir)/l2tpns
52 $(INSTALL
) -D
-o root
-g root
-m
0755 nsctl
$(bindir)/nsctl
53 $(INSTALL
) -D
-o root
-g root
-m
0600 etc
/startup-config.default
$(etcdir
)/startup-config
54 $(INSTALL
) -D
-o root
-g root
-m
0644 etc
/ip_pool.default
$(etcdir
)/l2tpns.ip_pool
55 $(INSTALL
) -D
-o root
-g root
-m
0600 etc
/users.default
$(etcdir
)/l2tpns.users
56 for plugin in
$(PLUGINS
); do \
57 $(INSTALL
) -D
-o root
-g root
-m
0755 $$plugin $(libdir)/$$plugin; \
59 if
[ ! -e
/dev
/net
/tun
]; then \
61 mknod
/dev
/net
/tun c
10 200; \
65 $(CC
) -c
$(CFLAGS
) -o
$@
$<
68 $(CC
) -fPIC
-shared
$(CFLAGS
) -o
$@
$< $(LDFLAGS
) $(LIBS
) $(LIBPATH
)
70 .PHONY
: all clean depend
72 ## Dependencies: (autogenerated) ##
74 icmp.o
: icmp.c l2tpns.h config.h
75 cli.o
: cli.c l2tpns.h config.h util.h cluster.h tbf.h ll.h bgp.h
76 l2tpns.o
: l2tpns.c md5.h l2tpns.h config.h cluster.h plugin.h ll.h \
77 constants.h control.h util.h tbf.h bgp.h
78 ppp.o
: ppp.c l2tpns.h config.h constants.h plugin.h util.h tbf.h \
80 radius.o
: radius.c md5.h constants.h l2tpns.h config.h plugin.h util.h
82 cluster.o
: cluster.c l2tpns.h config.h cluster.h util.h tbf.h bgp.h
83 arp.o
: arp.c l2tpns.h config.h
84 constants.o
: constants.c constants.h
86 control.o
: control.c control.h
87 util.o
: util.c l2tpns.h config.h
88 tbf.o
: tbf.c l2tpns.h config.h util.h tbf.h
89 bgp.o
: bgp.c l2tpns.h config.h bgp.h util.h
90 garden.so
: garden.c l2tpns.h config.h plugin.h control.h
91 autothrottle.so
: autothrottle.c l2tpns.h config.h plugin.h control.h
92 autosnoop.so
: autosnoop.c l2tpns.h config.h plugin.h control.h