Patch: automatic dependencies for gcc
Tom Tromey
tromey@redhat.com
Sun Mar 9 16:55:00 GMT 2008
>>>>> "Ralf" == Ralf Wildenhues <Ralf.Wildenhues@gmx.de> writes:
>> It seems to me that this will cause us to run these rules at -include
>> time. -include will not error if the file does not exist, but if the
>> file can be remade, make will try to do that.
Ralf> I don't think make will ignore prerequisites of the .c files when
Ralf> considering remaking include files. If it did, I'd consider that
Ralf> a bug. Or does gcc/Makefile.in not have full dependency information?
Yeah, we're probably ok here -- but this isn't really the problem, see
below.
>> I think include time is too early to build the .d files.
Ralf> Sure. But I think make would just remake them after redoing whatever
Ralf> else it needs to redo.
Make will attempt to remake the include files after reading all
makefiles, but before trying to build the user's requested target.
This leads to weird rebuilds in some circumstances.
For instance, if you touch a .c file and then "make clean", make will
happily rebuild the corresponding .o before deleting all the objects.
FWIW this exact scenario is one reason that Automake moved to
dependencies-as-side-effects in the first place.
I think experience has shown that people don't often delete the deps
files. And, if they do, a simple "mostclean" or the like suffices to
fix the problem. Of course this is not ideal, but I think a make
extension is needed to really fix the problem.
Tom
More information about the Gcc-patches
mailing list