diff mbox series

Makefile: copy SPL_FIT_SOURCE in build directory

Message ID 20200423093845.1.Idf086bdb530238139f0066b3fecc01529d7c0b7d@changeid
State Accepted
Commit 0015e6defe66022b38c4fe0e2c793728ab2c3cdd
Delegated to: Tom Rini
Headers show
Series Makefile: copy SPL_FIT_SOURCE in build directory | expand

Commit Message

Patrick DELAUNAY April 23, 2020, 7:39 a.m. UTC
Copy the .its source file selected by CONFIG_SPL_FIT_SOURCE
in builddir and in a file named "u-boot.its".

This patch avoid compilation issue when CONFIG_SPL_FIT_SOURCE is used
and KBUILD_OUTPUT is defined, in buildman for example.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
---
Hi,

Problem detected with path proposal:

[V3,3/6] ARM: stm32: Implement board coding on AV96

http://patchwork.ozlabs.org/project/uboot/patch/20200422111814.121060-3-marex@denx.de/

Issue see with:

tools/buildman/buildman -v -V stm32mp15_dhcom_basic stm32mp15_dhcor_basic

Building current source for 2 boards (2 threads, 6 jobs per thread)
       arm:  +   stm32mp15_dhcor_basic
+FATAL ERROR: Couldn't open "board/dhelectronics/dh_stm32mp1/u-boot-dhcor.its": No such file or directory
+./tools/mkimage: Can't open u-boot.itb.tmp: No such file or directory
+make[2]: *** [spl/u-boot-spl] Error 1
+make[1]: *** [spl/u-boot-spl] Error 2
+make: *** [sub-make] Error 2
       arm:  +   stm32mp15_dhcom_basic
+FATAL ERROR: Couldn't open "board/dhelectronics/dh_stm32mp1/u-boot-dhcom.its": No such file or directory
+./tools/mkimage: Can't open u-boot.itb.tmp: No such file or directory
+make[2]: *** [spl/u-boot-spl] Error 1
+make[1]: *** [spl/u-boot-spl] Error 2
+make: *** [sub-make] Error 2
    0    0    2 /2      stm32mp15_dhcom_basic

This error doesn't occur for a local compilation,
as the 2 files exist in  source directory:
"board/dhelectronics/dh_stm32mp1/u-boot-dhcor.its"
"board/dhelectronics/dh_stm32mp1/u-boot-dhcom.its"

But they can't found by buildman in build directory
and the issue is reproduced with "KBUILD_OUTPUT=../build".

With the proposed path the issue is solved.

Regards

Patrick


 Makefile | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Comments

Marek Vasut April 27, 2020, 11:39 a.m. UTC | #1
On 4/23/20 9:39 AM, Patrick Delaunay wrote:
> Copy the .its source file selected by CONFIG_SPL_FIT_SOURCE
> in builddir and in a file named "u-boot.its".
> 
> This patch avoid compilation issue when CONFIG_SPL_FIT_SOURCE is used
> and KBUILD_OUTPUT is defined, in buildman for example.
> 
> Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>

Both in-tree and out-of-tree, and also in the context of OE
Tested-by: Marek Vasut <marex@denx.de>
Acked-by: Marek Vasut <marex@denx.de>
Tom Rini April 28, 2020, 1:54 p.m. UTC | #2
On Thu, Apr 23, 2020 at 09:39:08AM +0200, Patrick Delaunay wrote:

> Copy the .its source file selected by CONFIG_SPL_FIT_SOURCE
> in builddir and in a file named "u-boot.its".
> 
> This patch avoid compilation issue when CONFIG_SPL_FIT_SOURCE is used
> and KBUILD_OUTPUT is defined, in buildman for example.
> 
> Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
> Tested-by: Marek Vasut <marex@denx.de>
> Acked-by: Marek Vasut <marex@denx.de>

Applied to u-boot/master, thanks!
diff mbox series

Patch

diff --git a/Makefile b/Makefile
index 26307fd4a6..d574f8a181 100644
--- a/Makefile
+++ b/Makefile
@@ -1320,7 +1320,9 @@  endif
 # Boards with more complex image requirements can provide an .its source file
 # or a generator script
 ifneq ($(CONFIG_SPL_FIT_SOURCE),"")
-U_BOOT_ITS = $(subst ",,$(CONFIG_SPL_FIT_SOURCE))
+U_BOOT_ITS := u-boot.its
+$(U_BOOT_ITS): $(subst ",,$(CONFIG_SPL_FIT_SOURCE))
+	$(call if_changed,copy)
 else
 ifneq ($(CONFIG_SPL_FIT_GENERATOR),"")
 U_BOOT_ITS := u-boot.its