1 # SPDX-License-Identifier: GPL-2.0
2 # Top level Makefile for iproute2
4 ifeq ("$(origin V)", "command line")
12 MAKEFLAGS
+= --no-print-directory
18 CONFDIR?
=/etc
/iproute2
19 DATADIR?
=$(PREFIX
)/share
20 HDRDIR?
=$(PREFIX
)/include/iproute2
21 DOCDIR?
=$(DATADIR
)/doc
/iproute2
22 MANDIR?
=$(DATADIR
)/man
23 ARPDDIR?
=/var
/lib
/arpd
24 KERNEL_INCLUDE?
=/usr
/include
25 BASH_COMPDIR?
=$(DATADIR
)/bash-completion
/completions
27 # Path to db_185.h include
28 DBM_INCLUDE
:=$(DESTDIR
)/usr
/include
32 DEFINES
= -DRESOLVE_HOSTNAMES
-DLIBDIR
=\"$(LIBDIR
)\"
33 ifneq ($(SHARED_LIBS
),y
)
34 DEFINES
+= -DNO_SHARED_LIBS
37 DEFINES
+=-DCONFDIR
=\"$(CONFDIR
)\"
40 ADDLIB
+=dnet_ntop.o dnet_pton.o
43 ADDLIB
+=ipx_ntop.o ipx_pton.o
46 ADDLIB
+=mpls_ntop.o mpls_pton.o
50 DEFINES
+= -D_GNU_SOURCE
51 # Turn on transparent support for LFS
52 DEFINES
+= -D_FILE_OFFSET_BITS
=64 -D_LARGEFILE_SOURCE
-D_LARGEFILE64_SOURCE
54 WFLAGS
:= -Wall
-Wstrict-prototypes
-Wmissing-prototypes
55 WFLAGS
+= -Wmissing-declarations
-Wold-style-definition
-Wformat
=2
57 CFLAGS
:= $(WFLAGS
) $(CCOPTS
) -I..
/include -I..
/include/uapi
$(DEFINES
) $(CFLAGS
)
60 SUBDIRS
=lib ip tc bridge misc netem genl tipc devlink rdma man
62 LIBNETLINK
=..
/lib
/libnetlink.a ..
/lib
/libutil.a
63 LDLIBS
+= $(LIBNETLINK
)
67 for i in
$(SUBDIRS
); \
68 do echo
; echo
$$i; $(MAKE
) $(MFLAGS
) -C
$$i; done
71 sh configure
$(KERNEL_INCLUDE
)
74 install -m
0755 -d
$(DESTDIR
)$(SBINDIR
)
75 install -m
0755 -d
$(DESTDIR
)$(CONFDIR
)
76 install -m
0755 -d
$(DESTDIR
)$(ARPDDIR
)
77 install -m
0755 -d
$(DESTDIR
)$(HDRDIR
)
78 install -m
0755 -d
$(DESTDIR
)$(DOCDIR
)/examples
79 install -m
0755 -d
$(DESTDIR
)$(DOCDIR
)/examples
/diffserv
80 install -m
0644 README.iproute2
+tc
$(shell find examples
-maxdepth
1 -type f
) \
81 $(DESTDIR
)$(DOCDIR
)/examples
82 install -m
0644 $(shell find examples
/diffserv
-maxdepth
1 -type f
) \
83 $(DESTDIR
)$(DOCDIR
)/examples
/diffserv
84 @for i in
$(SUBDIRS
); do
$(MAKE
) -C
$$i install; done
85 install -m
0644 $(shell find etc
/iproute2
-maxdepth
1 -type f
) $(DESTDIR
)$(CONFDIR
)
86 install -m
0755 -d
$(DESTDIR
)$(BASH_COMPDIR
)
87 install -m
0644 bash-completion
/tc
$(DESTDIR
)$(BASH_COMPDIR
)
88 install -m
0644 include/bpf_elf.h
$(DESTDIR
)$(HDRDIR
)
91 echo
"static const char SNAPSHOT[] = \""`date +%y%m%d`"\";" \
95 @for i in
$(SUBDIRS
); \
96 do
$(MAKE
) $(MFLAGS
) -C
$$i clean; done
100 $(MAKE
) $(MFLAGS
) clean
101 rm -f config.mk cscope.
*
106 cscope
-b
-q
-R
-Iinclude
-sip
-slib
-smisc
-snetem
-stc
108 .EXPORT_ALL_VARIABLES
: