[U-Boot] [PATCH v2 03/63] spl: Makefile: Define SPL_ earlier

Masahiro Yamada yamada.masahiro at socionext.com
Mon Dec 19 08:43:02 CET 2016


Hi Simon,


2016-11-20 5:24 GMT+09:00 Simon Glass <sjg at chromium.org>:
> This Makefile variable can be used in the architecture's main Makefile but
> at present it is not set up until later. Set it just before this Makefile is
> included.
>
> Signed-off-by: Simon Glass <sjg at chromium.org>
> ---
>
> Changes in v2: None
>
>  scripts/Makefile.spl | 6 ++++++
>  1 file changed, 6 insertions(+)
>
> diff --git a/scripts/Makefile.spl b/scripts/Makefile.spl
> index 03a2f06..f490e29 100644
> --- a/scripts/Makefile.spl
> +++ b/scripts/Makefile.spl
> @@ -35,6 +35,12 @@ else
>  SPL_BIN := u-boot-spl
>  endif
>
> +ifdef CONFIG_SPL_BUILD
> +SPL_ := SPL_
> +else
> +SPL_ :=
> +endif
> +
>  include $(srctree)/config.mk
>  include $(srctree)/arch/$(ARCH)/Makefile
>


In scripts/Makefile.spl, CONFIG_SPL_BUILD is always defined.

So, I think your patch is equivalent to:

>  SPL_BIN := u-boot-spl
>  endif
>
> +SPL_ := SPL_
> +
>  include $(srctree)/config.mk
>  include $(srctree)/arch/$(ARCH)/Makefile





But, more simply, does the following patch work for you?

(just move Kbuild.include below autoconf.mk)



diff --git a/scripts/Makefile.spl b/scripts/Makefile.spl
index f379713..90fea0a 100644
--- a/scripts/Makefile.spl
+++ b/scripts/Makefile.spl
@@ -19,11 +19,11 @@ src := $(obj)
 # Create output directory if not already present
 _dummy := $(shell [ -d $(obj) ] || mkdir -p $(obj))

-include $(srctree)/scripts/Kbuild.include
-
 -include include/config/auto.conf
 -include $(obj)/include/autoconf.mk

+include $(srctree)/scripts/Kbuild.include
+
 KBUILD_CPPFLAGS += -DCONFIG_SPL_BUILD
 ifeq ($(CONFIG_TPL_BUILD),y)
 KBUILD_CPPFLAGS += -DCONFIG_TPL_BUILD




-- 
Best Regards
Masahiro Yamada


More information about the U-Boot mailing list