184 lines
5.5 KiB
Diff
184 lines
5.5 KiB
Diff
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||
|
From: Martin Wilck <mwilck@suse.com>
|
||
|
Date: Fri, 28 Oct 2022 14:39:22 +0200
|
||
|
Subject: [PATCH] multipath-tools: quiet build support for top-level Makefile
|
||
|
|
||
|
This requires including "Makefile.inc" in the top-level Makefile,
|
||
|
too.
|
||
|
|
||
|
Signed-off-by: Martin Wilck <mwilck@suse.com>
|
||
|
Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
|
||
|
---
|
||
|
Makefile | 32 ++++++++++++++++++------------
|
||
|
Makefile.inc | 8 ++++++--
|
||
|
create-config.mk | 1 -
|
||
|
libmultipath/checkers/Makefile | 2 +-
|
||
|
libmultipath/foreign/Makefile | 2 +-
|
||
|
libmultipath/prioritizers/Makefile | 2 +-
|
||
|
6 files changed, 28 insertions(+), 19 deletions(-)
|
||
|
|
||
|
diff --git a/Makefile b/Makefile
|
||
|
index e3ce1a8d..b9e30234 100644
|
||
|
--- a/Makefile
|
||
|
+++ b/Makefile
|
||
|
@@ -2,6 +2,9 @@
|
||
|
# Copyright (C) 2003 Christophe Varoqui, <christophe.varoqui@opensvc.com>
|
||
|
#
|
||
|
|
||
|
+TOPDIR := .
|
||
|
+include Makefile.inc
|
||
|
+
|
||
|
LIB_BUILDDIRS := \
|
||
|
libmpathcmd \
|
||
|
libmpathutil \
|
||
|
@@ -32,10 +35,12 @@ all: $(BUILDDIRS)
|
||
|
|
||
|
config.mk libmultipath/autoconfig.h:
|
||
|
@$(MAKE) -f create-config.mk
|
||
|
+ifeq ($(V),1)
|
||
|
@echo ==== config.mk ====
|
||
|
@cat config.mk
|
||
|
@echo ==== autoconfig.h ====
|
||
|
@cat libmultipath/autoconfig.h
|
||
|
+endif
|
||
|
|
||
|
$(BUILDDIRS): config.mk
|
||
|
@$(MAKE) -C $@
|
||
|
@@ -48,11 +53,12 @@ $(LIB_BUILDDIRS:=.abi): $(LIB_BUILDDIRS)
|
||
|
# Requires abidw from the abigail suite (https://sourceware.org/libabigail/)
|
||
|
.PHONY: abi
|
||
|
abi: $(LIB_BUILDDIRS:=.abi)
|
||
|
+ @echo creating abi
|
||
|
@mkdir -p $@
|
||
|
- ln -ft $@ $(LIB_BUILDDIRS:=/*.abi)
|
||
|
+ $(Q)ln -ft $@ $(LIB_BUILDDIRS:=/*.abi)
|
||
|
|
||
|
abi.tar.gz: abi
|
||
|
- tar cfz $@ abi
|
||
|
+ $(Q)tar cfz $@ abi
|
||
|
|
||
|
# Check the ABI against a reference.
|
||
|
# This requires the ABI from a previous run to be present
|
||
|
@@ -77,8 +83,8 @@ abi-test: abi reference-abi $(wildcard abi/*.abi)
|
||
|
# Create compile_commands.json, useful for using clangd with an IDE
|
||
|
# Requires bear (https://github.com/rizsotto/Bear)
|
||
|
compile_commands.json: Makefile Makefile.inc $(BUILDDIRS:=/Makefile)
|
||
|
- $(MAKE) clean
|
||
|
- bear -- $(MAKE)
|
||
|
+ $(Q)$(MAKE) clean
|
||
|
+ $(Q)bear -- $(MAKE)
|
||
|
|
||
|
libmpathutil libdmmp: libmpathcmd
|
||
|
libmultipath: libmpathutil
|
||
|
@@ -103,24 +109,24 @@ $(BUILDDIRS:=.uninstall):
|
||
|
# build it. Both is undesirable. Avoid it by creating config.mk temporarily.
|
||
|
clean:
|
||
|
@touch config.mk
|
||
|
- $(MAKE) $(BUILDDIRS:=.clean) tests.clean || true
|
||
|
- rm -rf abi abi.tar.gz abi-test compile_commands.json config.mk
|
||
|
+ $(Q)$(MAKE) $(BUILDDIRS:=.clean) tests.clean || true
|
||
|
+ $(Q)$(RM) -r abi abi.tar.gz abi-test compile_commands.json config.mk
|
||
|
|
||
|
install: $(BUILDDIRS:=.install)
|
||
|
uninstall: $(BUILDDIRS:=.uninstall)
|
||
|
|
||
|
test-progs: all
|
||
|
- $(MAKE) -C tests progs
|
||
|
+ @$(MAKE) -C tests progs
|
||
|
|
||
|
test: all
|
||
|
- $(MAKE) -C tests all
|
||
|
+ @$(MAKE) -C tests all
|
||
|
|
||
|
valgrind-test: all
|
||
|
- $(MAKE) -C tests valgrind
|
||
|
+ @$(MAKE) -C tests valgrind
|
||
|
|
||
|
.PHONY: TAGS
|
||
|
TAGS:
|
||
|
- etags -a libmultipath/*.c
|
||
|
- etags -a libmultipath/*.h
|
||
|
- etags -a multipathd/*.c
|
||
|
- etags -a multipathd/*.h
|
||
|
+ @etags -a libmultipath/*.c
|
||
|
+ @etags -a libmultipath/*.h
|
||
|
+ @etags -a multipathd/*.c
|
||
|
+ @etags -a multipathd/*.h
|
||
|
diff --git a/Makefile.inc b/Makefile.inc
|
||
|
index 3e14cb8c..866ab274 100644
|
||
|
--- a/Makefile.inc
|
||
|
+++ b/Makefile.inc
|
||
|
@@ -27,7 +27,7 @@ PKGCONFIG ?= pkg-config
|
||
|
ifeq ($(TOPDIR),)
|
||
|
TOPDIR = ..
|
||
|
endif
|
||
|
-ifneq ($(CREATE_CONFIG),1)
|
||
|
+ifneq ($(TOPDIR),.)
|
||
|
include $(TOPDIR)/config.mk
|
||
|
endif
|
||
|
|
||
|
@@ -60,7 +60,11 @@ devmapper_incdir := $(or $(shell $(PKGCONFIG) --variable=includedir devmapper),/
|
||
|
libudev_incdir := $(or $(shell $(PKGCONFIG) --variable=includedir libudev),/usr/include)
|
||
|
kernel_incdir := /usr/include
|
||
|
|
||
|
-Q := $(if $(V),,@)
|
||
|
+ifeq ($(V),)
|
||
|
+Q := @
|
||
|
+# make's "Entering directory" messages are confusing in parallel mode
|
||
|
+#MAKEFLAGS = --no-print-directory
|
||
|
+endif
|
||
|
|
||
|
GZIP_PROG := gzip -9 -c
|
||
|
RM := rm -f
|
||
|
diff --git a/create-config.mk b/create-config.mk
|
||
|
index 2cc5284f..434dee06 100644
|
||
|
--- a/create-config.mk
|
||
|
+++ b/create-config.mk
|
||
|
@@ -2,7 +2,6 @@
|
||
|
# SPDX-License-Identifier: GPL-2.0-or-later
|
||
|
|
||
|
TOPDIR := .
|
||
|
-CREATE_CONFIG := 1
|
||
|
include $(TOPDIR)/Makefile.inc
|
||
|
|
||
|
# Check whether a function with name $1 has been declared in header file $2.
|
||
|
diff --git a/libmultipath/checkers/Makefile b/libmultipath/checkers/Makefile
|
||
|
index b3120611..6f7cfb95 100644
|
||
|
--- a/libmultipath/checkers/Makefile
|
||
|
+++ b/libmultipath/checkers/Makefile
|
||
|
@@ -28,7 +28,7 @@ install:
|
||
|
$(Q)$(INSTALL_PROGRAM) -m 755 $(LIBS) $(DESTDIR)$(plugindir)
|
||
|
|
||
|
uninstall:
|
||
|
- for file in $(LIBS); do $(RM) $(DESTDIR)$(plugindir)/$$file; done
|
||
|
+ $(Q)for file in $(LIBS); do $(RM) $(DESTDIR)$(plugindir)/$$file; done
|
||
|
|
||
|
clean: dep_clean
|
||
|
$(Q)$(RM) core *.a *.o *.gz *.so
|
||
|
diff --git a/libmultipath/foreign/Makefile b/libmultipath/foreign/Makefile
|
||
|
index 0e245d6f..b83213d6 100644
|
||
|
--- a/libmultipath/foreign/Makefile
|
||
|
+++ b/libmultipath/foreign/Makefile
|
||
|
@@ -20,7 +20,7 @@ install:
|
||
|
$(Q)$(INSTALL_PROGRAM) -m 755 $(LIBS) $(DESTDIR)$(plugindir)
|
||
|
|
||
|
uninstall:
|
||
|
- for file in $(LIBS); do $(RM) $(DESTDIR)$(plugindir)/$$file; done
|
||
|
+ $(Q)for file in $(LIBS); do $(RM) $(DESTDIR)$(plugindir)/$$file; done
|
||
|
|
||
|
clean: dep_clean
|
||
|
$(Q)$(RM) core *.a *.o *.gz *.so
|
||
|
diff --git a/libmultipath/prioritizers/Makefile b/libmultipath/prioritizers/Makefile
|
||
|
index e1688163..fdec36e7 100644
|
||
|
--- a/libmultipath/prioritizers/Makefile
|
||
|
+++ b/libmultipath/prioritizers/Makefile
|
||
|
@@ -40,7 +40,7 @@ install: $(LIBS)
|
||
|
$(Q)$(INSTALL_PROGRAM) -m 755 libprio*.so $(DESTDIR)$(plugindir)
|
||
|
|
||
|
uninstall:
|
||
|
- for file in $(LIBS); do $(RM) $(DESTDIR)$(plugindir)/$$file; done
|
||
|
+ $(Q)for file in $(LIBS); do $(RM) $(DESTDIR)$(plugindir)/$$file; done
|
||
|
|
||
|
clean: dep_clean
|
||
|
$(Q)$(RM) core *.a *.o *.gz *.so
|