help-make
[Top][All Lists]
Advanced

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

Re: updating target at the end of recipe, after updating prerequisites,


From: David Boyce
Subject: Re: updating target at the end of recipe, after updating prerequisites, might not work?
Date: Mon, 14 Nov 2011 07:25:47 -0500

On Mon, Nov 14, 2011 at 2:16 AM, Paul Smith <address@hidden> wrote:
> If you want to use sub-second timestamps you must find tools that
> support them, and avoid using tools that don't.

On a side note, I've often wondered why, after all these years and
discussions like this one, nobody's modified at least the GNU version
of touch to do its work by opening the file for write and writing 0
bytes to it, or appending one byte and then removing it, or whatever
it takes to force an mtime update, rather than using the flawed utimes
syscall. There may be corner cases where this wouldn't work but it
would be simple enough to fall back to utimes. And of course none of
this would apply to cases like --reference=FILE, --date=TIME, etc.,
only to simple "touch foo".

It feels like this would save a lot of confusion but it's so obvious I
can't believe it hasn't been considered before. Anybody know if it's
been kicked around and found wanting?

The short term workaround in make context, as Eli says, is to do the
same thing using "echo >foo" though I'd recommend ">>foo".

-David Boyce



reply via email to

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