]>
Commit | Line | Data |
---|---|---|
06ec9039 PŠ |
1 | PREFIX?=/usr |
2 | LIBDIR?=$(PREFIX)/lib | |
3 | SBINDIR?=/sbin | |
4 | CONFDIR?=/etc/iproute2 | |
5 | DATADIR?=$(PREFIX)/share | |
6 | DOCDIR?=$(DATADIR)/doc/iproute2 | |
7 | MANDIR?=$(DATADIR)/man | |
8 | ARPDDIR?=/var/lib/arpd | |
9 | KERNEL_INCLUDE?=/usr/include | |
aba5acdf | 10 | |
d1e48c7e | 11 | # Path to db_185.h include |
06ec9039 | 12 | DBM_INCLUDE:=$(DESTDIR)/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 | ||
dacc5d41 EB |
29 | #options for mpls |
30 | ADDLIB+=mpls_ntop.o mpls_pton.o | |
31 | ||
aba5acdf | 32 | CC = gcc |
b209eda9 | 33 | HOSTCC = gcc |
c8610020 | 34 | DEFINES += -D_GNU_SOURCE |
232aaf4f MF |
35 | # Turn on transparent support for LFS |
36 | DEFINES += -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE | |
c8610020 | 37 | CCOPTS = -O2 |
3140e9a3 | 38 | WFLAGS := -Wall -Wstrict-prototypes -Wmissing-prototypes |
4ec0ffde | 39 | WFLAGS += -Wmissing-declarations -Wold-style-definition -Wformat=2 |
6398d3a6 | 40 | |
06ec9039 | 41 | CFLAGS := $(WFLAGS) $(CCOPTS) -I../include $(DEFINES) $(CFLAGS) |
9ddbb02e | 42 | YACCFLAGS = -d -t -v |
aba5acdf | 43 | |
f043759d | 44 | SUBDIRS=lib ip tc bridge misc netem genl tipc man |
aba5acdf SH |
45 | |
46 | LIBNETLINK=../lib/libnetlink.a ../lib/libutil.a | |
2230ac1d | 47 | LDLIBS += $(LIBNETLINK) |
aba5acdf | 48 | |
737f15f6 | 49 | all: Config |
95dd5950 MF |
50 | @set -e; \ |
51 | for i in $(SUBDIRS); \ | |
adff36d7 SH |
52 | do $(MAKE) $(MFLAGS) -C $$i; done |
53 | ||
54 | Config: | |
f35e9289 | 55 | sh configure $(KERNEL_INCLUDE) |
aba5acdf | 56 | |
aba5acdf SH |
57 | install: all |
58 | install -m 0755 -d $(DESTDIR)$(SBINDIR) | |
e9a05e96 | 59 | install -m 0755 -d $(DESTDIR)$(CONFDIR) |
e48f73d6 | 60 | install -m 0755 -d $(DESTDIR)$(ARPDDIR) |
aba5acdf SH |
61 | install -m 0755 -d $(DESTDIR)$(DOCDIR)/examples |
62 | install -m 0755 -d $(DESTDIR)$(DOCDIR)/examples/diffserv | |
c72238e4 | 63 | install -m 0644 README.iproute2+tc $(shell find examples -maxdepth 1 -type f) \ |
e9a05e96 | 64 | $(DESTDIR)$(DOCDIR)/examples |
c72238e4 | 65 | install -m 0644 $(shell find examples/diffserv -maxdepth 1 -type f) \ |
e9a05e96 | 66 | $(DESTDIR)$(DOCDIR)/examples/diffserv |
aba5acdf | 67 | @for i in $(SUBDIRS) doc; do $(MAKE) -C $$i install; done |
c72238e4 | 68 | install -m 0644 $(shell find etc/iproute2 -maxdepth 1 -type f) $(DESTDIR)$(CONFDIR) |
aba5acdf | 69 | |
235ac6a4 SH |
70 | snapshot: |
71 | echo "static const char SNAPSHOT[] = \""`date +%y%m%d`"\";" \ | |
72 | > include/SNAPSHOT.h | |
73 | ||
aba5acdf | 74 | clean: |
adff36d7 SH |
75 | @for i in $(SUBDIRS) doc; \ |
76 | do $(MAKE) $(MFLAGS) -C $$i clean; done | |
77 | ||
82408fc1 SH |
78 | clobber: |
79 | touch Config | |
80 | $(MAKE) $(MFLAGS) clean | |
a6ddc206 | 81 | rm -f Config cscope.* |
adff36d7 | 82 | |
87773db5 | 83 | distclean: clobber |
aba5acdf | 84 | |
f6aa8e00 SH |
85 | cscope: |
86 | cscope -b -q -R -Iinclude -sip -slib -smisc -snetem -stc | |
87 | ||
aba5acdf | 88 | .EXPORT_ALL_VARIABLES: |