chiark / gitweb /
deps .*.d
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Wed, 13 Nov 2019 17:17:28 +0000 (17:17 +0000)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Wed, 13 Nov 2019 17:17:28 +0000 (17:17 +0000)
.gitignore
subdirmk/cdeps.mk.in [deleted file]
subdirmk/cdeps.sd.mk [new file with mode: 0644]
subdirmk/usual.mk.in

index e628bc9be11c83b2989d583c565c64a7ecda5984..bc1d33f16dce9103faf1de7cf83f38ca2ec5b28b 100644 (file)
@@ -1,6 +1,6 @@
 ## Build artifacts.
 *.a
-*.d
+.*.d
 *.o
 *.stamp
 /lib/t/toytest
diff --git a/subdirmk/cdeps.mk.in b/subdirmk/cdeps.mk.in
deleted file mode 100644 (file)
index 7df96f3..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-
-&DEPFILES += $(patsubst %.o,%.d,$(&OBJECTS))
--include $(&DEPFILES)
-
diff --git a/subdirmk/cdeps.sd.mk b/subdirmk/cdeps.sd.mk
new file mode 100644 (file)
index 0000000..aeb35bf
--- /dev/null
@@ -0,0 +1,5 @@
+
+&DEPFILES += $(foreach b,$(patsubst %.o,%,$(&OBJECTS)), \
+               $(dir $b).$(notdir $b).d)
+-include $(&DEPFILES)
+
index c961915df9899c906cb74e4edf0429aeff0840dc..21cab7bbca5b4f357a385fe7d9ef86d2955d9b23 100644 (file)
@@ -16,7 +16,7 @@ LIBS          ?= @LIBS@
 
 LINK           ?= $(CC) -o$@ $(CFLAGS) $(LDFLAGS)
 AR             ?= ar
-COMPILE                ?= $(CC) -c -o$@ -MD $(DEFS) $(INCLUDES) $(CFLAGS)
+COMPILE                ?= $(CC) -c -o$@ -MD -MF $(*D)/.$(*F).d $(DEFS) $(INCLUDES) $(CFLAGS)
 
 %.o: %.c
        $(COMPILE) $<