[Top] [All Lists]

[PATCH 01/36] xfsprogs: fix automatic dependency generation

To: xfs@xxxxxxxxxxx
Subject: [PATCH 01/36] xfsprogs: fix automatic dependency generation
From: Dave Chinner <david@xxxxxxxxxxxxx>
Date: Wed, 13 Nov 2013 17:40:25 +1100
Delivered-to: xfs@xxxxxxxxxxx
In-reply-to: <1384324860-25677-1-git-send-email-david@xxxxxxxxxxxxx>
References: <1384324860-25677-1-git-send-email-david@xxxxxxxxxxxxx>
From: Dave Chinner <dchinner@xxxxxxxxxx>

Adding are removing a header file does not result in dependency
regeneration like it should. make clean will rebuild the
dependencies, but a normal make won't. Fix it.

Signed-off-by: Dave Chinner <dchinner@xxxxxxxxxx>
Reviewed-by: Christoph Hellwig <hch@xxxxxx>
 include/buildrules | 20 ++++++++++++++++----
 1 file changed, 16 insertions(+), 4 deletions(-)

diff --git a/include/buildrules b/include/buildrules
index 49cb2a4..edb1beb 100644
--- a/include/buildrules
+++ b/include/buildrules
@@ -79,18 +79,30 @@ endif # _BUILDRULES_INCLUDED_
 # dependency build is automatic, relies on gcc -MM to generate.
+# This is a bit messy. It regenerates the depenencies on each build so
+# that we catch files being added and removed. There are other ways of doing
+# this (e.g. per-file dependency files) but that requires more in-depth changes
+# to the build system. Compile time is not an issue for us, so the
+# rebuild on every make invocation isn't a problem we need to care about. Just
+# do it silently so it doesn't make the build unnecessarily noisy.
 .PHONY : depend ltdepend install-qa
-ltdepend: .ltdep
+ltdepend: rmltdep .ltdep
+       @rm -f .ltdep
 .ltdep: $(CFILES) $(HFILES)
-       @echo "    [LTDEP]"
        $(Q)$(MAKEDEP) $(CFILES) | $(SED) -e 's,^\([^:]*\)\.o,\1.lo,' > .ltdep
-depend: .dep
+depend: rmdep .dep
+       @rm -f .dep
 .dep: $(CFILES) $(HFILES)
-       @echo "    [DEP]"
        $(Q)$(MAKEDEP) $(CFILES) > .dep

<Prev in Thread] Current Thread [Next in Thread>