]> git.itanic.dy.fi Git - scan-pagemap/commitdiff
Makefile: Do not fail build if stale dependency files are present
authorTimo Kokkonen <kaapeli@itanic.dy.fi>
Fri, 21 Oct 2011 18:38:36 +0000 (21:38 +0300)
committerTimo Kokkonen <kaapeli@itanic.dy.fi>
Fri, 21 Oct 2011 18:38:36 +0000 (21:38 +0300)
If we happen to remove some old header files, the build should not
fail because the header files are still listed in the dependency
files.

Signed-off-by: Timo Kokkonen <kaapeli@itanic.dy.fi>
Makefile

index 782b9fcf385005dc588f700eb42f75202d3e6396..bf2120db11dc518eb21e682f4f01807e9924d211 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -33,9 +33,17 @@ endif
 ifeq ($(C),2)
        $(CHECKPATCH) -f $<
 endif
+       $(Q)cp .$@.d .$@.P; \
+            sed -e 's/#.*//' -e 's/^[^:]*: *//' -e 's/ *\\$$//' \
+                -e '/^$$/ d' -e 's/$$/ :/' < .$@.d >> .$@.P; \
+            mv .$@.P .$@.d
 
 %-debug.o: %.c
        $(QUIET_CC)$(CC) -MMD -MF .$@.d $(CFLAGS) -DDEBUG -O0 -c $< -o $@
+       $(Q)cp .$@.d .$@.P; \
+            sed -e 's/#.*//' -e 's/^[^:]*: *//' -e 's/ *\\$$//' \
+                -e '/^$$/ d' -e 's/$$/ :/' < .$@.d >> .$@.P; \
+            mv .$@.P .$@.d
 
 TAGS:
        @echo -e "\tTAGS\t"