> 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.

> /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)

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

        Eddy.

_______________________________________________
Bug-make mailing list
Bug-make@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-make

Reply via email to