help-make
[Top][All Lists]
Advanced

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

Re: How does make compare the timestamp if the file does not exist


From: Stephen Macmanus
Subject: Re: How does make compare the timestamp if the file does not exist
Date: Mon, 13 Jul 2009 20:49:43 -0700
User-agent: Thunderbird 2.0.0.22 (Windows/20090605)

When make detects the target does not exist and runs the
associated rules, it also runs any rules which use the
new target as a prerequisite.

In this example, any execution of make will *always* run
the rule for "boo" (unless it is created outside make),
and therefore always run the rule for "foo" also.

Hope this helps,

Stephen Macmanus


雷 高 wrote:
If the target of a rule does not exist or the timestamp of the target is older than any of the prerequisites, the target is out of date. My question is that if some files of prerequisites does not exist, how can we compare the timestamp.
For example:
foo : boo
        @echo foo
boo :
        @echo boo
Then if foo already exists, but the rule for "boo" does not create the file boo, so how compare the timestamp of foo and boo.
When I run the makefile, the console prints :
boo
foo
I want to know why the make parses the makefile like this.

A more general problem is that how the make treat files which doesn't exist and can't be created by explicit rules and implicit rules.

Thank you for your answer!


------------------------------------------------------------------------
好玩贺卡等你发,邮箱贺卡全新上线! <http://cn.rd.yahoo.com/mail_cn/tagline/card/*http://card.mail.cn.yahoo.com/>


------------------------------------------------------------------------

_______________________________________________
Help-make mailing list
address@hidden
http://lists.gnu.org/mailman/listinfo/help-make




reply via email to

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