]>
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 for decnet |
24 | ADDLIB+=dnet_ntop.o dnet_pton.o | |
25 | ||
26 | #options for ipx | |
27 | ADDLIB+=ipx_ntop.o ipx_pton.o | |
28 | ||
aba5acdf | 29 | CC = gcc |
b209eda9 | 30 | HOSTCC = gcc |
c8610020 CT |
31 | DEFINES += -D_GNU_SOURCE |
32 | CCOPTS = -O2 | |
3140e9a3 | 33 | WFLAGS := -Wall -Wstrict-prototypes -Wmissing-prototypes |
4ec0ffde | 34 | WFLAGS += -Wmissing-declarations -Wold-style-definition -Wformat=2 |
6398d3a6 | 35 | |
c8610020 | 36 | CFLAGS = $(WFLAGS) $(CCOPTS) -I../include $(DEFINES) |
9ddbb02e | 37 | YACCFLAGS = -d -t -v |
aba5acdf | 38 | |
d04bc300 | 39 | SUBDIRS=lib ip tc bridge misc netem genl man |
aba5acdf SH |
40 | |
41 | LIBNETLINK=../lib/libnetlink.a ../lib/libutil.a | |
2230ac1d | 42 | LDLIBS += $(LIBNETLINK) |
aba5acdf | 43 | |
737f15f6 | 44 | all: Config |
95dd5950 MF |
45 | @set -e; \ |
46 | for i in $(SUBDIRS); \ | |
adff36d7 SH |
47 | do $(MAKE) $(MFLAGS) -C $$i; done |
48 | ||
49 | Config: | |
f35e9289 | 50 | sh configure $(KERNEL_INCLUDE) |
aba5acdf | 51 | |
aba5acdf SH |
52 | install: all |
53 | install -m 0755 -d $(DESTDIR)$(SBINDIR) | |
e9a05e96 | 54 | install -m 0755 -d $(DESTDIR)$(CONFDIR) |
e48f73d6 | 55 | install -m 0755 -d $(DESTDIR)$(ARPDDIR) |
aba5acdf SH |
56 | install -m 0755 -d $(DESTDIR)$(DOCDIR)/examples |
57 | install -m 0755 -d $(DESTDIR)$(DOCDIR)/examples/diffserv | |
c72238e4 | 58 | install -m 0644 README.iproute2+tc $(shell find examples -maxdepth 1 -type f) \ |
e9a05e96 | 59 | $(DESTDIR)$(DOCDIR)/examples |
c72238e4 | 60 | install -m 0644 $(shell find examples/diffserv -maxdepth 1 -type f) \ |
e9a05e96 | 61 | $(DESTDIR)$(DOCDIR)/examples/diffserv |
aba5acdf | 62 | @for i in $(SUBDIRS) doc; do $(MAKE) -C $$i install; done |
c72238e4 | 63 | install -m 0644 $(shell find etc/iproute2 -maxdepth 1 -type f) $(DESTDIR)$(CONFDIR) |
aba5acdf | 64 | |
235ac6a4 SH |
65 | snapshot: |
66 | echo "static const char SNAPSHOT[] = \""`date +%y%m%d`"\";" \ | |
67 | > include/SNAPSHOT.h | |
68 | ||
aba5acdf | 69 | clean: |
adff36d7 SH |
70 | @for i in $(SUBDIRS) doc; \ |
71 | do $(MAKE) $(MFLAGS) -C $$i clean; done | |
72 | ||
82408fc1 SH |
73 | clobber: |
74 | touch Config | |
75 | $(MAKE) $(MFLAGS) clean | |
a6ddc206 | 76 | rm -f Config cscope.* |
adff36d7 | 77 | |
87773db5 | 78 | distclean: clobber |
aba5acdf | 79 | |
f6aa8e00 SH |
80 | cscope: |
81 | cscope -b -q -R -Iinclude -sip -slib -smisc -snetem -stc | |
82 | ||
aba5acdf | 83 | .EXPORT_ALL_VARIABLES: |