On 10/29/07, Alexander Kriegisch <[EMAIL PROTECTED]> wrote:
>
> FOO:=bla
>
> $(FOO):
>         @echo "## $(FOO) ##"
>
> FOO:=
>
> The target name $(FOO) is expanded to "bla", but $(FOO) is expanded to
> nothing inside the action. I studied the manual of GNU make 3.81, but
> found no explanation for this effect. Can you point me to the section I
> should read in order to unserstand how changing values affect actions?



Hi, Alexander! This isn't a bug, but a misunderstanding. The evaluation is
happing in this order:

FOO:=blah
blah:
   <blah's rules>
FOO:=

the blah target is then run AFTER the second assignment. At that point,
blah's rules evaluate $(FOO) as an empty value. Target names are evaluated
as early as possible (they must be, or else different targets would be
dynamically created every time $(FOO) changes values). The text of target
rules is evaluated at the time it is run, though.


-- 
----- stephan beal
http://wanderinghorse.net/home/stephan/
_______________________________________________
Help-make mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/help-make

Reply via email to