Mail Archives: djgpp/2000/04/19/11:16:01
In article <200004191406 DOT JAA04929 AT darwin DOT sfbr DOT org> you wrote:
> As described in the info file for `make', I am using a pattern rule to
> generate `.d' files for each C source file, then including the `.d'
> files, as follows:
> depends=$(sources:.c=.d)
> include $(depends)
> But now `make clean' will insist on remaking any stale `.d' files
> before deleting anything (including the `.d' files!). And `make info'
> will remake stale `.d' files which have nothing to do with the `.txi'
> sources! This is really annoying; I understand why this is happening,
> but is there a more efficient way to include the `.d' files?
Don't use a fixed list of dependency files, then. Use a wildcard to
generate a list of all .d files currently existing, and include it
only if the list is nonempty. That's how the DJGPP library&tools
source tree does it:
DEPS := $(wildcard *.d)
ifneq ($(DEPS),)
include $(DEPS)
endif
... and don't delete the *.d files in 'make clean', only in 'make
realclean' or an equivalent.
--
Hans-Bernhard Broeker (broeker AT physik DOT rwth-aachen DOT de)
Even if all the snow were burnt, ashes would remain.
- Raw text -