help-make
[Top][All Lists]
Advanced

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

Re: a question about $(call function


From: ali hagigat
Subject: Re: a question about $(call function
Date: Mon, 13 Jun 2011 10:57:23 +0430

Thanks Mr. Smith for the answer however I have two questions:

1) According to the manual, "If variable is the name of a builtin
function, the builtin function is always invoked ". So why in the
cited example when we have:
 var2=$(call $(call var1),pp)
Our variable here is $(call var1) and it is a built in function. Why
it is not called? so:
var2=$(call kk,pp)
var2=pp00

2) if $(call var1)=aba is considered, so:
var2=$(call aba, pp)
var2=pp11
Why var2=aba? why aba function is not called with its $(1)=pp?

Regards

On Mon, Jun 13, 2011 at 1:07 AM, Paul Smith <address@hidden> wrote:
> On Sat, 2011-06-11 at 14:49 +0430, ali hagigat wrote:
>> In the following example with make, 3.81 why var2 is aba?
>>
>> kk=$(1)00
>> aba=$(1)11
>> var1=kk
>> $(call var1)=aba
>> var2=$(call $(call var1),pp)
>> all: ;
>> $(warning var2=$(var2))
>>
>> makefile27:7: var2=aba
>
> Because you have "$(call var1)=aba" and $(call var1) expands kk, so this
> statement expands to "kk=aba".
>
> --
> -------------------------------------------------------------------------------
>  Paul D. Smith <address@hidden>          Find some GNU make tips at:
>  http://www.gnu.org                      http://make.mad-scientist.net
>  "Please remain calm...I may be mad, but I am a professional." --Mad Scientist
>
>



reply via email to

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