1SSOBJ=ss.o ssfilter.o 2LNSTATOBJ=lnstat.o lnstat_util.o 3 4TARGETS=ss nstat ifstat rtacct lnstat 5 6include ../Config 7 8ifeq ($(HAVE_BERKELEY_DB),y) 9 TARGETS += arpd 10endif 11 12ifeq ($(HAVE_SELINUX),y) 13 LDLIBS += $(shell $(PKG_CONFIG) --libs libselinux) 14 CFLAGS += $(shell $(PKG_CONFIG) --cflags libselinux) -DHAVE_SELINUX 15endif 16 17ifeq ($(IP_CONFIG_SETNS),y) 18 CFLAGS += -DHAVE_SETNS 19endif 20 21all: $(TARGETS) 22 23ss: $(SSOBJ) 24 25nstat: nstat.c 26 $(CC) $(CFLAGS) $(LDFLAGS) -o nstat nstat.c $(LIBNETLINK) -lm 27 28ifstat: ifstat.c 29 $(CC) $(CFLAGS) $(LDFLAGS) -o ifstat ifstat.c $(LIBNETLINK) -lm 30 31rtacct: rtacct.c 32 $(CC) $(CFLAGS) $(LDFLAGS) -o rtacct rtacct.c $(LIBNETLINK) -lm 33 34arpd: arpd.c 35 $(CC) $(CFLAGS) -I$(DBM_INCLUDE) $(LDFLAGS) -o arpd arpd.c $(LIBNETLINK) -ldb -lpthread 36 37ssfilter.c: ssfilter.y 38 bison ssfilter.y -o ssfilter.c 39 40lnstat: $(LNSTATOBJ) 41 42install: all 43 install -m 0755 $(TARGETS) $(DESTDIR)$(SBINDIR) 44 ln -sf lnstat $(DESTDIR)$(SBINDIR)/rtstat 45 ln -sf lnstat $(DESTDIR)$(SBINDIR)/ctstat 46 47clean: 48 rm -f *.o $(TARGETS) ssfilter.c 49