bug-make
[Top][All Lists]
Advanced

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

Re: Static multiple target rules


From: tom honermann
Subject: Re: Static multiple target rules
Date: Tue, 30 Mar 2010 23:08:05 -0700
User-agent: Thunderbird 2.0.0.24 (Windows/20100228)

On 3/30/2010 2:14 AM, Edward Welbourne wrote:
   y.tab.h y.tab.c y.output: yacc.ts
I don't actually see that y.output serves any role in this; simply
remove every reference to it and your example should be clearer.
It actually does serve a roll for testing purposes. Try the following with this test case:

   gmake clean
   gmake
   rm y.output
   gmake
   gmake

With GNU make 3.81, the second to last gmake invocation rebuilds y.output which also rebuilds y.tab.h and y.tab.c, but y.tab.o (now out of date) doesn't get rebuilt. An additional gmake invocation is necessary to get everything up to date - which is not desirable behavior.
   y.tab.o: y.tab.c y.tab.h
I don't understand .INTERMEDIATE well enough to know why this chain
fails to lead to y.tab.o's rule being run after yacc.ts's rule has
been run, in your -j case.  Something strange is going on,
I think what is happening is that time stamps are being checked "too early" in some cases. Make can't infer that y.tab.h, y.tab.c, and y.output are updated by the commands for yacc.ts. Depending on when it checks the time stamps for those files, it may see the times before or after the commands for yacc.ts are run. I recall seeing emails regarding GNU make caching time stamps, so that could contribute to this. Parallel builds would behave differently since a shared cache isn't used and each process would have to
check time stamps on its own.  So, behavior varies.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]