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: Brian J. Murrell
Subject: Re: using the date relationship of two older files as a prerequisite
Date: Mon, 03 Dec 2012 19:00:06 -0500
User-agent: Mozilla/5.0 (X11; Linux i686; rv:17.0) Gecko/17.0 Thunderbird/17.0

On 12-11-29 12:50 PM, 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".
> 
> 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.

I think I've figured it out:

FORCE:

T: $(shell [[ O -nt O-stamp ]] && echo "FORCE")
        touch T
        touch -r O O-stamp

It seems a shame to have to call out the shell to perform one of the
functions at the heart of make (comparing the modification time of two
files) but I couldn't figure out any way to make make do that.

Still open to suggestions.  :-)

Cheers,
b.


Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

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