Patch: automatic dependencies for gcc
Paolo Bonzini
bonzini@gnu.org
Tue Mar 18 14:35:00 GMT 2008
> Ralf> The reason I see against my proposal that IMVHO carries real weight
> Ralf> would be if you were to require up to date deps files. I would not know
> Ralf> how to easily reformulate
> Ralf> %.o $(DEPDIR)/%.d: %.c
> Ralf> rules into the subdir/$(DEPDIR) scheme. Why aren't you using this BTW?
> Ralf> It would already be a bit safer than what you currently have, even if
> Ralf> you don't go all the way and make $(DEPFILES) a prerequisite of 'all'.
>
> 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.
>
> I think include time is too early to build the .d files.
Agreed. I think it's better to remake dep files as side effect of
compilation (see
http://www.gnu.org/software/libtool/manual/automake/Dependency-Tracking-Evolution.html
for more info), which means that %.d will never appear in a rule.
With this sorted out, Ralf's patch at
http://permalink.gmane.org/gmane.comp.gcc.patches/158114 (especially if
redone to use $(*D) and $(*F) instead of dir/notdir) does not seem too ugly.
Paolo
More information about the Gcc-patches
mailing list