Mail Archives: djgpp/2000/04/19/11:16:01

Date: Wed, 19 Apr 2000 16:58:19 +0200
Message-Id: <>
From: Hans-Bernhard Broeker <broeker AT physik DOT rwth-aachen DOT de>
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: <>
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

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)

... 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 -

  webmaster     delorie software   privacy  
  Copyright 2019   by DJ Delorie     Updated Jul 2019