This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: @true in makefiles


Rafael Ãvila de EspÃndola <rafael.espindola@gmail.com> writes:

> According to a comment in line 2694 of gcc/Makefile.in, a dummy command like 
> @true must be added to a rule to "force gnu make to recheck modification 
> times.".
> 
> But the GNU make manual says that a rule without a command simply states a 
> dependency.
> 
> In gcc, many of those "dependency only" rules depend on a stamp. A 
> hack that may be used to remove the stamp itself is to use a pattern rule 
> where the % matches just a single character (the . for example).

The cases you have to look at are the ones with move-if-change.  You
have to make sure that if the file does not change, none of the
dependencies are considered to have changed.

For example in

multilib.h: s-mlib; @true
s-mlib: $(srcdir)/genmultilib Makefile
	...
	$(SHELL) $(srcdir)/../move-if-change tmp-mlib.h multilib.h
	$(STAMP) s-mlib

we need the property that if multilib.h changes, everything that
depends upon it gets rebuilt.  If genmultilib or Makefile changes, we
must try rebuilding multilib.h.  However, if multilib.h does not then
change, then things that depend upon multilib.h should not get rebuilt
for that reason.

The @true is necessary so that make checks whether the timestamp of
multilib.h changed before deciding that it will rebuild things that
depend upon multilib.h.

Can you restate your plan based on that, showing examples which use
move-if-change?  Thanks.

Ian


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]