help-make
[Top][All Lists]
Advanced

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

Re: Internal question


From: John Graham-Cumming
Subject: Re: Internal question
Date: Thu, 06 Apr 2006 16:24:11 +0200
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6) Gecko/20040208 Thunderbird/0.5 Mnenhy/0.6.0.104

Alexandre Girao wrote:
a := 0

define aaa_template
a := 1
$(warning $(a))
endef

define bbb_template
$(warning $(a))
endef

$(eval $(call aaa_template))          # 0 (why 0?)
$(eval $(call bbb_template))          # 1

Because the aaa_template is expanded twice by $(eval). The first time it's expanded you get the warning. Escape the $ with $$ in aaa_template and you'll get the result you expect.

John.
--
John Graham-Cumming
address@hidden

Home: http://www.jgc.org/
Blog: http://www.jgc.org/blog/

POPFile: http://getpopfile.org/
GNU Make Standard Library: http://gmsl.sf.net/
GNU Make Debugger: http://gmd.sf.net/
Fast, Parallel Builds: http://www.electric-cloud.com/

Sign up for my Spam and Anti-spam Newsletter
at http://www.jgc.org/




reply via email to

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