Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Yann E. MORIN <yann.morin.1998@free.fr>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH 2 of 7] infra: add comment describing single/double dollar-sign rules
Date: Sun, 11 May 2014 22:42:01 +0200	[thread overview]
Message-ID: <20140511204201.GF3428@free.fr> (raw)
In-Reply-To: <32d9759c21dfe0792ff0.1399822726@argentina>

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@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.  |
'------------------------------^-------^------------------^--------------------'

  reply	other threads:[~2014-05-11 20:42 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-11 15:38 [Buildroot] [PATCH 0 of 7] infra: fix dollar signs; remove some undefined versions Thomas De Schampheleire
2014-05-11 15:38 ` [Buildroot] [PATCH 1 of 7] infra: consistently use double dollar signs inside inner-xxx-targets Thomas De Schampheleire
2014-05-11 20:38   ` Yann E. MORIN
2014-05-12 11:17     ` Thomas De Schampheleire
2014-05-11 15:38 ` [Buildroot] [PATCH 2 of 7] infra: add comment describing single/double dollar-sign rules Thomas De Schampheleire
2014-05-11 20:42   ` Yann E. MORIN [this message]
2014-05-12 11:55     ` Thomas De Schampheleire
2014-05-11 15:38 ` [Buildroot] [PATCH 3 of 7] pkg-virtual: simplify definition of FOO_VERSION to 'virtual' Thomas De Schampheleire
2014-05-11 20:43   ` Yann E. MORIN
2014-05-11 15:38 ` [Buildroot] [PATCH 4 of 7] toolchain/toolchain-buildroot: migrate to virtual package infrastructure Thomas De Schampheleire
2014-05-11 20:57   ` Yann E. MORIN
2014-05-11 15:38 ` [Buildroot] [PATCH 5 of 7] toolchain-external: change version from 'undefined' to 'virtual' Thomas De Schampheleire
2014-05-11 21:01   ` Yann E. MORIN
2014-05-11 15:38 ` [Buildroot] [PATCH 6 of 7] makedevs: change version from 'undefined' to 'buildroot-$(BR2_VERSION)' Thomas De Schampheleire
2014-05-11 21:03   ` Yann E. MORIN
2014-05-11 15:38 ` [Buildroot] [PATCH 7 of 7] mkpasswd: " Thomas De Schampheleire
2014-05-11 21:04   ` Yann E. MORIN

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140511204201.GF3428@free.fr \
    --to=yann.morin.1998@free.fr \
    --cc=buildroot@busybox.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox