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: Eli Zaretskii
Subject: Re: updating target at the end of recipe, after updating prerequisites, might not work?
Date: Mon, 14 Nov 2011 03:33:02 -0500

> From: "Mark Galeck (CW)" <address@hidden>
> Date: Sun, 13 Nov 2011 23:21:12 -0800
> Cc: "address@hidden" <address@hidden>
> 
> My main problem is that, on a single filesystem that supports sub-second 
> timestamps, some utilities make use of sub-second timestamps, and some don't. 
>  If a utility that supports them is used in prerequisite recipes, and a 
> utility that rounds to the nearest second, happens to be used in the target 
> recipe, but a utility that supports sub-second timestamp is used in recipes 
> for that target's prerequisites,  you see we have a problem!  Next rebuild 
> may well think prerequisites are newer than the target, and will rebuild 
> unnecessarily.  

Can you describe a practical situation where this happens to be a
problem?

A typical Makefile does not employ utilities that set time stamps to
specific values.  A typical Makefile invokes commands that process
input files into output files.  To create or update an output file,
most of these commands simply use the appropriate system API to create
or update a file, and leave it to the OS to set the time stamp
accordingly.  In these cases, the problem you describe should never
arise.

So what use cases are we talking about, in practice? are they only
those situations where you use "touch foo" to create an empty file?
If so, using "echo '' > foo" instead should resolve this problem,
right?



reply via email to

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