build system: deduplicate the addition of alignment/base arguments
Change-Id: I951606333d19cd6bf655294b8b3097884b6ac9e6 Signed-off-by: Patrick Georgi <pgeorgi@chromium.org> Reviewed-on: https://review.coreboot.org/13501 Tested-by: build bot (Jenkins) Reviewed-by: Martin Roth <martinroth@google.com>
This commit is contained in:
parent
93d53677da
commit
35a2bcaa21
11
Makefile.inc
11
Makefile.inc
@ -658,15 +658,14 @@ define cbfs-add-cmd
|
|||||||
$(if $(filter-out stage,$(call extract_nth,3,$(1))),-t $(call extract_nth,3,$(1))) \
|
$(if $(filter-out stage,$(call extract_nth,3,$(1))),-t $(call extract_nth,3,$(1))) \
|
||||||
$(if $(call extract_nth,4,$(1)),-c $(call extract_nth,4,$(1))) $(cbfs-autogen-attributes)\
|
$(if $(call extract_nth,4,$(1)),-c $(call extract_nth,4,$(1))) $(cbfs-autogen-attributes)\
|
||||||
-r $(call regions-for-file,$(call extract_nth,2,$(1))) \
|
-r $(call regions-for-file,$(call extract_nth,2,$(1))) \
|
||||||
|
$(if $(call extract_nth,6,$(1)),-a $(call extract_nth,6,$(file)), \
|
||||||
|
$(if $(call extract_nth,5,$(file)),-b $(call extract_nth,5,$(file)))) \
|
||||||
$(call extract_nth,7,$(1)) $(2)
|
$(call extract_nth,7,$(1)) $(2)
|
||||||
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)
|
ifneq ($(CONFIG_UPDATE_IMAGE),y)
|
||||||
prebuild-files = \
|
prebuild-files = $(foreach file,$(cbfs-files), $(call cbfs-add-cmd,$(file)))
|
||||||
$(foreach file,$(cbfs-files), \
|
|
||||||
$(if $(call extract_nth,6,$(file)),$(call cbfs-add-cmd,$(file),-a $(call extract_nth,6,$(file))), \
|
|
||||||
$(call cbfs-add-cmd,$(file),$(if $(call extract_nth,5,$(file)),-b $(call extract_nth,5,$(file))))))
|
|
||||||
prebuilt-files = $(foreach file,$(cbfs-files), $(call extract_nth,1,$(file)))
|
prebuilt-files = $(foreach file,$(cbfs-files), $(call extract_nth,1,$(file)))
|
||||||
|
|
||||||
ifeq ($(CONFIG_FMDFILE),)
|
ifeq ($(CONFIG_FMDFILE),)
|
||||||
@ -765,9 +764,7 @@ prebuilt-files = $(foreach file,$(cbfs-files), $(call extract_nth,1,$(file)))
|
|||||||
prebuild-files = \
|
prebuild-files = \
|
||||||
$(foreach file,$(cbfs-files), \
|
$(foreach file,$(cbfs-files), \
|
||||||
$(CBFSTOOL) $@.tmp remove -n $(call extract_nth,2,$(file)) 2>/dev/null ; \
|
$(CBFSTOOL) $@.tmp remove -n $(call extract_nth,2,$(file)) 2>/dev/null ; \
|
||||||
$(if $(call extract_nth,6,$(file)),$(call cbfs-add-cmd,$(file),-a $(call extract_nth,6,$(file))),\
|
$(call cbfs-add-cmd,$(file),$(cbfs-autogen-attributes)))
|
||||||
$(call cbfs-add-cmd,$(file),$(if $(call extract_nth,5,$(file)),-b $(call extract_nth,5,$(file))) \
|
|
||||||
$(cbfs-autogen-attributes))))
|
|
||||||
|
|
||||||
.PHONY: $(obj)/coreboot.pre
|
.PHONY: $(obj)/coreboot.pre
|
||||||
$(obj)/coreboot.pre: $$(prebuilt-files) $(CBFSTOOL)
|
$(obj)/coreboot.pre: $$(prebuilt-files) $(CBFSTOOL)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user