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