From eecac5ab883895c6d71e76081f7d3d2ed6d21465 Mon Sep 17 00:00:00 2001 From: Junjie Mao Date: Sun, 10 Jun 2018 11:43:13 +0800 Subject: [PATCH] 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 Acked-by: Anthony Xu Acked-by: Geoffroy VanCutsem --- hypervisor/Makefile | 2 +- hypervisor/scripts/kconfig/kconfig.mk | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/hypervisor/Makefile b/hypervisor/Makefile index a94db62e9..2020c66e0 100644 --- a/hypervisor/Makefile +++ b/hypervisor/Makefile @@ -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) diff --git a/hypervisor/scripts/kconfig/kconfig.mk b/hypervisor/scripts/kconfig/kconfig.mk index 69a619686..a0b929447 100644 --- a/hypervisor/scripts/kconfig/kconfig.mk +++ b/hypervisor/scripts/kconfig/kconfig.mk @@ -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 $< $@