mirror of
https://git.kernel.org/pub/scm/network/iproute2/iproute2.git
synced 2024-11-27 11:54:53 +08:00
962692356a
According to FHS:
"/usr/lib includes object files and libraries. On some systems, it may
also include internal binaries that are not intended to be executed
directly by users or shell scripts."
A better directory to store config files is /usr/share:
"The /usr/share hierarchy is for all read-only architecture independent
data files.
This hierarchy is intended to be shareable among all architecture
platforms of a given OS; thus, for example, a site with i386, Alpha, and
PPC platforms might maintain a single /usr/share directory that is
centrally-mounted."
Accordingly, move configuration files to $(DATADIR)/iproute2.
Fixes: 946753a445
("Makefile: ensure CONF_USR_DIR honours the libdir config")
Reported-by: Luca Boccassi <luca.boccassi@gmail.com>
Signed-off-by: Andrea Claudi <aclaudi@redhat.com>
Acked-by: Luca Boccassi <bluca@debian.org>
Reviewed-by: Simon Horman <horms@kernel.org>
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
145 lines
3.7 KiB
Makefile
145 lines
3.7 KiB
Makefile
# SPDX-License-Identifier: GPL-2.0
|
|
# Top level Makefile for iproute2
|
|
|
|
-include config.mk
|
|
|
|
ifeq ("$(origin V)", "command line")
|
|
VERBOSE = $(V)
|
|
endif
|
|
ifndef VERBOSE
|
|
VERBOSE = 0
|
|
endif
|
|
|
|
ifeq ($(VERBOSE),0)
|
|
MAKEFLAGS += --no-print-directory
|
|
endif
|
|
|
|
PREFIX?=/usr
|
|
SBINDIR?=/sbin
|
|
NETNS_RUN_DIR?=/var/run/netns
|
|
NETNS_ETC_DIR?=/etc/netns
|
|
DATADIR?=$(PREFIX)/share
|
|
HDRDIR?=$(PREFIX)/include/iproute2
|
|
CONF_ETC_DIR?=/etc/iproute2
|
|
CONF_USR_DIR?=$(DATADIR)/iproute2
|
|
DOCDIR?=$(DATADIR)/doc/iproute2
|
|
MANDIR?=$(DATADIR)/man
|
|
ARPDDIR?=/var/lib/arpd
|
|
KERNEL_INCLUDE?=/usr/include
|
|
BASH_COMPDIR?=$(DATADIR)/bash-completion/completions
|
|
|
|
# Path to db_185.h include
|
|
DBM_INCLUDE:=$(DESTDIR)/usr/include
|
|
|
|
SHARED_LIBS = y
|
|
|
|
DEFINES= -DRESOLVE_HOSTNAMES -DLIBDIR=\"$(LIBDIR)\"
|
|
ifneq ($(SHARED_LIBS),y)
|
|
DEFINES+= -DNO_SHARED_LIBS
|
|
endif
|
|
|
|
DEFINES+=-DCONF_USR_DIR=\"$(CONF_USR_DIR)\" \
|
|
-DCONF_ETC_DIR=\"$(CONF_ETC_DIR)\" \
|
|
-DNETNS_RUN_DIR=\"$(NETNS_RUN_DIR)\" \
|
|
-DNETNS_ETC_DIR=\"$(NETNS_ETC_DIR)\" \
|
|
-DCONF_COLOR=$(CONF_COLOR)
|
|
|
|
#options for AX.25
|
|
ADDLIB+=ax25_ntop.o
|
|
|
|
#options for AX.25
|
|
ADDLIB+=rose_ntop.o
|
|
|
|
#options for mpls
|
|
ADDLIB+=mpls_ntop.o mpls_pton.o
|
|
|
|
#options for NETROM
|
|
ADDLIB+=netrom_ntop.o
|
|
|
|
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
|
|
CCOPTS = -O2 -pipe
|
|
WFLAGS := -Wall -Wstrict-prototypes -Wmissing-prototypes
|
|
WFLAGS += -Wmissing-declarations -Wold-style-definition -Wformat=2
|
|
|
|
CFLAGS := $(WFLAGS) $(CCOPTS) -I../include -I../include/uapi $(DEFINES) $(CFLAGS)
|
|
YACCFLAGS = -d -t -v
|
|
|
|
SUBDIRS=lib ip tc bridge misc netem genl man
|
|
ifeq ($(HAVE_MNL),y)
|
|
SUBDIRS += tipc devlink rdma dcb vdpa
|
|
endif
|
|
|
|
LIBNETLINK=../lib/libutil.a ../lib/libnetlink.a
|
|
LDLIBS += $(LIBNETLINK)
|
|
|
|
all: config.mk
|
|
@set -e; \
|
|
for i in $(SUBDIRS); \
|
|
do echo; echo $$i; $(MAKE) -C $$i; done
|
|
|
|
.PHONY: clean clobber distclean check cscope version
|
|
|
|
help:
|
|
@echo "Make Targets:"
|
|
@echo " all - build binaries"
|
|
@echo " clean - remove products of build"
|
|
@echo " distclean - remove configuration and build"
|
|
@echo " install - install binaries on local machine"
|
|
@echo " check - run tests"
|
|
@echo " cscope - build cscope database"
|
|
@echo " version - update version"
|
|
@echo ""
|
|
@echo "Make Arguments:"
|
|
@echo " V=[0|1] - set build verbosity level"
|
|
|
|
config.mk:
|
|
@if [ ! -f config.mk -o configure -nt config.mk ]; then \
|
|
sh configure $(KERNEL_INCLUDE); \
|
|
fi
|
|
|
|
install: all
|
|
install -m 0755 -d $(DESTDIR)$(SBINDIR)
|
|
install -m 0755 -d $(DESTDIR)$(CONF_USR_DIR)
|
|
install -m 0755 -d $(DESTDIR)$(ARPDDIR)
|
|
install -m 0755 -d $(DESTDIR)$(HDRDIR)
|
|
@for i in $(SUBDIRS); do $(MAKE) -C $$i install; done
|
|
install -m 0644 $(shell find etc/iproute2 -maxdepth 1 -type f) $(DESTDIR)$(CONF_USR_DIR)
|
|
install -m 0755 -d $(DESTDIR)$(BASH_COMPDIR)
|
|
install -m 0644 bash-completion/tc $(DESTDIR)$(BASH_COMPDIR)
|
|
install -m 0644 bash-completion/devlink $(DESTDIR)$(BASH_COMPDIR)
|
|
install -m 0644 include/bpf_elf.h $(DESTDIR)$(HDRDIR)
|
|
|
|
version:
|
|
echo "static const char version[] = \""`git describe --tags --long`"\";" \
|
|
> include/version.h
|
|
|
|
clean:
|
|
@for i in $(SUBDIRS) testsuite; \
|
|
do $(MAKE) -C $$i clean; done
|
|
|
|
clobber:
|
|
touch config.mk
|
|
$(MAKE) clean
|
|
rm -f config.mk cscope.*
|
|
|
|
distclean: clobber
|
|
|
|
check: all
|
|
$(MAKE) -C testsuite
|
|
$(MAKE) -C testsuite alltests
|
|
@if command -v man >/dev/null 2>&1; then \
|
|
echo "Checking manpages for syntax errors..."; \
|
|
$(MAKE) -C man check; \
|
|
else \
|
|
echo "man not installed, skipping checks for syntax errors."; \
|
|
fi
|
|
|
|
cscope:
|
|
cscope -b -q -R -Iinclude -sip -slib -smisc -snetem -stc
|
|
|
|
.EXPORT_ALL_VARIABLES:
|