build system: deduplicate users of cbfs-add-cmd
When adding the cbfstool remove requirement of the UPDATE_IMAGE path to cbfs-add-cmd, prebuil[dt]-files become identical in both cases. Change-Id: I80faaf1c83368b9dd00a9f247bf89e6d596be996 Signed-off-by: Patrick Georgi <pgeorgi@chromium.org> Reviewed-on: https://review.coreboot.org/13503 Tested-by: build bot (Jenkins) Tested-by: Raptor Engineering Automated Test Stand <noreply@raptorengineeringinc.com> Reviewed-by: Martin Roth <martinroth@google.com>
This commit is contained in:
parent
60fad89091
commit
ddc30767dc
12
Makefile.inc
12
Makefile.inc
@ -651,6 +651,7 @@ endif
|
|||||||
|
|
||||||
define cbfs-add-cmd
|
define cbfs-add-cmd
|
||||||
printf " CBFS $(call extract_nth,2,$(1))\n"
|
printf " CBFS $(call extract_nth,2,$(1))\n"
|
||||||
|
$(if $(2),-$(CBFSTOOL) $@.tmp remove -n $(call extract_nth,2,$(file)) 2>/dev/null)
|
||||||
$(CBFSTOOL) $@.tmp \
|
$(CBFSTOOL) $@.tmp \
|
||||||
add$(if $(filter stage,$(call extract_nth,3,$(1))),-stage)$(if $(filter payload,$(call extract_nth,3,$(1))),-payload) \
|
add$(if $(filter stage,$(call extract_nth,3,$(1))),-stage)$(if $(filter payload,$(call extract_nth,3,$(1))),-payload) \
|
||||||
-f $(call extract_nth,1,$(1)) \
|
-f $(call extract_nth,1,$(1)) \
|
||||||
@ -665,10 +666,10 @@ define cbfs-add-cmd
|
|||||||
endef
|
endef
|
||||||
|
|
||||||
cbfs-files=$(cbfs-files-fixed) $(cbfs-files-aligned) $(cbfs-files-regular)
|
cbfs-files=$(cbfs-files-fixed) $(cbfs-files-aligned) $(cbfs-files-regular)
|
||||||
ifneq ($(CONFIG_UPDATE_IMAGE),y)
|
|
||||||
prebuild-files = $(foreach file,$(cbfs-files), $(call cbfs-add-cmd,$(file)))
|
|
||||||
prebuilt-files = $(foreach file,$(cbfs-files), $(call extract_nth,1,$(file)))
|
prebuilt-files = $(foreach file,$(cbfs-files), $(call extract_nth,1,$(file)))
|
||||||
|
prebuild-files = $(foreach file,$(cbfs-files), $(call cbfs-add-cmd,$(file),$(CONFIG_UPDATE_IMAGE)))
|
||||||
|
|
||||||
|
ifneq ($(CONFIG_UPDATE_IMAGE),y)
|
||||||
ifeq ($(CONFIG_FMDFILE),)
|
ifeq ($(CONFIG_FMDFILE),)
|
||||||
# For a description of the flash layout described by these variables, check
|
# For a description of the flash layout described by these variables, check
|
||||||
# the $(DEFAULT_FLASHMAP) .fmd files.
|
# the $(DEFAULT_FLASHMAP) .fmd files.
|
||||||
@ -760,13 +761,6 @@ endif # ifeq ($(CONFIG_ARCH_X86),y)
|
|||||||
$(prebuild-files) true
|
$(prebuild-files) true
|
||||||
mv $@.tmp $@
|
mv $@.tmp $@
|
||||||
else # ifneq ($(CONFIG_UPDATE_IMAGE),y)
|
else # ifneq ($(CONFIG_UPDATE_IMAGE),y)
|
||||||
prebuilt-files = $(foreach file,$(cbfs-files), $(call extract_nth,1,$(file)))
|
|
||||||
# Add all cbfs files to image of the form: CONFIG_CBFS_PREFIX/<filename>
|
|
||||||
prebuild-files = \
|
|
||||||
$(foreach file,$(cbfs-files), \
|
|
||||||
$(CBFSTOOL) $@.tmp remove -n $(call extract_nth,2,$(file)) 2>/dev/null ; \
|
|
||||||
$(call cbfs-add-cmd,$(file)))
|
|
||||||
|
|
||||||
.PHONY: $(obj)/coreboot.pre
|
.PHONY: $(obj)/coreboot.pre
|
||||||
$(obj)/coreboot.pre: $$(prebuilt-files) $(CBFSTOOL)
|
$(obj)/coreboot.pre: $$(prebuilt-files) $(CBFSTOOL)
|
||||||
mv $(obj)/coreboot.rom $@.tmp || \
|
mv $(obj)/coreboot.rom $@.tmp || \
|
||||||
|
Loading…
x
Reference in New Issue
Block a user