On Sat, Feb 19, 2011 at 8:01 PM, ali hagigat <[email protected]> wrote:
> "Variables and functions in all parts of a makefile are expanded when
> read, except for
> in recipes,.."
> Variables are not expanded in recipes?

Yes, variables are expanded in recipes; no, variables are not expanded
in recipes WHEN READ.  For example,

$ cat Makefile
var2=before
e12:
        echo $(var2)
var2=after
$ make
echo after
after
$

If $(var2) was expanded when the recipe was read, then it would have
been expanded to "before", but it wasn't.  It's only expanded later,
when the recipe is *executed*.

You're looking at chapter 6; go back and read chapter 3.7, "How `make'
Reads a Makefile", again.


Philip Guenther

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

Reply via email to