help-make
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Question about dependencies


From: Sam Ravnborg
Subject: Re: Question about dependencies
Date: Thu, 9 Apr 2009 12:24:51 +0200
User-agent: Mutt/1.4.2.1i

On Thu, Apr 09, 2009 at 06:38:56PM +1000, Gilles Gigan wrote:
> Hi,
> i have a question about automatically generating prerequisites as
> explained in section 4.14 of the make manual:
> If I understand this section correctly, the .d files must be shipped
> with the source code and must not be removed by a "clean" target.
> Otherwise, the next "make" will complain about not being able to
> include them, even though they will be generated afterwards.
> Is this correct ?
> 
> Now, I would like to get around having to ship these files with the
> source code. Is there a way to have make generate these .d files IFF
> they are missing, and then include them ?

First off make cannot possibly generate the dependency files,
you need some tool for that.

The typical way to deeal with generating .d files is to
generate them in the same command as used to generate .o files.

Then you can do a simple:

ifneq ($(wildcard *.d),)
include $(wildcard *.d)
endif

So you do not try to include .d files that does not yet exist.

        Sam




reply via email to

[Prev in Thread] Current Thread [Next in Thread]