]> git.itanic.dy.fi Git - scan-pagemap/blobdiff - Makefile
Makefile: Do not fail build if stale dependency files are present
[scan-pagemap] / 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"