X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ian/git?p=subdirmk.git;a=blobdiff_plain;f=cdeps.sd.mk;h=37ea60ff856f70b1339da87e997aaa3d31c34b3f;hp=402e687c6aa63153951e95e704d02f488a77d547;hb=b0bdaa30dd60890b5494fab1f3e7f5d70a8ceb8e;hpb=25a516a59e7811b8626b5fe40b49c5ef942db697 diff --git a/cdeps.sd.mk b/cdeps.sd.mk index 402e687..37ea60f 100644 --- a/cdeps.sd.mk +++ b/cdeps.sd.mk @@ -2,10 +2,11 @@ # Copyright 2019 Mark Wooding # Copyright 2019 Ian Jackson # SPDX-License-Identifier: LGPL-2.0-or-later +# There is NO WARRANTY. &# Usage: &# &:include subdirmk/cdeps.sd.mk -&# (probably in Perdir.sd.mk) +&# (probably in Suffix.sd.mk) &# &# Arranges for automatic #include dependency tracking for &# C compilation. The compiler is asked to write the dependencies to @@ -17,7 +18,9 @@ CDEPS_CFLAGS ?= -MD -MF $(*D)/.$(*F).d -&DEPFILES += $(foreach b,$(patsubst %.o,%,$(&OBJECTS)), \ +&CDEPS_OBJECTS += $(&OBJECTS) + +&DEPFILES += $(foreach b,$(patsubst %.o,%,$(&CDEPS_OBJECTS)), \ $(dir $b).$(notdir $b).d) -include $(&DEPFILES)