On Sun, Jun 12, 2011 at 11:27 PM, ali hagigat <[email protected]> wrote: > 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.
This is incorrect. 'call' is a builtin function; $(call var1) is an invocation of a function that return 'kk', which is *not* a built in function. > Why > it is not called? so: > var2=$(call kk,pp) > var2=pp00 Because on the immediately preceding Makefile line you set 'kk' to 'aba', so $(call kk,pp) expands to 'aba'. > 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? Ah! Are you thinking that "$(call var1)=aba" set a literal variable named "$(call var1)", such that "$(call var1)" will expand to 'aba'? That's not correct: the left side of an assignment undergoes expansion just like the right in order to determine the name of the variable being set. This is described near the bottom of the "6.3.2 Computed Variable Names" section in the documentation. Philip Guenther _______________________________________________ Help-make mailing list [email protected] https://lists.gnu.org/mailman/listinfo/help-make
