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

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

Reply via email to