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 e628bc9..bc1d33f 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 c961915..21cab7b 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) $<