Date: Wed, 19 Apr 2000 16:58:19 +0200 Message-Id: <200004191458.QAA18181@acp3bf.physik.rwth-aachen.de> From: Hans-Bernhard Broeker To: djgpp AT delorie DOT com Subject: Re: OT: `make clean' wants to rebuild `.d' files X-Newsgroups: comp.os.msdos.djgpp In-Reply-To: <200004191406.JAA04929@darwin.sfbr.org> Reply-To: djgpp AT delorie DOT com Errors-To: nobody AT delorie DOT com X-Mailing-List: djgpp AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk 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.