-OBJS = arp.o \
- bgp.o \
- cli.o \
- cluster.o \
- constants.o \
- control.o \
- icmp.o \
- l2tpns.o \
- ll.o \
- md5.o \
- ppp.o \
- radius.o \
- tbf.o \
- util.o
-
-PLUGINS = garden.so autothrottle.so autosnoop.so stripdomain.so setrxspeed.so
-TARGETS = l2tpns nsctl generateload bounce $(PLUGINS)
-
-all: $(TARGETS)
+l2tpns.LIBS = -lm -lcli -ldl
+
+OBJS = arp.o cli.o cluster.o constants.o control.o icmp.o l2tpns.o \
+ ll.o md5.o ppp.o radius.o tbf.o util.o
+
+PROGRAMS = l2tpns nsctl
+PLUGINS = garden.so throttlectl.so autothrottle.so snoopctl.so \
+ autosnoop.so stripdomain.so setrxspeed.so
+
+TESTS = generateload bounce
+
+DEFINES += -DSTATISTICS
+DEFINES += -DSTAT_CALLS
+DEFINES += -DRINGBUFFER
+
+DEFINES += -DBGP
+OBJS += bgp.o
+
+doit = echo $(1); $(1)
+
+all: programs plugins tests
+programs: $(PROGRAMS)
+plugins: $(PLUGINS)
+tests: $(TESTS)