HV: make: force updating .config and config.mk

Before checking any given target, make has an additional phase to check if any
included makefile should be updated. This patch enforces running oldconfig in
this phase to update .config and config.mk (if necessary). This ensures that
make gets the correct configurations when executing the given target.

Signed-off-by: Junjie Mao <junjie.mao@intel.com>
Acked-by: Anthony Xu <anthony.xu@intel.com>
Acked-by: Geoffroy VanCutsem <geoffroy.vancutsem@intel.com>
This commit is contained in:
Junjie Mao 2018-06-10 11:43:13 +08:00 committed by Jack Ren
parent d28d79d776
commit eecac5ab88
2 changed files with 6 additions and 6 deletions

View File

@ -183,7 +183,7 @@ DISTCLEAN_OBJS := $(shell find $(BASEDIR) -name '*.o')
VERSION := bsp/$(PLATFORM)/include/bsp/version.h
.PHONY: all
all: $(BUILD_DEPS) $(VERSION) oldconfig $(HV_OBJDIR)/$(HV_FILE).32.out $(HV_OBJDIR)/$(HV_FILE).bin
all: $(BUILD_DEPS) $(VERSION) $(HV_OBJDIR)/$(HV_FILE).32.out $(HV_OBJDIR)/$(HV_FILE).bin
rm -f $(VERSION)
ifeq ($(PLATFORM), uefi)

View File

@ -9,12 +9,12 @@ $(eval $(call check_dep_exec,python))
$(eval $(call check_dep_exec,pip))
$(eval $(call check_dep_pylib,kconfiglib))
# This target invoke silentoldconfig to generate a .config only if a .config
# does not exist. Useful as a dependency for source compilation.
$(HV_OBJDIR)/$(HV_CONFIG):
@mkdir -p $(HV_OBJDIR)
@python $(KCONFIG_DIR)/silentoldconfig.py Kconfig $(HV_OBJDIR)/$(HV_CONFIG) PLATFORM_$(shell echo $(PLATFORM) | tr a-z A-Z)=y
# This target invoke silentoldconfig to generate or update a .config. Useful as
# a prerequisite of other targets depending on .config.
$(HV_OBJDIR)/$(HV_CONFIG): oldconfig
# Note: This target must not depend on a phony target (e.g. oldconfig) because
# it'll trigger endless re-execution of make.
$(HV_OBJDIR)/$(HV_CONFIG_MK): $(HV_OBJDIR)/$(HV_CONFIG)
@mkdir -p $(dir $@)
@cp $< $@