diff options
author | Nico Huber <nico.h@gmx.de> | 2021-03-06 13:12:34 +0100 |
---|---|---|
committer | Nico Huber <nico.h@gmx.de> | 2021-03-27 19:34:58 +0000 |
commit | 10a879e65bd24ac261b29445ee720538cad37653 (patch) | |
tree | c73b617ce0f34dfd703b436d7a1010c7f0c803c9 | |
parent | 84ec70312e977355c8bac4be575c5808797da04d (diff) |
Makefile.inc: Use `additional-dirs` for $(objcbfs), $(objgenerated)
We use `additional-dirs` for a single `mkdir -p` invocation for all
directiories. I don't see why these two, $(objcbfs) and $(objgenerated),
should be an exception.
Fixes clean builds for targets that don't include the phony `coreboot`
target, e.g. `make qemu`.
Change-Id: I85abaa74cddefd2bd669e2b5c8934352775070fe
Signed-off-by: Nico Huber <nico.h@gmx.de>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/51318
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
-rw-r--r-- | Makefile | 2 | ||||
-rw-r--r-- | Makefile.inc | 13 |
2 files changed, 8 insertions, 7 deletions
@@ -13,6 +13,8 @@ objutil ?= $(obj)/util objk := $(objutil)/kconfig absobj := $(abspath $(obj)) +additional-dirs := + VBOOT_HOST_BUILD ?= $(abspath $(objutil)/vboot_lib) COREBOOT_EXPORTS := COREBOOT_EXPORTS diff --git a/Makefile.inc b/Makefile.inc index df41c5d55e..a372efaedc 100644 --- a/Makefile.inc +++ b/Makefile.inc @@ -42,6 +42,7 @@ COREBOOT_EXPORTS += MAINBOARDDIR VARIANT_DIR CARRIER_DIR ## rom image file, are placed under $(objcbfs). ## These typically have suffixes .debug .elf .bin and .map objcbfs := $(obj)/cbfs/$(CONFIG_CBFS_PREFIX) +additional-dirs += $(objcbfs) COREBOOT_EXPORTS += objcbfs ## Based on the active configuration, Makefile conditionally collects @@ -49,6 +50,7 @@ COREBOOT_EXPORTS += objcbfs ## Such files that do not have a clear one-to-one relation to a source ## file under src/ are placed and built under $(objgenerated) objgenerated := $(obj)/generated +additional-dirs += $(objgenerated) COREBOOT_EXPORTS += objgenerated ## CCACHE_EXTRAFILES can be set by individual rules to help CCACHE @@ -58,7 +60,7 @@ COREBOOT_EXPORTS += CCACHE_EXTRAFILES ####################################################################### # root rule to resolve if in build mode (ie. configuration exists) real-target: $(obj)/config.h coreboot files_added -coreboot: build-dirs $(obj)/coreboot.rom $(obj)/cbfstool $(obj)/rmodtool $(obj)/ifwitool +coreboot: $(obj)/coreboot.rom $(obj)/cbfstool $(obj)/rmodtool $(obj)/ifwitool # This target can be used in site local to run scripts or additional # targets after the build completes by creating a Makefile.inc in the @@ -73,7 +75,7 @@ files_added:: build_complete ####################################################################### # our phony targets -PHONY+= clean-abuild coreboot check-style build-dirs build_complete +PHONY+= clean-abuild coreboot check-style build_complete ####################################################################### # root source directories of coreboot @@ -508,7 +510,7 @@ ifeq ($(CONFIG_DEBUG_ADA_CODE),y) ADAFLAGS_common += -gnata endif -additional-dirs := $(objutil)/cbfstool $(objutil)/ifdtool \ +additional-dirs += $(objutil)/cbfstool $(objutil)/ifdtool \ $(objutil)/options $(objutil)/amdfwtool \ $(objutil)/cbootimage @@ -536,9 +538,6 @@ $(build_h): $$(shell $$(build_h_check)) @printf " GEN build.h\n" mv $< $@ -build-dirs $(objcbfs) $(objgenerated): - mkdir -p $(objcbfs) $(objgenerated) - $(obj)/build_info: @echo 'COREBOOT_VERSION: $(call strip_quotes,$(KERNELVERSION))' > $@.tmp @echo 'MAINBOARD_VENDOR: $(call strip_quotes,$(CONFIG_MAINBOARD_VENDOR))' >> $@.tmp @@ -770,7 +769,7 @@ $(objcbfs)/bootblock.raw.bin: $(objcbfs)/bootblock.raw.elf $(OBJCOPY_bootblock) -O binary $< $@ ifneq ($(CONFIG_HAVE_BOOTBLOCK),y) -$(objcbfs)/bootblock.bin: $(objcbfs) +$(objcbfs)/bootblock.bin: dd if=/dev/zero of=$@ bs=64 count=1 endif |