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