help-make
[Top][All Lists]
Advanced

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

RE: another really dumb question


From: Paul Smith
Subject: RE: another really dumb question
Date: Thu, 20 Jan 2011 14:31:05 -0500

Please try to avoid top-posting, and use quoting so we can see what
parts of the message are added by you.  Thanks!

On Thu, 2011-01-20 at 11:14 -0800, Mark Galeck (CW) wrote:
> Paul,  I am actually happy to say that I did follow the same logic as
> you had carefully explain, and I appreciate very much taking your
> time.  
> 
> So, what I don't understand, is that, when make expands FOOBAR, in the
> inner call to "call", then yes the result is the empty string, but as
> a side effect, "bar" should be printed to stdout, because $(FOO) is
> expadnded to "bar" and that is given to info.  

Because the value of the variable FOO is not set until later, when the
eval runs.

The definition is:

define FOOBAR
FOO := bar
$(info $(FOO))
endef

The expansions of FOOBAR happen in call, but this just treats the value
of the variable as a string, it doesn't interpret it.  That's what eval
is for.

So when call expands this it is doing it BEFORE eval, and hence before
the "FOO := bar" line is evaluated, and hence FOO has no value and hence
$(info $(FOO)) prints nothing.




reply via email to

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