• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1DESTDIR=/usr/
2ROOTDIR=$(DESTDIR)
3LIBDIR=/usr/lib/
4SBINDIR=/sbin
5CONFDIR=/etc/iproute2
6DOCDIR=/share/doc/iproute2
7MANDIR=/share/man
8ARPDDIR=/var/lib/arpd
9
10# Path to db_185.h include
11DBM_INCLUDE:=$(ROOTDIR)/usr/include
12
13SHARED_LIBS = y
14
15DEFINES= -DRESOLVE_HOSTNAMES -DLIBDIR=\"$(LIBDIR)\"
16ifneq ($(SHARED_LIBS),y)
17DEFINES+= -DNO_SHARED_LIBS
18endif
19
20#options if you have a bind>=4.9.4 libresolv (or, maybe, glibc)
21LDLIBS=-lresolv
22ADDLIB=
23
24#options for decnet
25ADDLIB+=dnet_ntop.o dnet_pton.o
26
27#options for ipx
28ADDLIB+=ipx_ntop.o ipx_pton.o
29
30CC = gcc
31HOSTCC = gcc
32CCOPTS = -D_GNU_SOURCE -O2 -Wstrict-prototypes -Wall
33CFLAGS = $(CCOPTS) -I../include $(DEFINES)
34YACCFLAGS = -d -t -v
35
36LDLIBS += -L../lib -lnetlink -lutil
37
38SUBDIRS=lib ip tc misc netem genl
39
40LIBNETLINK=../lib/libnetlink.a ../lib/libutil.a
41
42all: Config
43	@set -e; \
44	for i in $(SUBDIRS); \
45	do $(MAKE) $(MFLAGS) -C $$i; done
46
47Config:
48	sh configure $(KERNEL_INCLUDE)
49
50install: all
51	install -m 0755 -d $(DESTDIR)$(SBINDIR)
52	install -m 0755 -d $(DESTDIR)$(CONFDIR)
53	install -m 0755 -d $(DESTDIR)$(ARPDDIR)
54	install -m 0755 -d $(DESTDIR)$(DOCDIR)/examples
55	install -m 0755 -d $(DESTDIR)$(DOCDIR)/examples/diffserv
56	install -m 0644 README.iproute2+tc $(shell find examples -maxdepth 1 -type f) \
57		$(DESTDIR)$(DOCDIR)/examples
58	install -m 0644 $(shell find examples/diffserv -maxdepth 1 -type f) \
59		$(DESTDIR)$(DOCDIR)/examples/diffserv
60	@for i in $(SUBDIRS) doc; do $(MAKE) -C $$i install; done
61	install -m 0644 $(shell find etc/iproute2 -maxdepth 1 -type f) $(DESTDIR)$(CONFDIR)
62	install -m 0755 -d $(DESTDIR)$(MANDIR)/man8
63	install -m 0644 $(shell find man/man8 -maxdepth 1 -type f) $(DESTDIR)$(MANDIR)/man8
64	ln -sf tc-bfifo.8  $(DESTDIR)$(MANDIR)/man8/tc-pfifo.8
65	ln -sf lnstat.8  $(DESTDIR)$(MANDIR)/man8/rtstat.8
66	ln -sf lnstat.8  $(DESTDIR)$(MANDIR)/man8/ctstat.8
67	ln -sf rtacct.8  $(DESTDIR)$(MANDIR)/man8/nstat.8
68	ln -sf routel.8  $(DESTDIR)$(MANDIR)/man8/routef.8
69	install -m 0755 -d $(DESTDIR)$(MANDIR)/man3
70	install -m 0644 $(shell find man/man3 -maxdepth 1 -type f) $(DESTDIR)$(MANDIR)/man3
71
72snapshot:
73	echo "static const char SNAPSHOT[] = \""`date +%y%m%d`"\";" \
74		> include/SNAPSHOT.h
75
76clean:
77	rm -f cscope.*
78	@for i in $(SUBDIRS) doc; \
79	do $(MAKE) $(MFLAGS) -C $$i clean; done
80
81clobber: clean
82	rm -f Config
83
84distclean: clobber
85
86cscope:
87	cscope -b -q -R -Iinclude -sip -slib -smisc -snetem -stc
88
89.EXPORT_ALL_VARIABLES:
90