diff --git a/hypervisor/Makefile b/hypervisor/Makefile index e0803b441..f80356da5 100644 --- a/hypervisor/Makefile +++ b/hypervisor/Makefile @@ -9,8 +9,6 @@ RC_VERSION=5 API_MAJOR_VERSION=1 API_MINOR_VERSION=0 -RELEASE ?= 0 - GCC_MAJOR=$(shell echo __GNUC__ | $(CC) -E -x c - | tail -n 1) GCC_MINOR=$(shell echo __GNUC_MINOR__ | $(CC) -E -x c - | tail -n 1) @@ -172,7 +170,7 @@ endif endif C_OBJS := $(patsubst %.c,$(HV_OBJDIR)/%.o,$(C_SRCS)) -ifeq ($(RELEASE),0) +ifeq ($(CONFIG_RELEASE),n) C_OBJS += $(patsubst %.c,$(HV_OBJDIR)/%.o,$(D_SRCS)) CFLAGS += -DHV_DEBUG endif @@ -190,10 +188,10 @@ all: efi .PHONY: efi efi: $(HV_OBJDIR)/$(HV_FILE).bin echo "building hypervisor as EFI executable..." - make -C bsp/uefi/efi HV_OBJDIR=$(HV_OBJDIR) RELEASE=$(RELEASE) + make -C bsp/uefi/efi HV_OBJDIR=$(HV_OBJDIR) install: efi - make -C bsp/uefi/efi HV_OBJDIR=$(HV_OBJDIR) RELEASE=$(RELEASE) install + make -C bsp/uefi/efi HV_OBJDIR=$(HV_OBJDIR) install endif ifeq ($(CONFIG_PLATFORM), sbl) @@ -234,7 +232,7 @@ $(VERSION): DIRTY=`git diff-index --name-only HEAD`;\ if [ -n "$$DIRTY" ];then PATCH="$$COMMIT-dirty";else PATCH="$$COMMIT";fi;\ TIME=`date "+%F %T"`;\ - if [ $(RELEASE) = 0 ];then BUILD_TYPE="DBG";else BUILD_TYPE="REL";fi;\ + if [ $(CONFIG_RELEASE) = "n" ];then BUILD_TYPE="DBG";else BUILD_TYPE="REL";fi;\ echo "/*" > $(VERSION); \ sed 's/^/ * /' ../LICENSE >> $(VERSION); \ echo " */" >> $(VERSION); \ diff --git a/hypervisor/arch/x86/Kconfig b/hypervisor/arch/x86/Kconfig index a4328f740..cdb098d6c 100644 --- a/hypervisor/arch/x86/Kconfig +++ b/hypervisor/arch/x86/Kconfig @@ -16,6 +16,10 @@ config PLATFORM default "uefi" if PLATFORM_UEFI default "sbl" if PLATFORM_SBL +config RELEASE + bool "Release build" + default n + config NR_IOAPICS int "Maximum number of IOAPICs supported" default 1 diff --git a/hypervisor/bsp/uefi/efi/Makefile b/hypervisor/bsp/uefi/efi/Makefile index ac74f6a95..fb00eb3a0 100644 --- a/hypervisor/bsp/uefi/efi/Makefile +++ b/hypervisor/bsp/uefi/efi/Makefile @@ -30,7 +30,6 @@ # POSSIBILITY OF SUCH DAMAGE. # -RELEASE:=0 HV_OBJDIR:=build HV_FILE:=acrn EFI_OBJDIR:=$(HV_OBJDIR)/bsp/uefi/efi diff --git a/hypervisor/scripts/kconfig/kconfig.mk b/hypervisor/scripts/kconfig/kconfig.mk index a0e21ecb6..dd32fa4d8 100644 --- a/hypervisor/scripts/kconfig/kconfig.mk +++ b/hypervisor/scripts/kconfig/kconfig.mk @@ -20,8 +20,18 @@ HV_CONFIG_MK := include/config.mk KCONFIG_DIR := $(BASEDIR)/../scripts/kconfig +# Backward-compatibility for RELEASE=(0|1) +ifdef RELEASE +ifeq ($(RELEASE),1) +override RELEASE := y +else +override RELEASE := n +endif +endif + -include $(HV_OBJDIR)/$(HV_CONFIG_MK) $(eval $(call override_config,PLATFORM,sbl)) +$(eval $(call override_config,RELEASE,n)) $(eval $(call check_dep_exec,python3,KCONFIG_DEPS)) $(eval $(call check_dep_exec,pip3,KCONFIG_DEPS)) @@ -62,7 +72,8 @@ oldconfig: $(KCONFIG_DEPS) @mkdir -p $(HV_OBJDIR) @python3 $(KCONFIG_DIR)/silentoldconfig.py Kconfig \ $(HV_OBJDIR)/$(HV_CONFIG) \ - PLATFORM_$(shell echo $(PLATFORM) | tr a-z A-Z)=y + PLATFORM_$(shell echo $(PLATFORM) | tr a-z A-Z)=y \ + RELEASE=$(RELEASE) # Minimize the current .config. This target can be used to generate a defconfig # for future use.