Makefile: disable KCONFIG_FILE when build from xml

The SCENARIO xml file already includes all information of KCONFIG file,
use KCONFIG_FILE/SCENARIO_FILE parameter at same time would introduce
conflict so this case should be invalid.

Tracked-On: #4616

Signed-off-by: Victor Sun <victor.sun@intel.com>
This commit is contained in:
Victor Sun 2020-04-16 09:54:43 +08:00 committed by wenlingz
parent 3fd5fc9b51
commit e57ad3fd2f

View File

@ -13,7 +13,6 @@ TARGET_DIR ?=
# 2. make <target> KCONFIG_FILE=xxx [TARGET_DIR=xxx]
# 3. make <target> BOARD=xxx SCENARIO=xxx [TARGET_DIR=xxx]
# 4. make <target> BOARD_FILE=xxx SCENARIO_FILE=xxx [TARGET_DIR=xxx]
# 5. make <target> KCONFIG_FILE=xxx BOARD_FILE=xxx SCENARIO_FILE=xxx [TARGET_DIR=xxx]
#
# Especially for case 1 that no any parameters are specified:
# a. If hypervisor/build/.config file which generated by "make menuconfig" exist,
@ -25,7 +24,7 @@ TARGET_DIR ?=
# i.e. equal: make <target> BOARD=$(BOARD) SCENARIO=$(SCENARIO)
#
# For case 2/3, configurations are imported from TARGET_DIR when TARGET_DIR is specified;
# For case 4/5, configurations are from XML files and saved to TARGET_DIR if it is specified;
# For case 4, configurations are from XML files and saved to TARGET_DIR if it is specified;
#
# The grep process did not handle corner case when '#' is manually put right after config value as comments,
# i.e. it will be failed in the case of "CONFIG_XXX=y # some comments here "
@ -67,7 +66,11 @@ endif
ifeq ($(KCONFIG_FILE), $(wildcard $(KCONFIG_FILE)))
ifneq ($(BOARD)$(SCENARIO),)
$(error BOARD/SCENARIO parameter could not coexist with KCONFIG_FILE)
$(error BOARD/SCENARIO parameter could not coexist with Kconfig file: $(KCONFIG_FILE))
endif
ifneq ($(BOARD_FILE)$(SCENARIO_FILE),)
$(error BOARD_FILE/SCENARIO_FILE parameter could not coexist with Kconfig file: $(KCONFIG_FILE))
endif
BOARD_IN_KCONFIG := $(shell grep CONFIG_BOARD= $(KCONFIG_FILE) | grep -v '\#' | awk -F '"' '{print $$2}')
@ -169,6 +172,8 @@ hypervisor:
fi
#endif
@echo -e "\n\033[47;30mACRN Configuration Summary:\033[0m \nBOARD = $(BOARD)\t SCENARIO = $(SCENARIO)" > $(HV_CFG_LOG); \
echo -e "BUILD type = \c" >> $(HV_CFG_LOG); \
if [ "$(RELEASE)" = "0" ]; then echo -e "DEBUG" >> $(HV_CFG_LOG); else echo -e "RELEASE" >> $(HV_CFG_LOG); fi; \
if [ -f $(KCONFIG_FILE) ]; then \
echo -e "Hypervisor configuration is based on:\n\tKconfig file:\t$(KCONFIG_FILE);" >> $(HV_CFG_LOG); \
fi; \