1 # SPDX-License-Identifier: GPL-2.0
2 # Top level Makefile for iproute2
5 MAKEFLAGS
+= --no-print-directory
11 CONFDIR?
=/etc
/iproute2
12 DATADIR?
=$(PREFIX
)/share
13 HDRDIR?
=$(PREFIX
)/include/iproute2
14 DOCDIR?
=$(DATADIR
)/doc
/iproute2
15 MANDIR?
=$(DATADIR
)/man
16 ARPDDIR?
=/var
/lib
/arpd
17 KERNEL_INCLUDE?
=/usr
/include
18 BASH_COMPDIR?
=$(DATADIR
)/bash-completion
/completions
20 # Path to db_185.h include
21 DBM_INCLUDE
:=$(DESTDIR
)/usr
/include
25 DEFINES
= -DRESOLVE_HOSTNAMES
-DLIBDIR
=\"$(LIBDIR
)\"
26 ifneq ($(SHARED_LIBS
),y
)
27 DEFINES
+= -DNO_SHARED_LIBS
30 DEFINES
+=-DCONFDIR
=\"$(CONFDIR
)\"
33 ADDLIB
+=dnet_ntop.o dnet_pton.o
36 ADDLIB
+=ipx_ntop.o ipx_pton.o
39 ADDLIB
+=mpls_ntop.o mpls_pton.o
43 DEFINES
+= -D_GNU_SOURCE
44 # Turn on transparent support for LFS
45 DEFINES
+= -D_FILE_OFFSET_BITS
=64 -D_LARGEFILE_SOURCE
-D_LARGEFILE64_SOURCE
47 WFLAGS
:= -Wall
-Wstrict-prototypes
-Wmissing-prototypes
48 WFLAGS
+= -Wmissing-declarations
-Wold-style-definition
-Wformat
=2
50 CFLAGS
:= $(WFLAGS
) $(CCOPTS
) -I..
/include -I..
/include/uapi
$(DEFINES
) $(CFLAGS
)
53 SUBDIRS
=lib ip tc bridge misc netem genl tipc devlink rdma man
55 LIBNETLINK
=..
/lib
/libnetlink.a ..
/lib
/libutil.a
56 LDLIBS
+= $(LIBNETLINK
)
60 for i in
$(SUBDIRS
); \
61 do echo
; echo
$$i; $(MAKE
) $(MFLAGS
) -C
$$i; done
64 sh configure
$(KERNEL_INCLUDE
)
67 install -m
0755 -d
$(DESTDIR
)$(SBINDIR
)
68 install -m
0755 -d
$(DESTDIR
)$(CONFDIR
)
69 install -m
0755 -d
$(DESTDIR
)$(ARPDDIR
)
70 install -m
0755 -d
$(DESTDIR
)$(HDRDIR
)
71 install -m
0755 -d
$(DESTDIR
)$(DOCDIR
)/examples
72 install -m
0755 -d
$(DESTDIR
)$(DOCDIR
)/examples
/diffserv
73 install -m
0644 README.iproute2
+tc
$(shell find examples
-maxdepth
1 -type f
) \
74 $(DESTDIR
)$(DOCDIR
)/examples
75 install -m
0644 $(shell find examples
/diffserv
-maxdepth
1 -type f
) \
76 $(DESTDIR
)$(DOCDIR
)/examples
/diffserv
77 @for i in
$(SUBDIRS
); do
$(MAKE
) -C
$$i install; done
78 install -m
0644 $(shell find etc
/iproute2
-maxdepth
1 -type f
) $(DESTDIR
)$(CONFDIR
)
79 install -m
0755 -d
$(DESTDIR
)$(BASH_COMPDIR
)
80 install -m
0644 bash-completion
/tc
$(DESTDIR
)$(BASH_COMPDIR
)
81 install -m
0644 include/bpf_elf.h
$(DESTDIR
)$(HDRDIR
)
84 echo
"static const char SNAPSHOT[] = \""`date +%y%m%d`"\";" \
88 @for i in
$(SUBDIRS
); \
89 do
$(MAKE
) $(MFLAGS
) -C
$$i clean; done
93 $(MAKE
) $(MFLAGS
) clean
94 rm -f config.mk cscope.
*
99 cscope
-b
-q
-R
-Iinclude
-sip
-slib
-smisc
-snetem
-stc
101 .EXPORT_ALL_VARIABLES
: