help-make
[Top][All Lists]
Advanced

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

Re: using the date relationship of two older files as a prerequisite


From: Mason
Subject: Re: using the date relationship of two older files as a prerequisite
Date: Fri, 07 Dec 2012 16:53:33 +0100
User-agent: Mozilla/5.0 (Windows NT 5.1; rv:17.0) Gecko/20100101 Firefox/17.0 SeaMonkey/2.14.1

Brian J. Murrell wrote:

> I have a file which is not created by make but is created/updated by an
> outside process.  The time stamp on this file will always be some time
> in the past.  Let's call this file "O".

OK, so "O" is just like a normal source file; it is not created by make,
and it is created/updated by your text editor.

> I have a target which I want make to build which we'll call "T".  I want
> T rebuilt if file O is newer than it was the last time T was built.  But
> even though the time on O might be newer than it was the last time T was
> built, it will still not be newer than T.

This paragraph does not make sense (to me).

At some point, "O" is modified (possibly several times).
Suppose the "O" was last modified at T1.
Then you call make, which builds "T" at T2.
Obviously T1 < T2
If "O" is modified (possibly several times) at T3,
then "O" is obviously newer than "T" since T2 < T3.

When T is built, it is (by design) newer than its prerequisites.

"T rebuilt if file O is newer than it was the last time T was built"
is the natural "make" behavior.
"O" cannot change after "T" is built AND "still not be newer than T".

> Somehow I need to introduce some kind of time tracking mechanism on O
> which triggers a dependency on T, perhaps through a "stamp" file of some
> sort but I'm not quite getting my head around it.

What am I missing?

T : O
  echo FOO > T

-- 
Regards.




reply via email to

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