From patchwork Fri Jan 19 00:19:44 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Wilck X-Patchwork-Id: 10174343 X-Patchwork-Delegate: christophe.varoqui@free.fr Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 7DF19603B5 for ; Fri, 19 Jan 2018 00:20:26 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6F5DC283C8 for ; Fri, 19 Jan 2018 00:20:26 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 648FA284F1; Fri, 19 Jan 2018 00:20:26 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id CC54A20952 for ; Fri, 19 Jan 2018 00:20:25 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 6C9EDC057FA1; Fri, 19 Jan 2018 00:20:22 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 421A617F2C; Fri, 19 Jan 2018 00:20:22 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 10C5318033DB; Fri, 19 Jan 2018 00:20:22 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w0J0KIQ6011712 for ; Thu, 18 Jan 2018 19:20:18 -0500 Received: by smtp.corp.redhat.com (Postfix) id 5A48B18A2D; Fri, 19 Jan 2018 00:20:18 +0000 (UTC) Delivered-To: dm-devel@redhat.com Received: from mx1.redhat.com (ext-mx06.extmail.prod.ext.phx2.redhat.com [10.5.110.30]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 585A35C476; Fri, 19 Jan 2018 00:20:17 +0000 (UTC) Received: from smtp.nue.novell.com (smtp.nue.novell.com [195.135.221.5]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 5DF9F4AD7F; Fri, 19 Jan 2018 00:20:15 +0000 (UTC) Received: from emea4-mta.ukb.novell.com ([10.120.13.87]) by smtp.nue.novell.com with ESMTP (TLS encrypted); Fri, 19 Jan 2018 01:20:13 +0100 Received: from apollon.suse.de.de (nwb-a10-snat.microfocus.com [10.120.13.201]) by emea4-mta.ukb.novell.com with ESMTP (TLS encrypted); Fri, 19 Jan 2018 00:20:07 +0000 From: Martin Wilck To: Christophe Varoqui , dm-devel@redhat.com Date: Fri, 19 Jan 2018 01:19:44 +0100 Message-Id: <20180119001944.9565-3-mwilck@suse.com> In-Reply-To: <20180119001944.9565-1-mwilck@suse.com> References: <20180119001944.9565-1-mwilck@suse.com> X-Greylist: Sender passed SPF test, Sender IP whitelisted by DNSRBL, ACL 207 matched, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Fri, 19 Jan 2018 00:20:16 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Fri, 19 Jan 2018 00:20:16 +0000 (UTC) for IP:'195.135.221.5' DOMAIN:'smtp.nue.novell.com' HELO:'smtp.nue.novell.com' FROM:'mwilck@suse.com' RCPT:'' X-RedHat-Spam-Score: -2.301 (RCVD_IN_DNSWL_MED, SPF_PASS) 195.135.221.5 smtp.nue.novell.com 195.135.221.5 smtp.nue.novell.com X-Scanned-By: MIMEDefang 2.78 on 10.5.110.30 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-loop: dm-devel@redhat.com Cc: Xose Vazquez Perez , Martin Wilck Subject: [dm-devel] [PATCH 3/3] multipath-tools: add dependency tracking to Makefiles X-BeenThere: dm-devel@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: device-mapper development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: dm-devel-bounces@redhat.com Errors-To: dm-devel-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Fri, 19 Jan 2018 00:20:22 +0000 (UTC) X-Virus-Scanned: ClamAV using ClamSMTP Signed-off-by: Martin Wilck --- .gitignore | 1 + Makefile.inc | 2 +- kpartx/Makefile | 7 ++++++- libdmmp/Makefile | 7 ++++++- libdmmp/test/Makefile | 9 ++++++++- libmpathcmd/Makefile | 10 ++++++++-- libmpathpersist/Makefile | 8 +++++++- libmultipath/Makefile | 7 ++++++- libmultipath/checkers/Makefile | 8 +++++++- libmultipath/prioritizers/Makefile | 8 +++++++- mpathpersist/Makefile | 7 ++++++- multipath/Makefile | 7 ++++++- multipathd/Makefile | 7 ++++++- tests/Makefile | 9 ++++++++- 14 files changed, 83 insertions(+), 14 deletions(-) diff --git a/.gitignore b/.gitignore index 371b8758c0a1..35c59a7e2d51 100644 --- a/.gitignore +++ b/.gitignore @@ -5,6 +5,7 @@ *.so.0 *.a *.gz +*.d kpartx/kpartx multipath/multipath multipathd/multipathd diff --git a/Makefile.inc b/Makefile.inc index d82d3b5df3fe..eb99c36010c1 100644 --- a/Makefile.inc +++ b/Makefile.inc @@ -91,7 +91,7 @@ OPTFLAGS = -O2 -g -pipe -Wall -Wextra -Wformat=2 -Werror=implicit-int \ --param=ssp-buffer-size=4 CFLAGS := $(OPTFLAGS) -DBIN_DIR=\"$(bindir)\" -DLIB_STRING=\"${LIB}\" -DRUN_DIR=\"${RUN}\" \ - $(CFLAGS) + -MMD -MP $(CFLAGS) BIN_CFLAGS = -fPIE -DPIE LIB_CFLAGS = -fPIC SHARED_FLAGS = -shared diff --git a/kpartx/Makefile b/kpartx/Makefile index bf7362d95efd..7eb467ee3efb 100644 --- a/kpartx/Makefile +++ b/kpartx/Makefile @@ -44,5 +44,10 @@ uninstall: $(RM) $(DESTDIR)$(libudevdir)/rules.d/67-kpartx-compat.rules $(RM) $(DESTDIR)$(libudevdir)/rules.d/68-del-part-nodes.rules -clean: +clean: dep_clean $(RM) core *.o $(EXEC) *.gz + +include $(wildcard $(OBJS:.o=.d)) + +dep_clean: + $(RM) $(OBJS:.o=.d) diff --git a/libdmmp/Makefile b/libdmmp/Makefile index bf231ace1a1b..1dd3f34069b9 100644 --- a/libdmmp/Makefile +++ b/libdmmp/Makefile @@ -56,11 +56,13 @@ uninstall: $(RM) $(DESTDIR)$(man3dir)/libdmmp.h* $(RM) $(DESTDIR)$(pkgconfdir)/$(PKGFILE) -clean: +clean: dep_clean $(RM) core *.a *.o *.gz *.so *.so.* $(RM) -r docs/man $(MAKE) -C test clean +include $(wildcard $(OBJS:.o=.d)) + check: all $(MAKE) -C test check @@ -84,3 +86,6 @@ docs/man/$(EXTRA_MAN_FILES).gz: $(HEADERS) gzip -f $$file; \ done find docs/man -type f -name \*[0-9].gz + +dep_clean: + $(RM) $(OBJS:.o=.d) diff --git a/libdmmp/test/Makefile b/libdmmp/test/Makefile index acfb3bffb7f5..20b394587c4a 100644 --- a/libdmmp/test/Makefile +++ b/libdmmp/test/Makefile @@ -26,5 +26,12 @@ speed_test: $(SPD_TEST_EXEC) sudo env LD_LIBRARY_PATH=$(_libdmmpdir):$(_mpathcmddir) \ time -p ./$(SPD_TEST_EXEC) -clean: +clean: dep_clean rm -f $(TEST_EXEC) $(SPD_TEST_EXEC) + +OBJS = $(TEST_EXEC).o $(SPD_TEST_EXEC).o +include $(wildcard $(OBJS:.o=.d)) + + +dep_clean: + $(RM) $(OBJS:.o=.d) diff --git a/libmpathcmd/Makefile b/libmpathcmd/Makefile index 4f321017361d..53c08992420b 100644 --- a/libmpathcmd/Makefile +++ b/libmpathcmd/Makefile @@ -26,5 +26,11 @@ uninstall: $(RM) $(DESTDIR)$(syslibdir)/$(DEVLIB) $(RM) $(DESTDIR)$(includedir)/mpath_cmd.h -clean: - $(RM) core *.a *.o *.so *.so.* *.gz +clean: dep_clean + $(RM) core *.a *.o *.so *.so.* *.gz + +include $(wildcard $(OBJS:.o=.d)) + + +dep_clean: + $(RM) $(OBJS:.o=.d) diff --git a/libmpathpersist/Makefile b/libmpathpersist/Makefile index 1b4ec16a18f7..21fdad805f10 100644 --- a/libmpathpersist/Makefile +++ b/libmpathpersist/Makefile @@ -37,5 +37,11 @@ uninstall: $(RM) $(DESTDIR)$(includedir)/mpath_persist.h $(RM) $(DESTDIR)$(syslibdir)/$(DEVLIB) -clean: +clean: dep_clean $(RM) core *.a *.o *.so *.so.* *.gz + +include $(wildcard $(OBJS:.o=.d)) + + +dep_clean: + $(RM) $(OBJS:.o=.d) diff --git a/libmultipath/Makefile b/libmultipath/Makefile index 6447d8dafb4f..25b052729d48 100644 --- a/libmultipath/Makefile +++ b/libmultipath/Makefile @@ -61,5 +61,10 @@ uninstall: $(RM) $(DESTDIR)$(syslibdir)/$(LIBS) $(RM) $(DESTDIR)$(syslibdir)/$(DEVLIB) -clean: +clean: dep_clean $(RM) core *.a *.o *.so *.so.* *.gz + +include $(wildcard $(OBJS:.o=.d)) + +dep_clean: + $(RM) $(OBJS:.o=.d) diff --git a/libmultipath/checkers/Makefile b/libmultipath/checkers/Makefile index bce6b8b7be75..9559038a770d 100644 --- a/libmultipath/checkers/Makefile +++ b/libmultipath/checkers/Makefile @@ -36,5 +36,11 @@ install: uninstall: for file in $(LIBS); do $(RM) $(DESTDIR)$(libdir)/$$file; done -clean: +clean: dep_clean $(RM) core *.a *.o *.gz *.so + +OBJS := $(LIBS:libcheck%.so=%.o) libsg.o directio.o +include $(wildcard $(OBJS:.o=.d)) + +dep_clean: + $(RM) $(OBJS:.o=.d) diff --git a/libmultipath/prioritizers/Makefile b/libmultipath/prioritizers/Makefile index 0c71e6334473..b3cc944c810d 100644 --- a/libmultipath/prioritizers/Makefile +++ b/libmultipath/prioritizers/Makefile @@ -38,5 +38,11 @@ install: $(LIBS) uninstall: for file in $(LIBS); do $(RM) $(DESTDIR)$(libdir)/$$file; done -clean: +clean: dep_clean $(RM) core *.a *.o *.gz *.so + +OBJS = $(LIBS:libprio%.so=%.o) alua_rtpg.o +include $(wildcard $(OBJS:.o=.d)) + +dep_clean: + $(RM) $(OBJS:.o=.d) diff --git a/mpathpersist/Makefile b/mpathpersist/Makefile index 6e5acd3b751e..51268010b31d 100644 --- a/mpathpersist/Makefile +++ b/mpathpersist/Makefile @@ -22,9 +22,14 @@ install: $(INSTALL_PROGRAM) -d $(DESTDIR)$(man8dir) $(INSTALL_PROGRAM) -m 644 $(EXEC).8.gz $(DESTDIR)$(man8dir) -clean: +clean: dep_clean $(RM) core *.o $(EXEC) *.gz +include $(wildcard $(OBJS:.o=.d)) + uninstall: $(RM) $(DESTDIR)$(bindir)/$(EXEC) $(RM) $(DESTDIR)$(man8dir)/$(EXEC).8.gz + +dep_clean: + $(RM) $(OBJS:.o=.d) diff --git a/multipath/Makefile b/multipath/Makefile index 468c056d49d0..654568af3576 100644 --- a/multipath/Makefile +++ b/multipath/Makefile @@ -37,5 +37,10 @@ uninstall: $(RM) $(DESTDIR)$(man8dir)/$(EXEC).8.gz $(RM) $(DESTDIR)$(man5dir)/$(EXEC).conf.5.gz -clean: +clean: dep_clean $(RM) core *.o $(EXEC) *.gz + +include $(wildcard $(OBJS:.o=.d)) + +dep_clean: + $(RM) $(OBJS:.o=.d) diff --git a/multipathd/Makefile b/multipathd/Makefile index e6f140bf3b91..251690ec5e2a 100644 --- a/multipathd/Makefile +++ b/multipathd/Makefile @@ -49,5 +49,10 @@ uninstall: $(RM) $(DESTDIR)$(unitdir)/$(EXEC).service $(RM) $(DESTDIR)$(unitdir)/$(EXEC).socket -clean: +clean: dep_clean $(RM) core *.o $(EXEC) *.gz + +include $(wildcard $(OBJS:.o=.d)) + +dep_clean: + $(RM) $(OBJS:.o=.d) diff --git a/tests/Makefile b/tests/Makefile index ff58cb8bb207..f6b55836a434 100644 --- a/tests/Makefile +++ b/tests/Makefile @@ -17,7 +17,14 @@ TESTS := uevent all: $(TESTS:%=%.out) -clean: +clean: dep_clean rm -f $(TESTS:%=%-test) $(TESTS:%=%.out) $(TESTS:%=%.o) +OBJS = $(TESTS:%=%.o) +include $(wildcard $(OBJS:.o=.d)) + + + +dep_clean: + $(RM) $(OBJS:.o=.d)