From a6e552b7b5d7b9206957107aecc37cbb0666a8af Mon Sep 17 00:00:00 2001 From: Victor Sun Date: Wed, 3 Jun 2020 13:18:46 +0800 Subject: [PATCH] Makefile: minor fix on hypervisor dependency The $(VERSION) should be depended on config.h change. For example, when RELEASE parameter is changed in make commmand, CONFIG_RELEASE need to be updated in defconfig file, and then message in version.h should be updated. The patch also fix a bug that a code path in make defconfig never be triggered because shell will treat [ ! -f $(KCONFIG_FILE) ] as false when $(KCONFIG_FILE) is not specified. (i.e. "$(KCONFIG_FILE)" == "") Tracked-On: #2412 Signed-off-by: Victor Sun --- hypervisor/Makefile | 2 +- hypervisor/scripts/makefile/kconfig.mk | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/hypervisor/Makefile b/hypervisor/Makefile index 47f7ba319..ad4fcef2e 100644 --- a/hypervisor/Makefile +++ b/hypervisor/Makefile @@ -489,7 +489,7 @@ distclean: rm -f tags TAGS cscope.files cscope.in.out cscope.out cscope.po.out GTAGS GPATH GRTAGS GSYMS PHONY: (VERSION) -$(VERSION): +$(VERSION): $(HV_OBJDIR)/$(HV_CONFIG_H) @if [ "$(SCENARIO)" = "" ]; then echo "Please specify SCENARIO for the build!"; exit 1; fi; @if [ "$(BOARD)" = "" ]; then echo "Please specify BOARD for the build!"; exit 1; fi; @echo "SCENARIO <$(SCENARIO)> for BOARD <$(BOARD)> is specified." diff --git a/hypervisor/scripts/makefile/kconfig.mk b/hypervisor/scripts/makefile/kconfig.mk index 17174ea37..eb14d2724 100644 --- a/hypervisor/scripts/makefile/kconfig.mk +++ b/hypervisor/scripts/makefile/kconfig.mk @@ -68,7 +68,7 @@ $(HV_OBJDIR)/$(HV_CONFIG_H): $(HV_OBJDIR)/$(HV_CONFIG) .PHONY: defconfig defconfig: $(KCONFIG_DEPS) @mkdir -p $(HV_OBJDIR) - @if [ ! -f $(KCONFIG_FILE) ] && [ "$(CONFIG_XML_ENABLED)" != "true" ]; then \ + @if ([ "$(KCONFIG_FILE)" == "" ] || ([ "$(KCONFIG_FILE)" != "" ] && [ ! -f $(KCONFIG_FILE) ])) && [ "$(CONFIG_XML_ENABLED)" != "true" ]; then \ BOARD=$(CONFIG_BOARD) python3 $(KCONFIG_DIR)/defconfig.py Kconfig $(HV_OBJDIR)/$(HV_CONFIG); \ else \ if [ "$(KCONFIG_FILE)" != "" ] && [ -f $(KCONFIG_FILE) ]; then \