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