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

Re: [Xen-devel] [PATCH 02/13] Config.mk: replace dependency to genpath with actual target



On Wed, 2014-08-27 at 10:36 +0200, Olaf Hering wrote:
> On Tue, Aug 26, Ian Campbell wrote:
> 
> > On Mon, 2014-07-28 at 11:05 +0200, Olaf Hering wrote:
> > 
> > Sorry for the delay in looking into this, I've been on vacation and
> > travel.
> > 
> > > genpath is a detail of buildmakevars2file. Replace the dependency to
> > > genpath with the actual buildmakevars2file target. This change by
> > > itself does not fix any bug. Upcoming changes will add dependencies to
> > > $(target), but no rule exist to create $(target).
> > > 
> > > No change in behaviour is expected by this patch.
> > > 
> > > Note: target.tmp ($(1).tmp) is not marked as .PHONY because
> > > move-if-changed in the target rule will remove target.tmp by renaming
> > > it to target. As a result make will always attempt to rebuild it.
> > 
> > Does the scheme you've got here end up differing from:
> > 
> >     $(1):
> >        rm -f $(1).tmp; \
> >         $(foreach var, $(BUILD_MAKE_VARS), \
> >                  echo "$(var)=\"$($(var))\"" >>$(1).tmp;) \
> >         $(call move-if-changed,$(1).tmp,$(1))
> > 
> > (i.e. avoiding the $(1).tmp rule)
> 
> In my testing make did always rebuild the targets depending on _paths.h
> for example. The reason is that _paths.h is .PHONY, which cause make to
> drop _paths.h and see it as new, even if the content did not change. 

It seems that the bug here is that _paths.h is .PHONY then. Without that
the use of move-if-changed would prevent the output file changing
unnecessarily and make would not bother to rebuild the dependents.

> With _paths.h.tmp being .PHONY _paths.h remains the same for make.
> 
> Not sure why that happens, perhaps thats how .PHONY works.

It essentially indicates to make that the target is not an actual file
(it is in some sense "virtual") so make never checks for an existing
file.

Ian.


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.