Loading...

help-make@gnu.org

[Prev] Thread [Next]  |  [Prev] Date [Next]

RE: this is embarrasing... prerequisiste gets updated, but make still says it is older than target Paul Smith Mon Apr 02 06:02:01 2012

On Mon, 2012-04-02 at 05:20 -0700, Mark Galeck (CW) wrote:
> >However the above pseudo-code is nonsensical; you obviously have some
> esoteric behavior you're trying to encode here but without knowing the
> 
> I believe by "nonsensical" you mean, "does not follow Paul's rules of
> makefiles".

I meant, as written it doesn't have any point.  Obviously your real
makefile has a reason for doing what it's doing but that reason is not
reflected here so we can't say more about it.

> Same behaviour as before.  If foobar is newer than foobar1, then >make
> foobar, updates only foobar1 but not foobar.  
> 
> .PHONY: phony
> 
> foobar: foobar1
>       touch $@
> 
> foobar1: | resources
>       touch $@
> 
> resources: phony 
>       touch foobar1
>       touch $@

This is not different.  The order-only prerequisite means that the
"resources" target is not considered by make when it decides whether or
not to rebuild foobar1.  So make never tries to rebuild 'foobar1' (you
can see this in the output).

Because make never needs to rebuild foobar1 (it already exists and it
has no normal prerequisites, so it will never actually be rebuilt) and
make knows of no other way the foobar1 timestamp can be updated, it
assumes that foobar1 hasn't been changed since the first time make saw
it.  And the first time make saw it, the timestamp on foobar1 was older
than the one on foobar.  Hence, nothing needs to be done for foobar.

-- 
-------------------------------------------------------------------------------
 Paul D. Smith <[EMAIL PROTECTED]>          Find some GNU make tips at:
 http://www.gnu.org                      http://make.mad-scientist.net
 "Please remain calm...I may be mad, but I am a professional." --Mad Scientist


_______________________________________________
Help-make mailing list
[EMAIL PROTECTED]
https://lists.gnu.org/mailman/listinfo/help-make