Linux Device Mapper development
 help / color / mirror / Atom feed
From: Martin Wilck <mwilck@suse.com>
To: Christophe Varoqui <christophe.varoqui@opensvc.com>
Cc: dm-devel@redhat.com, Xose Vazquez Perez <xose.vazquez@gmail.com>,
	Martin Wilck <mwilck@suse.com>
Subject: [PATCH 4/4] multipath-tools: build: prevent intermediate file deletion
Date: Thu,  8 Mar 2018 00:08:59 +0100	[thread overview]
Message-ID: <20180307230859.14926-5-mwilck@suse.com> (raw)
In-Reply-To: <20180307230859.14926-1-mwilck@suse.com>

By default, "make" removes intermediate files from implicit rules
if they are the only dependency. Prevent that by using .SECONDARY.
Otherwise some files will be re-built upon second invocation of "make".

Fixes: e39283ebd79b "multipath-tools: add dependency tracking to Makefiles"
Reported-by: Xose Vazquez Perez <xose.vazquez@gmail.com>
Signed-off-by: Martin Wilck <mwilck@suse.com>
---
 Makefile.inc                       | 1 +
 libmultipath/checkers/Makefile     | 2 ++
 libmultipath/foreign/Makefile      | 2 ++
 libmultipath/prioritizers/Makefile | 2 ++
 tests/Makefile                     | 5 ++---
 5 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/Makefile.inc b/Makefile.inc
index a5b9d4e3fa74..5d6123ded51a 100644
--- a/Makefile.inc
+++ b/Makefile.inc
@@ -127,4 +127,5 @@ check_file = $(shell	\
 	)
 
 %.o:	%.c
+	@echo building $@ because of $?
 	$(CC) $(CFLAGS) -c -o $@ $<
diff --git a/libmultipath/checkers/Makefile b/libmultipath/checkers/Makefile
index 9559038a770d..87c15bd777c3 100644
--- a/libmultipath/checkers/Makefile
+++ b/libmultipath/checkers/Makefile
@@ -40,6 +40,8 @@ clean: dep_clean
 	$(RM) core *.a *.o *.gz *.so
 
 OBJS := $(LIBS:libcheck%.so=%.o) libsg.o directio.o
+.SECONDARY: $(OBJS)
+
 include $(wildcard $(OBJS:.o=.d))
 
 dep_clean:
diff --git a/libmultipath/foreign/Makefile b/libmultipath/foreign/Makefile
index dfba11e86d76..fe98ddf7e4e9 100644
--- a/libmultipath/foreign/Makefile
+++ b/libmultipath/foreign/Makefile
@@ -24,6 +24,8 @@ clean: dep_clean
 	$(RM) core *.a *.o *.gz *.so
 
 OBJS := $(LIBS:libforeign-%.so=%.o)
+.SECONDARY: $(OBJS)
+
 include $(wildcard $(OBJS:.o=.d))
 
 dep_clean:
diff --git a/libmultipath/prioritizers/Makefile b/libmultipath/prioritizers/Makefile
index b3cc944c810d..ab7bc07572ec 100644
--- a/libmultipath/prioritizers/Makefile
+++ b/libmultipath/prioritizers/Makefile
@@ -42,6 +42,8 @@ clean: dep_clean
 	$(RM) core *.a *.o *.gz *.so
 
 OBJS = $(LIBS:libprio%.so=%.o) alua_rtpg.o
+.SECONDARY: $(OBJS)
+
 include $(wildcard $(OBJS:.o=.d))
 
 dep_clean:
diff --git a/tests/Makefile b/tests/Makefile
index f6b55836a434..7ae6b9012b5a 100644
--- a/tests/Makefile
+++ b/tests/Makefile
@@ -21,10 +21,9 @@ clean: dep_clean
 	rm -f $(TESTS:%=%-test) $(TESTS:%=%.out) $(TESTS:%=%.o)
 
 OBJS = $(TESTS:%=%.o)
+.SECONDARY: $(OBJS)
+
 include $(wildcard $(OBJS:.o=.d))
 
-
-
-
 dep_clean:
 	$(RM) $(OBJS:.o=.d)
-- 
2.16.1

  parent reply	other threads:[~2018-03-07 23:08 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-07 23:08 [PATCH 0/4] multipath-tools: important fixes for 0.7.5 Martin Wilck
2018-03-07 23:08 ` [PATCH 1/4] libmultipath: fix crash on shutdown if io_err thread isn't running Martin Wilck
2018-03-07 23:08 ` [PATCH 2/4] multipathd: fix -Wpointer-to-int-cast warning in uxlsnr Martin Wilck
2018-03-07 23:08 ` [PATCH 3/4] multipath: fix clang warning in delegate_to_multipathd Martin Wilck
2018-03-07 23:08 ` Martin Wilck [this message]
2018-03-08 16:04 ` [PATCH 0/4] multipath-tools: important fixes for 0.7.5 Xose Vazquez Perez
2018-03-10  7:43   ` Christophe Varoqui
2018-03-27 19:39     ` Michael Laß
2018-03-27 20:55       ` Christophe Varoqui

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180307230859.14926-5-mwilck@suse.com \
    --to=mwilck@suse.com \
    --cc=christophe.varoqui@opensvc.com \
    --cc=dm-devel@redhat.com \
    --cc=xose.vazquez@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox