All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] Evaluation of make variables
@ 2010-07-27 10:36 Quotient Remainder
  2010-07-27 11:42 ` Thomas Petazzoni
  0 siblings, 1 reply; 5+ messages in thread
From: Quotient Remainder @ 2010-07-27 10:36 UTC (permalink / raw)
  To: buildroot

Hello all,
I've run into a similar problem now a few times where lines inside
define variables are not being evaluated in make context but in shell
context.
An example, I was trying to convert U-Boot's makefile to genpackage.
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.

U_BOOT_POST_PATCH_HOOKS+=U_BOOT_POST_PATCH_HOOK_CUSTOM
---



The output is then:
---
$ make V=1 u_boot
...
echo -e "\n\n\n\nU_BOOT_POST_PATCH_HOOK_CUSTOM.\n\n\n"




U_BOOT_POST_PATCH_HOOK_CUSTOM.



ifneq (,)
/bin/sh: -c: line 0: syntax error near unexpected token `,'
/bin/sh: -c: line 0: `ifneq (,)'
make: *** [/home/crehill/obair/buildroot.org/output/build/u_boot-HEAD/.stamp_patched] Error 2
---



As you can see, the "ifneq" is being passed to the shell, where it is
meaningless.
Is it the indentation of the line:
        $(foreach hook,$($(PKG)_POST_CONFIGURE_HOOKS),$(call $(hook))$(sep))
in package/Makefile.package.in that causes it to be passed to the shell
instead of being taken as make instructions?


If I unindent that line I get an error:
---
$ make V=1 u_boot
package/Makefile.package.in:209: *** commands commence before first target.  Stop.
---

So, is there any way of using ifdef/ifeq/ifneq in the a "define"
variable that is used as a command?

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2010-07-30 15:41 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-07-27 10:36 [Buildroot] Evaluation of make variables Quotient Remainder
2010-07-27 11:42 ` Thomas Petazzoni
2010-07-27 11:54   ` Quotient Remainder
2010-07-30  8:33     ` Thomas Petazzoni
2010-07-30 15:41       ` Quotient Remainder

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.