bug-make
[Top][All Lists]
Advanced

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

Re: [bug #30505] Make doesn't update the entire dependency chain?


From: Geoff Lywood
Subject: Re: [bug #30505] Make doesn't update the entire dependency chain?
Date: Wed, 21 Jul 2010 11:48:21 -0700

On Wed, Jul 21, 2010 at 1:28 AM, Edward Welbourne <address@hidden> wrote:
> previous_var:
>       echo $(VAR) > previous_var
> .PHONY: previous_var

I suggest you eliminate this .PHONY - previous_var is a real file on
disk, so not a phony target.  There might be a case for it to be
declared .PHONY in an *else* clause, when PREVIOUS_VAR agrees with
VAR.

The .PHONY forces make to update the file, even though it has no dependencies and would otherwise be considered up-to-date.
 

> /source/test $ make VAR=abc
> cat: previous_var: No such file or directory

I suggest
PREVIOUS_VAR := $(if $(wildcard previous_var),$(shell cat previous_var),)
to avoid that one, or simply
PREVIOUS_VAR := $(shell cat previous_var 2>/dev/null)

True. I was trying to keep the example fairly simple, and ensure that the $(wildcard ) didn't mess up the directory cache as other bugs suggest might happen.
 

Not that I expect either of these to fix your problem (albeit the
first might) !

       Eddy.

Thanks for taking a look!
- Geoff

reply via email to

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