From patchwork Thu Apr 23 07:39:08 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrick Delaunay X-Patchwork-Id: 238373 List-Id: U-Boot discussion From: patrick.delaunay at st.com (Patrick Delaunay) Date: Thu, 23 Apr 2020 09:39:08 +0200 Subject: [PATCH] Makefile: copy SPL_FIT_SOURCE in build directory Message-ID: <20200423093845.1.Idf086bdb530238139f0066b3fecc01529d7c0b7d@changeid> 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 Tested-by: Marek Vasut Acked-by: Marek Vasut --- 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 at 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(-) 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