iproute2/misc/Makefile
<<
>>
Prefs
   1# SPDX-License-Identifier: GPL-2.0
   2SSOBJ=ss.o ssfilter_check.o ssfilter.tab.o
   3LNSTATOBJ=lnstat.o lnstat_util.o
   4
   5TARGETS=ss nstat ifstat rtacct lnstat
   6
   7include ../config.mk
   8
   9ifeq ($(HAVE_BERKELEY_DB),y)
  10        TARGETS += arpd
  11endif
  12
  13all: $(TARGETS)
  14
  15ss: $(SSOBJ)
  16        $(QUIET_LINK)$(CC) $^ $(LDFLAGS) $(LDLIBS) -o $@
  17
  18nstat: nstat.c
  19        $(QUIET_CC)$(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -o nstat nstat.c $(LDLIBS) -lm
  20
  21ifstat: ifstat.c
  22        $(QUIET_CC)$(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -o ifstat ifstat.c $(LDLIBS) -lm
  23
  24rtacct: rtacct.c
  25        $(QUIET_CC)$(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -o rtacct rtacct.c $(LDLIBS) -lm
  26
  27arpd: arpd.c
  28        $(QUIET_CC)$(CC) $(CFLAGS) -I$(DBM_INCLUDE) $(CPPFLAGS) $(LDFLAGS) -o arpd arpd.c $(LDLIBS) -ldb
  29
  30ssfilter.tab.c: ssfilter.y
  31        $(QUIET_YACC)$(YACC) -b ssfilter ssfilter.y
  32
  33lnstat: $(LNSTATOBJ)
  34        $(QUIET_LINK)$(CC) $^ $(LDFLAGS) $(LDLIBS) -o $@
  35
  36install: all
  37        install -m 0755 $(TARGETS) $(DESTDIR)$(SBINDIR)
  38        ln -sf lnstat $(DESTDIR)$(SBINDIR)/rtstat
  39        ln -sf lnstat $(DESTDIR)$(SBINDIR)/ctstat
  40
  41clean:
  42        rm -f *.o $(TARGETS) ssfilter.c
  43