[Buildroot] [PATCH 2 of 7] infra: add comment describing single/double dollar-sign rules

Yann E. MORIN yann.morin.1998 at free.fr
Sun May 11 20:42:01 UTC 2014


Thomas, All,

On 2014-05-11 17:38 +0200, Thomas De Schampheleire spake thusly:
> As the rules with respect to variable and function references and the need
> for single or double dollar signs are not trivial, add a comment in
> pkg-generic.mk describing them.
> 
> Signed-off-by: Thomas De Schampheleire <thomas.de.schampheleire at gmail.com>
> 
> ---
>  package/pkg-generic.mk |  13 +++++++++++++
>  1 files changed, 13 insertions(+), 0 deletions(-)
> 
> diff --git a/package/pkg-generic.mk b/package/pkg-generic.mk
> --- a/package/pkg-generic.mk
> +++ b/package/pkg-generic.mk
> @@ -250,6 +250,19 @@ endif
>  #  argument 3 is the uppercase package name, without the HOST_ prefix
>  #             for host packages
>  #  argument 4 is the type (target or host)
> +#
> +# Note about variable and function references: inside all blocks that are
> +# evaluated with $(eval), which includes all 'inner-xxx-package' blocks,

Here I'd say something like:

    ... evaluated with $(eval) [either directly or indirectly], ...

We want these rules to apply even to functions called from inside an
evaluated function, right?

Regards,
Yann E. MORIN.

> +# specific rules apply with respect to variable and function references.
> +# Numbered variables (parameters to the block) can be referenced with a single
> +# dollar sign: $(1), $(2), $(3), etc. All other variables should be referenced
> +# with a double dollar sign: $$(TARGET_DIR), $$($(2)_VERSION), etc. Also all
> +# make functions should be referenced with a double dollar sign: $$(subst),
> +# $$(call), $$(filter-out), etc.
> +# These rules ensure that these variables and functions are only expanded during
> +# the $(eval) step, and not earlier. Otherwise, unintuitive and undesired
> +# behavior occurs with respect to these variables and functions.
> +#
>  ################################################################################
>  
>  define inner-generic-package

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'


More information about the buildroot mailing list