help-make
[Top][All Lists]
Advanced

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

Re: Puzzling $(shell echo *) vs $(wildcard *) in phase 1


From: Paul Smith
Subject: Re: Puzzling $(shell echo *) vs $(wildcard *) in phase 1
Date: Tue, 01 Oct 2013 10:35:43 -0400

On Tue, 2013-10-01 at 21:42 +1000, David wrote:
> Based on this I expect that this makefile would be entirely
> immediately expanded during phase 1, and that the 3 statements would
> be expanded in order. But the output seems to prove that evaluation of
> line 2 does not occur between lines 1 and 3.
> 
> Can anyone explain what is happening here?

My suspicion is that this is a result of make's directory caching.  The
wildcard function reads through the directory cache to get the results
of the wildcard match.

That means that if make has cached the contents of the directory then
you run a $(shell ...) function which modifies the directory "behind
make's back" (basically outside of a rule with that file as a target),
make will not notice the change.




reply via email to

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