This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Re%3A%5BPATCH%5D%20document%20the%20use%20of%20stamps%20in%20gcc%2FMakefile.in
- From: "Rafael EspÃndola" <rafael dot espindola at gmail dot com>
- To: "Alexandre Oliva" <aoliva at redhat dot com>
- Cc: "Geoff Keating" <geoffk at geoffk dot org>, "GCC Patches" <gcc-patches at gcc dot gnu dot org>
- Date: Mon, 20 Feb 2006 02:59:17 +0000
- Subject: Re: Re%3A%5BPATCH%5D%20document%20the%20use%20of%20stamps%20in%20gcc%2FMakefile.in
- References: <F9EF56C9-BABC-47BD-BD1D-20729CE98BCE@geoffk.org> <200512041021.28688.rafael.espindola@gmail.com> <or1wz53370.fsf@livre.oliva.athome.lsd.ic.unicamp.br> <564d96fb0601191110l4cce7cdm2f40ff1a8fe387a4@mail.gmail.com> <or8xta51cs.fsf@livre.oliva.athome.lsd.ic.unicamp.br> <564d96fb0602080925o780d6812t5b23c85936975837@mail.gmail.com> <ormzgndwg2.fsf@free.oliva.athome.lsd.ic.unicamp.br>
> The old, deprecated, non-side-effect automatic dependency
> computation. There are better ways to do this that don't force the
> early creation of such files.
From the GNU make manual:
----------------------------------------------
The practice we recommend for automatic prerequisite generation is
to have one makefile corresponding to each source file. For each
source file `NAME.c' there is a makefile `NAME.d' which lists what
files the object file `NAME.o' depends on. That way only the source
files that have changed need to be rescanned to produce the new
prerequisites.
----------------------------------------------
A bit off-topic, but what is the recommended way of doing automatic
dependency computation?
> > It is a way of informing GCC that we have messed with its
> > dependency graph and that it should reconsider.
>
> I really don't see how touching an empty header file would accomplish
> anything like that, though.
Touching a file present in a "include" will cause make to restart (and
rebuild the graph)
> > In this case, the next time that it starts, the stamp will no longer
> > exist and make will work correctly.
>
> Ah, you're talking about removing the stamp file? That would work,
> but might cause one undesirable build failure. In the absence of a
> better solution, we might go with that, but it would be ideal to get
> it to do the right thing always.
Yes. The only difference in my proposal is that make is restarted
after removing the stamp to force the recreation of the dependency
graph.
Rafael