From patchwork Sun Jun 14 02:57:10 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 242305 List-Id: U-Boot discussion From: sjg at chromium.org (Simon Glass) Date: Sat, 13 Jun 2020 20:57:10 -0600 Subject: [PATCH v2 31/49] Makefile: Rename ALL-y to INPUTS-y In-Reply-To: <20200614025728.41065-1-sjg@chromium.org> References: <20200614025728.41065-1-sjg@chromium.org> Message-ID: <20200613205717.v2.31.I125082e12cbb1a733af75a3b635268d6d3c6666e@changeid> When binman is in use, most of the targets built by the Makefile are inputs to binman. We then need a final rule to run binman to produce the final outputs. Rename the variable to indicate this, and add a new 'inputs' target. Signed-off-by: Simon Glass Reviewed-by: Bin Meng --- (no changes since v1) Makefile | 60 +++++++++++++++++--------------- arch/arm/config.mk | 10 +++--- arch/arm/mach-at91/config.mk | 2 +- arch/arm/mach-davinci/config.mk | 2 +- arch/arm/mach-k3/config.mk | 10 +++--- arch/arm/mach-keystone/config.mk | 4 +-- arch/arm/mach-omap2/config.mk | 28 +++++++-------- arch/arm/mach-rmobile/Makefile | 2 +- arch/arm/mach-stm32mp/config.mk | 4 +-- board/BuR/brppt1/config.mk | 4 +-- board/BuR/brppt2/config.mk | 4 +-- board/BuR/brsmarc1/config.mk | 6 ++-- board/imgtec/boston/config.mk | 2 +- board/intel/edison/config.mk | 2 +- scripts/Makefile.spl | 24 ++++++------- tools/binman/README | 2 +- 16 files changed, 85 insertions(+), 81 deletions(-) diff --git a/Makefile b/Makefile index fa5f556fb9..875fbb1f1f 100644 --- a/Makefile +++ b/Makefile @@ -880,80 +880,80 @@ else DO_STATIC_RELA = endif -# Always append ALL so that arch config.mk's can add custom ones -ALL-y += u-boot.srec u-boot.bin u-boot.sym System.map binary_size_check +# Always append INPUTS so that arch config.mk's can add custom ones +INPUTS-y += u-boot.srec u-boot.bin u-boot.sym System.map binary_size_check -ALL-$(CONFIG_ONENAND_U_BOOT) += u-boot-onenand.bin +INPUTS-$(CONFIG_ONENAND_U_BOOT) += u-boot-onenand.bin ifeq ($(CONFIG_SPL_FSL_PBL),y) -ALL-$(CONFIG_RAMBOOT_PBL) += u-boot-with-spl-pbl.bin +INPUTS-$(CONFIG_RAMBOOT_PBL) += u-boot-with-spl-pbl.bin else ifneq ($(CONFIG_SECURE_BOOT), y) # For Secure Boot The Image needs to be signed and Header must also # be included. So The image has to be built explicitly -ALL-$(CONFIG_RAMBOOT_PBL) += u-boot.pbl +INPUTS-$(CONFIG_RAMBOOT_PBL) += u-boot.pbl endif endif -ALL-$(CONFIG_SPL) += spl/u-boot-spl.bin +INPUTS-$(CONFIG_SPL) += spl/u-boot-spl.bin ifeq ($(CONFIG_MX6)$(CONFIG_IMX_HAB), yy) -ALL-$(CONFIG_SPL_FRAMEWORK) += u-boot-ivt.img +INPUTS-$(CONFIG_SPL_FRAMEWORK) += u-boot-ivt.img else ifeq ($(CONFIG_MX7)$(CONFIG_IMX_HAB), yy) -ALL-$(CONFIG_SPL_FRAMEWORK) += u-boot-ivt.img +INPUTS-$(CONFIG_SPL_FRAMEWORK) += u-boot-ivt.img else -ALL-$(CONFIG_SPL_FRAMEWORK) += u-boot.img +INPUTS-$(CONFIG_SPL_FRAMEWORK) += u-boot.img endif endif -ALL-$(CONFIG_TPL) += tpl/u-boot-tpl.bin -ALL-$(CONFIG_OF_SEPARATE) += u-boot.dtb +INPUTS-$(CONFIG_TPL) += tpl/u-boot-tpl.bin +INPUTS-$(CONFIG_OF_SEPARATE) += u-boot.dtb ifeq ($(CONFIG_SPL_FRAMEWORK),y) -ALL-$(CONFIG_OF_SEPARATE) += u-boot-dtb.img +INPUTS-$(CONFIG_OF_SEPARATE) += u-boot-dtb.img endif -ALL-$(CONFIG_OF_HOSTFILE) += u-boot.dtb +INPUTS-$(CONFIG_OF_HOSTFILE) += u-boot.dtb ifneq ($(CONFIG_SPL_TARGET),) -ALL-$(CONFIG_SPL) += $(CONFIG_SPL_TARGET:"%"=%) +INPUTS-$(CONFIG_SPL) += $(CONFIG_SPL_TARGET:"%"=%) endif -ALL-$(CONFIG_REMAKE_ELF) += u-boot.elf -ALL-$(CONFIG_EFI_APP) += u-boot-app.efi -ALL-$(CONFIG_EFI_STUB) += u-boot-payload.efi +INPUTS-$(CONFIG_REMAKE_ELF) += u-boot.elf +INPUTS-$(CONFIG_EFI_APP) += u-boot-app.efi +INPUTS-$(CONFIG_EFI_STUB) += u-boot-payload.efi ifneq ($(CONFIG_HAS_ROM),) ifneq ($(BUILD_ROM)$(CONFIG_BUILD_ROM),) -ALL-y += u-boot.rom +INPUTS-$(CONFIG_X86_RESET_VECTOR) += u-boot.rom endif endif ifeq ($(CONFIG_SYS_COREBOOT)$(CONFIG_SPL),yy) -ALL-$(CONFIG_BINMAN) += u-boot-x86-with-spl.bin +INPUTS-$(CONFIG_BINMAN) += u-boot-x86-with-spl.bin endif # Build a combined spl + u-boot image for sunxi ifeq ($(CONFIG_ARCH_SUNXI)$(CONFIG_SPL),yy) -ALL-y += u-boot-sunxi-with-spl.bin +INPUTS-y += u-boot-sunxi-with-spl.bin endif # enable combined SPL/u-boot/dtb rules for tegra ifeq ($(CONFIG_ARCH_TEGRA)$(CONFIG_SPL),yy) -ALL-y += u-boot-tegra.bin u-boot-nodtb-tegra.bin -ALL-$(CONFIG_OF_SEPARATE) += u-boot-dtb-tegra.bin +INPUTS-y += u-boot-tegra.bin u-boot-nodtb-tegra.bin +INPUTS-$(CONFIG_OF_SEPARATE) += u-boot-dtb-tegra.bin endif -ALL-$(CONFIG_ARCH_MEDIATEK) += u-boot-mtk.bin +INPUTS-$(CONFIG_ARCH_MEDIATEK) += u-boot-mtk.bin # Add optional build target if defined in board/cpu/soc headers ifneq ($(CONFIG_BUILD_TARGET),) -ALL-y += $(CONFIG_BUILD_TARGET:"%"=%) +INPUTS-y += $(CONFIG_BUILD_TARGET:"%"=%) endif ifeq ($(CONFIG_INIT_SP_RELATIVE)$(CONFIG_OF_SEPARATE),yy) -ALL-y += init_sp_bss_offset_check +INPUTS-y += init_sp_bss_offset_check endif ifeq ($(CONFIG_MPC85xx)$(CONFIG_OF_SEPARATE),yy) -ALL-y += u-boot-with-dtb.bin +INPUTS-y += u-boot-with-dtb.bin endif ifeq ($(CONFIG_ARCH_ROCKCHIP)$(CONFIG_SPL),yy) -ALL-y += u-boot-rockchip.bin +INPUTS-y += u-boot-rockchip.bin endif LDFLAGS_u-boot += $(LDFLAGS_FINAL) @@ -1010,7 +1010,11 @@ quiet_cmd_cfgcheck = CFGCHK $2 cmd_cfgcheck = $(srctree)/scripts/check-config.sh $2 \ $(srctree)/scripts/config_whitelist.txt $(srctree) -all: $(ALL-y) +PHONY += inputs +inputs: $(INPUTS-y) + +all: inputs + ifeq ($(CONFIG_DEPRECATED),y) $(warning "You have deprecated configuration options enabled in your .config! Please check your configuration.") ifeq ($(CONFIG_SPI),y) diff --git a/arch/arm/config.mk b/arch/arm/config.mk index f25603109e..4153f7e371 100644 --- a/arch/arm/config.mk +++ b/arch/arm/config.mk @@ -122,7 +122,7 @@ endif ifneq ($(CONFIG_SPL_BUILD),y) # Check that only R_ARM_RELATIVE relocations are generated. -ALL-y += checkarmreloc +INPUTS-y += checkarmreloc # The movt / movw can hardcode 16 bit parts of the addresses in the # instruction. Relocation is not supported for that case, so disable # such usage by requiring word relocations. @@ -154,17 +154,17 @@ endif ifneq ($(CONFIG_IMX_CONFIG),) ifdef CONFIG_SPL ifndef CONFIG_SPL_BUILD -ALL-y += SPL +INPUTS-y += SPL endif else ifeq ($(CONFIG_OF_SEPARATE),y) -ALL-y += u-boot-dtb.imx +INPUTS-y += u-boot-dtb.imx else -ALL-y += u-boot.imx +INPUTS-y += u-boot.imx endif endif ifneq ($(CONFIG_VF610),) -ALL-y += u-boot.vyb +INPUTS-y += u-boot.vyb endif endif diff --git a/arch/arm/mach-at91/config.mk b/arch/arm/mach-at91/config.mk index 9a023efb19..5426394651 100644 --- a/arch/arm/mach-at91/config.mk +++ b/arch/arm/mach-at91/config.mk @@ -4,6 +4,6 @@ endif ifeq ($(CONFIG_CPU_V7A),y) ifndef CONFIG_SPL_BUILD -ALL-y += u-boot.img +INPUTS-y += u-boot.img endif endif diff --git a/arch/arm/mach-davinci/config.mk b/arch/arm/mach-davinci/config.mk index 5a33982e2d..4674cae43b 100644 --- a/arch/arm/mach-davinci/config.mk +++ b/arch/arm/mach-davinci/config.mk @@ -2,5 +2,5 @@ # # Copyright (C) 2012, Texas Instruments, Incorporated - http://www.ti.com/ ifndef CONFIG_SPL_BUILD -ALL-$(CONFIG_SPL_FRAMEWORK) += u-boot.ais +INPUTS-$(CONFIG_SPL_FRAMEWORK) += u-boot.ais endif diff --git a/arch/arm/mach-k3/config.mk b/arch/arm/mach-k3/config.mk index f6b63db349..aca7a37009 100644 --- a/arch/arm/mach-k3/config.mk +++ b/arch/arm/mach-k3/config.mk @@ -44,7 +44,7 @@ tiboot3.bin: image_check FORCE $(srctree)/tools/k3_gen_x509_cert.sh -c 16 -b $(obj)/u-boot-spl.bin \ -o $@ -l $(CONFIG_SPL_TEXT_BASE) -k $(KEY) -ALL-y += tiboot3.bin +INPUTS-y += tiboot3.bin endif ifdef CONFIG_ARM64 @@ -55,23 +55,23 @@ $(SPL_ITS): FORCE $(srctree)/tools/k3_fit_atf.sh \ $(patsubst %,$(obj)/dts/%.dtb,$(subst ",,$(CONFIG_SPL_OF_LIST))) > $@ -ALL-y += tispl.bin_HS +INPUTS-y += tispl.bin_HS else SPL_ITS := u-boot-spl-k3.its $(SPL_ITS): FORCE $(srctree)/tools/k3_fit_atf.sh \ $(patsubst %,$(obj)/dts/%.dtb,$(subst ",,$(CONFIG_SPL_OF_LIST))) > $@ -ALL-y += tispl.bin +INPUTS-y += tispl.bin endif endif else ifeq ($(CONFIG_TI_SECURE_DEVICE),y) -ALL-y += u-boot.img_HS +INPUTS-y += u-boot.img_HS else -ALL-y += u-boot.img +INPUTS-y += u-boot.img endif endif diff --git a/arch/arm/mach-keystone/config.mk b/arch/arm/mach-keystone/config.mk index 5806f8f5d1..5a16891f23 100644 --- a/arch/arm/mach-keystone/config.mk +++ b/arch/arm/mach-keystone/config.mk @@ -9,9 +9,9 @@ include $(srctree)/arch/arm/mach-omap2/config_secure.mk ifndef CONFIG_SPL_BUILD ifeq ($(CONFIG_TI_SECURE_DEVICE),y) -ALL-y += u-boot_HS_MLO +INPUTS-y += u-boot_HS_MLO else -ALL-y += MLO +INPUTS-y += MLO endif endif diff --git a/arch/arm/mach-omap2/config.mk b/arch/arm/mach-omap2/config.mk index af455366ed..4f0d2598fa 100644 --- a/arch/arm/mach-omap2/config.mk +++ b/arch/arm/mach-omap2/config.mk @@ -18,9 +18,9 @@ ifeq ($(CONFIG_TI_SECURE_DEVICE),y) # Refer to README.ti-secure for more info # For booting spl from QSPI or NOR use # u-boot-spl_HS_X-LOADER ifeq ($(CONFIG_OMAP54XX),y) -ALL-y += u-boot-spl_HS_MLO -ALL-y += u-boot-spl_HS_ULO -ALL-y += u-boot-spl_HS_X-LOADER +INPUTS-y += u-boot-spl_HS_MLO +INPUTS-y += u-boot-spl_HS_ULO +INPUTS-y += u-boot-spl_HS_X-LOADER endif # On AM43XX: # @@ -30,8 +30,8 @@ endif # For booting spl from all other media use # u-boot-spl_HS_ISSW ifeq ($(CONFIG_AM43XX),y) -ALL-y += u-boot-spl_HS_SPI_X-LOADER -ALL-y += u-boot-spl_HS_ISSW +INPUTS-y += u-boot-spl_HS_SPI_X-LOADER +INPUTS-y += u-boot-spl_HS_ISSW endif # On AM33XX: # @@ -47,21 +47,21 @@ endif # For booting spl over UART, USB, or Ethernet use # u-boot-spl_HS_2ND ifeq ($(CONFIG_AM33XX),y) -ALL-y += u-boot-spl_HS_SPI_X-LOADER -ALL-y += u-boot-spl_HS_X-LOADER -ALL-y += u-boot-spl_HS_MLO -ALL-y += u-boot-spl_HS_2ND +INPUTS-y += u-boot-spl_HS_SPI_X-LOADER +INPUTS-y += u-boot-spl_HS_X-LOADER +INPUTS-y += u-boot-spl_HS_MLO +INPUTS-y += u-boot-spl_HS_2ND endif else -ALL-y += MLO +INPUTS-y += MLO ifeq ($(CONFIG_AM33XX),y) -ALL-y += MLO.byteswap +INPUTS-y += MLO.byteswap endif endif else ifeq ($(CONFIG_TI_SECURE_DEVICE),y) -ALL-$(CONFIG_QSPI_BOOT) += u-boot_HS_XIP_X-LOADER -ALL-$(CONFIG_SPL_LOAD_FIT) += u-boot_HS.img +INPUTS-$(CONFIG_QSPI_BOOT) += u-boot_HS_XIP_X-LOADER +INPUTS-$(CONFIG_SPL_LOAD_FIT) += u-boot_HS.img endif -ALL-y += u-boot.img +INPUTS-y += u-boot.img endif diff --git a/arch/arm/mach-rmobile/Makefile b/arch/arm/mach-rmobile/Makefile index a3fdcc3bc0..3206bce722 100644 --- a/arch/arm/mach-rmobile/Makefile +++ b/arch/arm/mach-rmobile/Makefile @@ -84,5 +84,5 @@ spl/u-boot-spl.scif: spl/u-boot-spl.srec spl/u-boot-spl.bin # if srec_cat is present build u-boot-spl.scif by default has_srec_cat = $(call try-run,srec_cat -VERSion,y,n) -ALL-$(has_srec_cat) += u-boot-spl.scif +INPUTS-$(has_srec_cat) += u-boot-spl.scif CLEAN_FILES += u-boot-spl.scif diff --git a/arch/arm/mach-stm32mp/config.mk b/arch/arm/mach-stm32mp/config.mk index 403af2a225..c30bf482f7 100644 --- a/arch/arm/mach-stm32mp/config.mk +++ b/arch/arm/mach-stm32mp/config.mk @@ -4,10 +4,10 @@ # ifndef CONFIG_SPL -ALL-y += u-boot.stm32 +INPUTS-y += u-boot.stm32 else ifdef CONFIG_SPL_BUILD -ALL-y += u-boot-spl.stm32 +INPUTS-y += u-boot-spl.stm32 endif endif diff --git a/board/BuR/brppt1/config.mk b/board/BuR/brppt1/config.mk index b11b544c37..6853135f83 100644 --- a/board/BuR/brppt1/config.mk +++ b/board/BuR/brppt1/config.mk @@ -25,8 +25,8 @@ cmd_prodzip = \ zip -9 -r $@ misc/* >/dev/null $< ifeq ($(hw-platform-y),brppt1-spi) -ALL-y += $(hw-platform-y)_prog.bin -ALL-y += $(hw-platform-y)_prod.zip +INPUTS-y += $(hw-platform-y)_prog.bin +INPUTS-y += $(hw-platform-y)_prod.zip endif $(hw-platform-y)_prog.bin: u-boot-dtb.img spl/u-boot-spl.bin diff --git a/board/BuR/brppt2/config.mk b/board/BuR/brppt2/config.mk index fa973db762..0d1638a97a 100644 --- a/board/BuR/brppt2/config.mk +++ b/board/BuR/brppt2/config.mk @@ -24,8 +24,8 @@ cmd_prodzip = \ ifeq ($(hw-platform-y),brppt2) ifneq ($(CONFIG_SPL_BUILD),y) -ALL-y += $(hw-platform-y)_prog.bin -ALL-y += $(hw-platform-y)_prod.zip +INPUTS-y += $(hw-platform-y)_prog.bin +INPUTS-y += $(hw-platform-y)_prod.zip endif endif diff --git a/board/BuR/brsmarc1/config.mk b/board/BuR/brsmarc1/config.mk index 0692988507..1de971876c 100644 --- a/board/BuR/brsmarc1/config.mk +++ b/board/BuR/brsmarc1/config.mk @@ -23,11 +23,11 @@ cmd_prodzip = \ cp u-boot-dtb.img misc/ && \ zip -9 -r $@ misc/* >/dev/null $< -ALL-y += $(hw-platform-y)_prog.bin -ALL-y += $(hw-platform-y)_prod.zip +INPUTS-y += $(hw-platform-y)_prog.bin +INPUTS-y += $(hw-platform-y)_prod.zip $(hw-platform-y)_prog.bin: u-boot-dtb.img spl/u-boot-spl.bin $(call if_changed,prodbin) $(hw-platform-y)_prod.zip: $(hw-platform-y)_prog.bin - $(call if_changed,prodzip) \ No newline at end of file + $(call if_changed,prodzip) diff --git a/board/imgtec/boston/config.mk b/board/imgtec/boston/config.mk index 8cfc9c6894..c1e242f108 100644 --- a/board/imgtec/boston/config.mk +++ b/board/imgtec/boston/config.mk @@ -11,5 +11,5 @@ u-boot.mcs: u-boot.bin # if srec_cat is present build u-boot.mcs by default has_srec_cat = $(call try-run,srec_cat -VERSion,y,n) -ALL-$(has_srec_cat) += u-boot.mcs +INPUTS-$(has_srec_cat) += u-boot.mcs CLEAN_FILES += u-boot.mcs diff --git a/board/intel/edison/config.mk b/board/intel/edison/config.mk index fdcbbdf3b1..8c6087e290 100644 --- a/board/intel/edison/config.mk +++ b/board/intel/edison/config.mk @@ -10,7 +10,7 @@ cmd_mkalign_eds = \ dd if=$^ of=$@ bs=4k seek=1 2>/dev/null && \ mv $@ $^ -ALL-y += u-boot-align.bin +INPUTS-y += u-boot-align.bin u-boot-align.bin: u-boot.bin $(call if_changed,mkalign_eds) diff --git a/scripts/Makefile.spl b/scripts/Makefile.spl index e6d56a1286..d528c994ff 100644 --- a/scripts/Makefile.spl +++ b/scripts/Makefile.spl @@ -213,42 +213,42 @@ spl/boot.bin: $(obj)/$(SPL_BIN)-align.bin FORCE $(call if_changed,mkimage) endif -ALL-y += $(obj)/$(SPL_BIN).bin +INPUTS-y += $(obj)/$(SPL_BIN).bin ifdef CONFIG_SAMSUNG -ALL-y += $(obj)/$(BOARD)-spl.bin +INPUTS-y += $(obj)/$(BOARD)-spl.bin endif ifneq ($(CONFIG_TARGET_SOCFPGA_GEN5)$(CONFIG_TARGET_SOCFPGA_ARRIA10),) -ALL-y += $(obj)/$(SPL_BIN).sfp +INPUTS-y += $(obj)/$(SPL_BIN).sfp endif ifdef CONFIG_ARCH_SUNXI -ALL-y += $(obj)/sunxi-spl.bin +INPUTS-y += $(obj)/sunxi-spl.bin ifdef CONFIG_NAND_SUNXI -ALL-y += $(obj)/sunxi-spl-with-ecc.bin +INPUTS-y += $(obj)/sunxi-spl-with-ecc.bin endif endif ifeq ($(CONFIG_SYS_SOC),"at91") -ALL-y += $(obj)/boot.bin +INPUTS-y += $(obj)/boot.bin endif ifdef CONFIG_TPL_BUILD -ALL-$(CONFIG_TPL_X86_16BIT_INIT) += $(obj)/u-boot-x86-start16-tpl.bin \ +INPUTS-$(CONFIG_TPL_X86_16BIT_INIT) += $(obj)/u-boot-x86-start16-tpl.bin \ $(obj)/u-boot-x86-reset16-tpl.bin else -ALL-$(CONFIG_SPL_X86_16BIT_INIT) += $(obj)/u-boot-x86-start16-spl.bin \ +INPUTS-$(CONFIG_SPL_X86_16BIT_INIT) += $(obj)/u-boot-x86-start16-spl.bin \ $(obj)/u-boot-x86-reset16-spl.bin endif -ALL-$(CONFIG_ARCH_ZYNQ) += $(obj)/boot.bin -ALL-$(CONFIG_ARCH_ZYNQMP) += $(obj)/boot.bin +INPUTS-$(CONFIG_ARCH_ZYNQ) += $(obj)/boot.bin +INPUTS-$(CONFIG_ARCH_ZYNQMP) += $(obj)/boot.bin -ALL-$(CONFIG_ARCH_MEDIATEK) += $(obj)/u-boot-spl-mtk.bin +INPUTS-$(CONFIG_ARCH_MEDIATEK) += $(obj)/u-boot-spl-mtk.bin -all: $(ALL-y) +all: $(INPUTS-y) quiet_cmd_cat = CAT $@ cmd_cat = cat $(filter-out $(PHONY), $^) > $@ diff --git a/tools/binman/README b/tools/binman/README index a6a3ee48aa..37ee3fc2d3 100644 --- a/tools/binman/README +++ b/tools/binman/README @@ -220,7 +220,7 @@ u-boot-.bin: checkbinman FORCE endif This assumes that u-boot-.bin is a target, and is the final file -that you need to produce. You can make it a target by adding it to ALL-y +that you need to produce. You can make it a target by adding it to INPUTS-y either in the main Makefile or in a config.mk file in your arch subdirectory. Once binman is executed it will pick up its instructions from a device-tree