]>
Commit | Line | Data |
---|---|---|
69fed534 | 1 | # Top level Makefile for iproute2 |
e4225669 | 2 | |
eebc7cc1 | 3 | ifeq ($(VERBOSE),0) |
57bdf8b7 DA |
4 | MAKEFLAGS += --no-print-directory |
5 | endif | |
6 | ||
06ec9039 PŠ |
7 | PREFIX?=/usr |
8 | LIBDIR?=$(PREFIX)/lib | |
9 | SBINDIR?=/sbin | |
10 | CONFDIR?=/etc/iproute2 | |
11 | DATADIR?=$(PREFIX)/share | |
e4225669 | 12 | HDRDIR?=$(PREFIX)/include/iproute2 |
06ec9039 PŠ |
13 | DOCDIR?=$(DATADIR)/doc/iproute2 |
14 | MANDIR?=$(DATADIR)/man | |
15 | ARPDDIR?=/var/lib/arpd | |
16 | KERNEL_INCLUDE?=/usr/include | |
27d44f3a | 17 | BASH_COMPDIR?=$(DATADIR)/bash-completion/completions |
aba5acdf | 18 | |
d1e48c7e | 19 | # Path to db_185.h include |
06ec9039 | 20 | DBM_INCLUDE:=$(DESTDIR)/usr/include |
d1e48c7e | 21 | |
f2e27cfb MF |
22 | SHARED_LIBS = y |
23 | ||
5e3bb534 | 24 | DEFINES= -DRESOLVE_HOSTNAMES -DLIBDIR=\"$(LIBDIR)\" |
f2e27cfb MF |
25 | ifneq ($(SHARED_LIBS),y) |
26 | DEFINES+= -DNO_SHARED_LIBS | |
27 | endif | |
aba5acdf | 28 | |
5c434a9e CT |
29 | DEFINES+=-DCONFDIR=\"$(CONFDIR)\" |
30 | ||
aba5acdf SH |
31 | #options for decnet |
32 | ADDLIB+=dnet_ntop.o dnet_pton.o | |
33 | ||
34 | #options for ipx | |
35 | ADDLIB+=ipx_ntop.o ipx_pton.o | |
36 | ||
dacc5d41 EB |
37 | #options for mpls |
38 | ADDLIB+=mpls_ntop.o mpls_pton.o | |
39 | ||
7ffa2b55 PS |
40 | CC := gcc |
41 | HOSTCC ?= $(CC) | |
c8610020 | 42 | DEFINES += -D_GNU_SOURCE |
232aaf4f MF |
43 | # Turn on transparent support for LFS |
44 | DEFINES += -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE | |
c8610020 | 45 | CCOPTS = -O2 |
3140e9a3 | 46 | WFLAGS := -Wall -Wstrict-prototypes -Wmissing-prototypes |
4ec0ffde | 47 | WFLAGS += -Wmissing-declarations -Wold-style-definition -Wformat=2 |
6398d3a6 | 48 | |
596b1c94 | 49 | CFLAGS := $(WFLAGS) $(CCOPTS) -I../include -I../include/uapi $(DEFINES) $(CFLAGS) |
9ddbb02e | 50 | YACCFLAGS = -d -t -v |
aba5acdf | 51 | |
74bd75c2 | 52 | SUBDIRS=lib ip tc bridge misc netem genl tipc devlink rdma man |
aba5acdf SH |
53 | |
54 | LIBNETLINK=../lib/libnetlink.a ../lib/libutil.a | |
2230ac1d | 55 | LDLIBS += $(LIBNETLINK) |
aba5acdf | 56 | |
5f1df307 | 57 | all: config.mk |
95dd5950 MF |
58 | @set -e; \ |
59 | for i in $(SUBDIRS); \ | |
57bdf8b7 | 60 | do echo; echo $$i; $(MAKE) $(MFLAGS) -C $$i; done |
adff36d7 | 61 | |
5f1df307 | 62 | config.mk: |
f35e9289 | 63 | sh configure $(KERNEL_INCLUDE) |
aba5acdf | 64 | |
aba5acdf SH |
65 | install: all |
66 | install -m 0755 -d $(DESTDIR)$(SBINDIR) | |
e9a05e96 | 67 | install -m 0755 -d $(DESTDIR)$(CONFDIR) |
e48f73d6 | 68 | install -m 0755 -d $(DESTDIR)$(ARPDDIR) |
e4225669 | 69 | install -m 0755 -d $(DESTDIR)$(HDRDIR) |
aba5acdf SH |
70 | install -m 0755 -d $(DESTDIR)$(DOCDIR)/examples |
71 | install -m 0755 -d $(DESTDIR)$(DOCDIR)/examples/diffserv | |
c72238e4 | 72 | install -m 0644 README.iproute2+tc $(shell find examples -maxdepth 1 -type f) \ |
e9a05e96 | 73 | $(DESTDIR)$(DOCDIR)/examples |
c72238e4 | 74 | install -m 0644 $(shell find examples/diffserv -maxdepth 1 -type f) \ |
e9a05e96 | 75 | $(DESTDIR)$(DOCDIR)/examples/diffserv |
b2fd7a0e | 76 | @for i in $(SUBDIRS); do $(MAKE) -C $$i install; done |
c72238e4 | 77 | install -m 0644 $(shell find etc/iproute2 -maxdepth 1 -type f) $(DESTDIR)$(CONFDIR) |
27d44f3a QM |
78 | install -m 0755 -d $(DESTDIR)$(BASH_COMPDIR) |
79 | install -m 0644 bash-completion/tc $(DESTDIR)$(BASH_COMPDIR) | |
e4225669 | 80 | install -m 0644 include/bpf_elf.h $(DESTDIR)$(HDRDIR) |
aba5acdf | 81 | |
235ac6a4 SH |
82 | snapshot: |
83 | echo "static const char SNAPSHOT[] = \""`date +%y%m%d`"\";" \ | |
84 | > include/SNAPSHOT.h | |
85 | ||
aba5acdf | 86 | clean: |
b2fd7a0e | 87 | @for i in $(SUBDIRS); \ |
adff36d7 SH |
88 | do $(MAKE) $(MFLAGS) -C $$i clean; done |
89 | ||
82408fc1 | 90 | clobber: |
5f1df307 | 91 | touch config.mk |
82408fc1 | 92 | $(MAKE) $(MFLAGS) clean |
5f1df307 | 93 | rm -f config.mk cscope.* |
adff36d7 | 94 | |
87773db5 | 95 | distclean: clobber |
aba5acdf | 96 | |
f6aa8e00 SH |
97 | cscope: |
98 | cscope -b -q -R -Iinclude -sip -slib -smisc -snetem -stc | |
99 | ||
aba5acdf | 100 | .EXPORT_ALL_VARIABLES: |