help-make
[Top][All Lists]
Advanced

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

Re: "Advanced Auto-Dependency Generation" question


From: Anna Olsson
Subject: Re: "Advanced Auto-Dependency Generation" question
Date: Wed, 17 Aug 2005 11:11:42 +0200

Your suggested method seems to work just fine! In your first reply I thought you just referred to the method recommended in the GNU Make Manual, but this is quite elegant!
BTW, I don't need to @echo in the %.d rule. An empty command line (tab) was sufficient for my make version.
 
Thanks!
Anna

----- Original Message -----

Re: "Advanced Auto-Dependency Generation" question


From: Angel Tsankov
Subject: Re: "Advanced Auto-Dependency Generation" question
Date: Tue, 16 Aug 2005 23:58:47 +0300

Hi,

I don't recall many details, but...

Angel Tsankov wrote:
You also need to add each dependency
file on the list of prerequisites of the respective .o file. This will
trigger rebuild of the object and dependency file if the depenency
file is missing...

you might get a situation where unnecessary make-runs or builds are done, just to satisfy the new dependency chains you create, *if* make knows how to build dependency files in the first place.

I'm not sure I was clear enough, so let me illustrate my idea with an example:

build: (object_files)
#link object files

%.o: %.c %.d
#build dependency file
#build object file

-include $(dependency_files)

#This rule is supposed to cause make to "imagine" that a missing
#dependency file is up-to-date and therefore it must
#rebuild all targets that depend on the missing dependency file
%.d:
#I had to put a @echo command here for this rule to work
#as documented in section 4.7 of the GNU make manual.

Do you now see any cicumstancies that will cause unnecessary builds to
be done?
Do you see any other inefficiencies or potential problems in this
idea?


[snip]
Greg's suggestion is the way to go if your users may delete dependency files inadvertently.


Greg suggested that they should be deleted but said nothing about how to delete them. I do not consider this a complete solution.

Angel Tsankov
address@hidden

reply via email to

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