]>
Commit | Line | Data |
---|---|---|
b514b358 | 1 | DESTDIR=/usr/ |
ed1af7e8 | 2 | ROOTDIR=$(DESTDIR) |
5e3bb534 | 3 | LIBDIR=/usr/lib/ |
b514b358 | 4 | SBINDIR=/sbin |
aba5acdf | 5 | CONFDIR=/etc/iproute2 |
b514b358 RA |
6 | DOCDIR=/share/doc/iproute2 |
7 | MANDIR=/share/man | |
e48f73d6 | 8 | ARPDDIR=/var/lib/arpd |
aba5acdf | 9 | |
d1e48c7e | 10 | # Path to db_185.h include |
ed1af7e8 | 11 | DBM_INCLUDE:=$(ROOTDIR)/usr/include |
d1e48c7e | 12 | |
f2e27cfb MF |
13 | SHARED_LIBS = y |
14 | ||
5e3bb534 | 15 | DEFINES= -DRESOLVE_HOSTNAMES -DLIBDIR=\"$(LIBDIR)\" |
f2e27cfb MF |
16 | ifneq ($(SHARED_LIBS),y) |
17 | DEFINES+= -DNO_SHARED_LIBS | |
18 | endif | |
aba5acdf SH |
19 | |
20 | #options if you have a bind>=4.9.4 libresolv (or, maybe, glibc) | |
21 | LDLIBS=-lresolv | |
22 | ADDLIB= | |
23 | ||
aba5acdf SH |
24 | #options for decnet |
25 | ADDLIB+=dnet_ntop.o dnet_pton.o | |
26 | ||
27 | #options for ipx | |
28 | ADDLIB+=ipx_ntop.o ipx_pton.o | |
29 | ||
aba5acdf | 30 | CC = gcc |
b209eda9 | 31 | HOSTCC = gcc |
c8610020 CT |
32 | DEFINES += -D_GNU_SOURCE |
33 | CCOPTS = -O2 | |
34 | WFLAGS = -Wall -Wstrict-prototypes | |
35 | CFLAGS = $(WFLAGS) $(CCOPTS) -I../include $(DEFINES) | |
9ddbb02e | 36 | YACCFLAGS = -d -t -v |
aba5acdf | 37 | |
761a1e60 | 38 | SUBDIRS=lib ip tc misc netem genl man |
aba5acdf SH |
39 | |
40 | LIBNETLINK=../lib/libnetlink.a ../lib/libutil.a | |
2230ac1d | 41 | LDLIBS += $(LIBNETLINK) |
aba5acdf | 42 | |
737f15f6 | 43 | all: Config |
95dd5950 MF |
44 | @set -e; \ |
45 | for i in $(SUBDIRS); \ | |
adff36d7 SH |
46 | do $(MAKE) $(MFLAGS) -C $$i; done |
47 | ||
48 | Config: | |
f35e9289 | 49 | sh configure $(KERNEL_INCLUDE) |
aba5acdf | 50 | |
aba5acdf SH |
51 | install: all |
52 | install -m 0755 -d $(DESTDIR)$(SBINDIR) | |
e9a05e96 | 53 | install -m 0755 -d $(DESTDIR)$(CONFDIR) |
e48f73d6 | 54 | install -m 0755 -d $(DESTDIR)$(ARPDDIR) |
aba5acdf SH |
55 | install -m 0755 -d $(DESTDIR)$(DOCDIR)/examples |
56 | install -m 0755 -d $(DESTDIR)$(DOCDIR)/examples/diffserv | |
c72238e4 | 57 | install -m 0644 README.iproute2+tc $(shell find examples -maxdepth 1 -type f) \ |
e9a05e96 | 58 | $(DESTDIR)$(DOCDIR)/examples |
c72238e4 | 59 | install -m 0644 $(shell find examples/diffserv -maxdepth 1 -type f) \ |
e9a05e96 | 60 | $(DESTDIR)$(DOCDIR)/examples/diffserv |
aba5acdf | 61 | @for i in $(SUBDIRS) doc; do $(MAKE) -C $$i install; done |
c72238e4 | 62 | install -m 0644 $(shell find etc/iproute2 -maxdepth 1 -type f) $(DESTDIR)$(CONFDIR) |
aba5acdf | 63 | |
235ac6a4 SH |
64 | snapshot: |
65 | echo "static const char SNAPSHOT[] = \""`date +%y%m%d`"\";" \ | |
66 | > include/SNAPSHOT.h | |
67 | ||
aba5acdf | 68 | clean: |
adff36d7 SH |
69 | @for i in $(SUBDIRS) doc; \ |
70 | do $(MAKE) $(MFLAGS) -C $$i clean; done | |
71 | ||
82408fc1 SH |
72 | clobber: |
73 | touch Config | |
74 | $(MAKE) $(MFLAGS) clean | |
a6ddc206 | 75 | rm -f Config cscope.* |
adff36d7 | 76 | |
87773db5 | 77 | distclean: clobber |
aba5acdf | 78 | |
f6aa8e00 SH |
79 | cscope: |
80 | cscope -b -q -R -Iinclude -sip -slib -smisc -snetem -stc | |
81 | ||
aba5acdf | 82 | .EXPORT_ALL_VARIABLES: |