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

Re: Bug#27697: auto-include-dependency failure case



On 12 Oct 1998, Manoj Srivastava wrote:

> Hi,
> 
> 	To cut a long story short, you have some .c files that depend
>  on a .h file. Initially, that .h file does not depend on
>  anything. You have set it up so that the dependency files are created
>  for the .c files, and, sure enough, the dependency files are created
>  for the .c files when they do not exist.

The info docs for GNU make are just terrible for this subject, IMHO they
describe the -WORST- way to manage dependencies.

What I have been doing of late is generating the .d file when the .o file
is built. Nothing depends on the .d file but if it exists it is included.
This makes the .o file depend on all included files and the .c file
automatically. Also the .d file depends on nothing so there is no rebuild
rule for it.

Not only does this speed make up a fair bit but it removes the problem of
make clean wanting to rebuild dependencies and missing .d files halting
make in it's tracks. The only remaining problem is erasing header-files
requires a make clean :<

In my make files I actually use the GNU C specific option to generate a .d
file as it compiles from .cc to .o, it runs -REALLY- fast compared to the
technique automake uses.

Jason


Reply to: