To reduce the complexity of the Makefile, let the generator tell what its dependencies are. For this purpose use the "--deps" option.
Signed-off-by: Jean-Jacques Hiblot <jjhib...@ti.com> Reviewed-by: Simon Glass <s...@chromium.org> --- Changes in v5: None Changes in v4: None Changes in v3: None Changes in v2: None Makefile | 9 ++------- arch/arm/mach-imx/mkimage_fit_atf.sh | 5 +++++ arch/arm/mach-rockchip/make_fit_atf.py | 7 +++++++ board/sunxi/mksunxi_fit_atf.sh | 4 ++++ board/theobroma-systems/puma_rk3399/fit_spl_atf.sh | 6 ++++++ 5 files changed, 24 insertions(+), 7 deletions(-) diff --git a/Makefile b/Makefile index 8a28740b22..1fa63d2a6b 100644 --- a/Makefile +++ b/Makefile @@ -1235,13 +1235,8 @@ U_BOOT_ITS = $(src)/$(SPL_FIT_SOURCE) else ifneq ($(SPL_FIT_GENERATOR),) U_BOOT_ITS := u-boot.its -ifeq ($(CONFIG_SPL_FIT_GENERATOR),"arch/arm/mach-imx/mkimage_fit_atf.sh") -U_BOOT_ITS_DEPS += u-boot-nodtb.bin -endif -ifeq ($(CONFIG_SPL_FIT_GENERATOR),"arch/arm/mach-rockchip/make_fit_atf.py") -U_BOOT_ITS_DEPS += u-boot -endif -$(U_BOOT_ITS): $(U_BOOT_ITS_DEPS) FORCE +U_BOOT_ITS_DEPS += $(shell $(srctree)/$(SPL_FIT_GENERATOR) --deps $(BOARD)) +$(U_BOOT_ITS): u-boot-nodtb.bin $(U_BOOT_ITS_DEPS) FORCE $(srctree)/$(SPL_FIT_GENERATOR) \ $(patsubst %,arch/$(ARCH)/dts/%.dtb,$(subst ",,$(CONFIG_OF_LIST))) > $@ endif diff --git a/arch/arm/mach-imx/mkimage_fit_atf.sh b/arch/arm/mach-imx/mkimage_fit_atf.sh index 38c9858e84..4da7531954 100755 --- a/arch/arm/mach-imx/mkimage_fit_atf.sh +++ b/arch/arm/mach-imx/mkimage_fit_atf.sh @@ -11,6 +11,11 @@ [ -z "$ATF_LOAD_ADDR" ] && ATF_LOAD_ADDR="0x00910000" [ -z "$BL33_LOAD_ADDR" ] && BL33_LOAD_ADDR="0x40200000" + +if [ x"$1" = x"--deps" ]; then + exit 0 +fi + if [ ! -f $BL31 ]; then echo "ERROR: BL31 file $BL31 NOT found" >&2 exit 0 diff --git a/arch/arm/mach-rockchip/make_fit_atf.py b/arch/arm/mach-rockchip/make_fit_atf.py index b9a1988298..56fab4e330 100755 --- a/arch/arm/mach-rockchip/make_fit_atf.py +++ b/arch/arm/mach-rockchip/make_fit_atf.py @@ -163,6 +163,10 @@ def unpack_elf(filename): segments.append((index, e_entry, p_paddr, p_data)) return segments +def show_deps_and_exit(): + print("u-boot") + sys.exit(0) + def main(): uboot_elf = "./u-boot" fit_its = sys.stdout @@ -178,6 +182,9 @@ def main(): logging.warning(' BL31 file bl31.elf NOT found, resulting binary is non-functional') logging.warning(' Please read Building section in doc/README.rockchip') + if sys.argv[1] == "--deps": + show_deps_and_exit() + opts, args = getopt.getopt(sys.argv[1:], "o:u:b:h") for opt, val in opts: if opt == "-o": diff --git a/board/sunxi/mksunxi_fit_atf.sh b/board/sunxi/mksunxi_fit_atf.sh index 88ad719747..c0ce4394e2 100755 --- a/board/sunxi/mksunxi_fit_atf.sh +++ b/board/sunxi/mksunxi_fit_atf.sh @@ -5,6 +5,10 @@ # # usage: $0 <dt_name> [<dt_name> [<dt_name] ...] +if [ x"$1" = x"--deps" ]; then + exit 0 +fi + [ -z "$BL31" ] && BL31="bl31.bin" if [ ! -f $BL31 ]; then diff --git a/board/theobroma-systems/puma_rk3399/fit_spl_atf.sh b/board/theobroma-systems/puma_rk3399/fit_spl_atf.sh index 420e7daf4c..a7bada193a 100755 --- a/board/theobroma-systems/puma_rk3399/fit_spl_atf.sh +++ b/board/theobroma-systems/puma_rk3399/fit_spl_atf.sh @@ -11,6 +11,12 @@ # # usage: $0 <dt_name> [<dt_name> [<dt_name] ...] + +if [ x"$1" = x"--deps" ]; then + echo "u-boot.dtb" + exit 0 +fi + [ -z "$BL31" ] && BL31="bl31.bin" if [ ! -f $BL31 ]; then -- 2.17.1 _______________________________________________ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot