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: Angel Tsankov
Subject: Re: "Advanced Auto-Dependency Generation" question
Date: Tue, 16 Aug 2005 18:52:08 +0300

----- Original Message ----- From: "Anna Olsson" <address@hidden>
To: <address@hidden>
Sent: Tuesday, August 16, 2005 11:28 AM
Subject: "Advanced Auto-Dependency Generation" question


I've read the "Advanced Auto-Dependency Generation" article - but I'm
wondering about this:

The solution to the second problem (make reports an error when the
dependecy file does not exist) is to make make not care about whether or not dependency files exist. But what if a dependency file is accidentaly deleted? Make doesn't care, but the corresponding target will never be
rebuilt until the corresponding .c file is altered or the .o file is
removed.

You could fix this by adding a Rule without Commands or Prerequisites for any of the dependency files. 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. One can think of this as the penalty for deleting dependency files :)

Btw, I had to add an empy @echo command in the list of commands of each dependency file. Otherwise, make 3.80 would not "image" the missing dependency file is up-to-date as explained in the article you mention (and in the GNU make manual, as well).

I would consider that to be a serious error! Did I miss something?

No, you didn't!

HTH
Angel Tsankov
address@hidden




reply via email to

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