$(call x) rebinds the positional parameters. $x and $(x) do not. This
distinction is used to break macro logic into smaller pieces in which $1 et
al. still refer to the positional parameters from the top-level macro
instead of being rebound to the empty string.

Kyle

On Mon, May 21, 2018, 4:11 AM Garreau, Alexandre <galex-...@galex-713.eu>
wrote:

> Why not, like in shell, when some function/variable is undefined, call
> an internal one when defined? What’s the historic reason of this?
>
> For instance, if there’s an occurence of $(several words) in the
> makefile, and the variable “several words” isn’t defined (that’s not a
> natural thing to do anyway), taking its firstword, and being equivalent
> to $(call several,words) might improve readability, be simpler,
> etc. then why not?
>
> And then I asked myself, if some functions weren’t deemed useful enough
> to get integrated as native primitives implemented in C, why do we still
> need to use the $(call fun,args) syntax when it could be done like shell
> and decide that any multi-word undefined reference could take its
> firstword and use it as call does? like if in “$(fun args)”, the
> variable “fun args” being if not undefinable, at least inaccessible, if
> the "fun" variable exists, make it equivalent to “$(call fun,args)”?
>
> Thank you for your time, hoping my message isn’t too much confuse or
> disrelevant…
>
> _______________________________________________
> Bug-make mailing list
> Bug-make@gnu.org
> https://lists.gnu.org/mailman/listinfo/bug-make
>
_______________________________________________
Bug-make mailing list
Bug-make@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-make

Reply via email to