]> git.proxmox.com Git - mirror_iproute2.git/blobdiff - Makefile
ip/tunnel: Use print_0xhex() instead of print_string()
[mirror_iproute2.git] / Makefile
index eb571a5accf8b4c39944a3682046235c3ed2524e..32587db3be70598aef5bcff1025fe9e0ff90153e 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,8 +1,23 @@
+# SPDX-License-Identifier: GPL-2.0
+# Top level Makefile for iproute2
+
+ifeq ("$(origin V)", "command line")
+VERBOSE = $(V)
+endif
+ifndef VERBOSE
+VERBOSE = 0
+endif
+
+ifeq ($(VERBOSE),0)
+MAKEFLAGS += --no-print-directory
+endif
+
 PREFIX?=/usr
 LIBDIR?=$(PREFIX)/lib
 SBINDIR?=/sbin
 CONFDIR?=/etc/iproute2
 DATADIR?=$(PREFIX)/share
+HDRDIR?=$(PREFIX)/include/iproute2
 DOCDIR?=$(DATADIR)/doc/iproute2
 MANDIR?=$(DATADIR)/man
 ARPDDIR?=/var/lib/arpd
@@ -30,8 +45,8 @@ ADDLIB+=ipx_ntop.o ipx_pton.o
 #options for mpls
 ADDLIB+=mpls_ntop.o mpls_pton.o
 
-CC = gcc
-HOSTCC = gcc
+CC := gcc
+HOSTCC ?= $(CC)
 DEFINES += -D_GNU_SOURCE
 # Turn on transparent support for LFS
 DEFINES += -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE
@@ -39,49 +54,51 @@ CCOPTS = -O2
 WFLAGS := -Wall -Wstrict-prototypes  -Wmissing-prototypes
 WFLAGS += -Wmissing-declarations -Wold-style-definition -Wformat=2
 
-CFLAGS := $(WFLAGS) $(CCOPTS) -I../include $(DEFINES) $(CFLAGS)
+CFLAGS := $(WFLAGS) $(CCOPTS) -I../include -I../include/uapi $(DEFINES) $(CFLAGS)
 YACCFLAGS = -d -t -v
 
-SUBDIRS=lib ip tc bridge misc netem genl tipc devlink man
+SUBDIRS=lib ip tc bridge misc netem genl tipc devlink rdma man
 
 LIBNETLINK=../lib/libnetlink.a ../lib/libutil.a
 LDLIBS += $(LIBNETLINK)
 
-all: Config
+all: config.mk
        @set -e; \
        for i in $(SUBDIRS); \
-       do $(MAKE) $(MFLAGS) -C $$i; done
+       do echo; echo $$i; $(MAKE) $(MFLAGS) -C $$i; done
 
-Config:
+config.mk:
        sh configure $(KERNEL_INCLUDE)
 
 install: all
        install -m 0755 -d $(DESTDIR)$(SBINDIR)
        install -m 0755 -d $(DESTDIR)$(CONFDIR)
        install -m 0755 -d $(DESTDIR)$(ARPDDIR)
+       install -m 0755 -d $(DESTDIR)$(HDRDIR)
        install -m 0755 -d $(DESTDIR)$(DOCDIR)/examples
        install -m 0755 -d $(DESTDIR)$(DOCDIR)/examples/diffserv
        install -m 0644 README.iproute2+tc $(shell find examples -maxdepth 1 -type f) \
                $(DESTDIR)$(DOCDIR)/examples
        install -m 0644 $(shell find examples/diffserv -maxdepth 1 -type f) \
                $(DESTDIR)$(DOCDIR)/examples/diffserv
-       @for i in $(SUBDIRS) doc; do $(MAKE) -C $$i install; done
+       @for i in $(SUBDIRS) do $(MAKE) -C $$i install; done
        install -m 0644 $(shell find etc/iproute2 -maxdepth 1 -type f) $(DESTDIR)$(CONFDIR)
        install -m 0755 -d $(DESTDIR)$(BASH_COMPDIR)
        install -m 0644 bash-completion/tc $(DESTDIR)$(BASH_COMPDIR)
+       install -m 0644 include/bpf_elf.h $(DESTDIR)$(HDRDIR)
 
 snapshot:
        echo "static const char SNAPSHOT[] = \""`date +%y%m%d`"\";" \
                > include/SNAPSHOT.h
 
 clean:
-       @for i in $(SUBDIRS) doc; \
+       @for i in $(SUBDIRS); \
        do $(MAKE) $(MFLAGS) -C $$i clean; done
 
 clobber:
-       touch Config
+       touch config.mk
        $(MAKE) $(MFLAGS) clean
-       rm -f Config cscope.*
+       rm -f config.mk cscope.*
 
 distclean: clobber