Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
To: buildroot@busybox.net
Subject: [Buildroot] Evaluation of make variables
Date: Tue, 27 Jul 2010 13:42:09 +0200	[thread overview]
Message-ID: <20100727134209.5fddfa7b@surf> (raw)
In-Reply-To: <1280226977.22687.37.camel@dubciaranr1.verifone.com>

On Tue, 27 Jul 2010 11:36:17 +0100
Quotient Remainder <quotientvremainder@gmail.com> wrote:

> An example, I was trying to convert U-Boot's makefile to genpackage.

While I'd like to see the bootloaders use an infrastructure, the
genpackage infrastructure is really designed for *packages* (with the
concept of staging and target installation, which are meaningless
concepts for bootloaders). I'm not sure just using the genpackage
infrastructure is OK. But I'm open to see the result of your work and
see how it looks.

> Here is an excerpt.
> ---
> define U_BOOT_POST_PATCH_HOOK_CUSTOM
> 	echo -e "\n\n\n\nU_BOOT_POST_PATCH_HOOK_CUSTOM.\n\n\n"
> ifneq ($(qstrip $(BR2_TARGET_UBOOT_CUSTOM_PATCH_DIR)),)
> 	toolchain/patch-kernel.sh $(@D) $(U_BOOT_CUSTOM_PATCH_DIR)
> u-boot-$(U_BOOT_VERSION)-\*.patch endif
> endef # U_BOOT_POST_PATCH_HOOK_CUSTOM.

You can't use make ifeq/ifneq tests inside define...endef blocks.
That's the major drawback of the package infrastructure. So you have do
something like:

define U_BOOT_POST_PATCH_HOOK_CUSTOM
	toolchain/patch-kernel.sh $(@D) $(U_BOOT_CUSTOM_PATCH_DIR) u-boot-$(U_BOOT_VERSION)-\*.patch
endef

ifneq ($(qstrip $(BR2_TARGET_UBOOT_CUSTOM_PATCH_DIR)),)
U_BOOT_POST_PATCH_HOOKS+=U_BOOT_POST_PATCH_HOOK_CUSTOM
endif

I.e, use no condition inside the hook implementation, and put the
condition at the hook registration site.

Thomas
-- 
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com

  reply	other threads:[~2010-07-27 11:42 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-27 10:36 [Buildroot] Evaluation of make variables Quotient Remainder
2010-07-27 11:42 ` Thomas Petazzoni [this message]
2010-07-27 11:54   ` Quotient Remainder
2010-07-30  8:33     ` Thomas Petazzoni
2010-07-30 15:41       ` Quotient Remainder

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=20100727134209.5fddfa7b@surf \
    --to=thomas.petazzoni@free-electrons.com \
    --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