mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-06-20 20:53:46 +00:00
HV: make: manage debug/release build in kconfig
This patch introduces a configuration symbol RELEASE for managing debug/release build in a similar way to how we manage PLATFORM. Note: 1. 'make defconfig RELEASE=1' will still use the CONFIG_RELEASE defined in the default configuration. The 'RELEASE=1' option has no effect in this case. 2. 'make RELEASE=1' is backward-compatible and enforces a release version to be built. v1 -> v2: * Pass RELEASE instead of CONFIG_RELEASE to silentoldconfig.py to avoid unintended overriding of the value. 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:
parent
c4493cc1f8
commit
8009cccb52
@ -9,8 +9,6 @@ RC_VERSION=5
|
|||||||
API_MAJOR_VERSION=1
|
API_MAJOR_VERSION=1
|
||||||
API_MINOR_VERSION=0
|
API_MINOR_VERSION=0
|
||||||
|
|
||||||
RELEASE ?= 0
|
|
||||||
|
|
||||||
GCC_MAJOR=$(shell echo __GNUC__ | $(CC) -E -x c - | tail -n 1)
|
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)
|
GCC_MINOR=$(shell echo __GNUC_MINOR__ | $(CC) -E -x c - | tail -n 1)
|
||||||
|
|
||||||
@ -172,7 +170,7 @@ endif
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
C_OBJS := $(patsubst %.c,$(HV_OBJDIR)/%.o,$(C_SRCS))
|
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))
|
C_OBJS += $(patsubst %.c,$(HV_OBJDIR)/%.o,$(D_SRCS))
|
||||||
CFLAGS += -DHV_DEBUG
|
CFLAGS += -DHV_DEBUG
|
||||||
endif
|
endif
|
||||||
@ -190,10 +188,10 @@ all: efi
|
|||||||
.PHONY: efi
|
.PHONY: efi
|
||||||
efi: $(HV_OBJDIR)/$(HV_FILE).bin
|
efi: $(HV_OBJDIR)/$(HV_FILE).bin
|
||||||
echo "building hypervisor as EFI executable..."
|
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
|
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
|
endif
|
||||||
|
|
||||||
ifeq ($(CONFIG_PLATFORM), sbl)
|
ifeq ($(CONFIG_PLATFORM), sbl)
|
||||||
@ -234,7 +232,7 @@ $(VERSION):
|
|||||||
DIRTY=`git diff-index --name-only HEAD`;\
|
DIRTY=`git diff-index --name-only HEAD`;\
|
||||||
if [ -n "$$DIRTY" ];then PATCH="$$COMMIT-dirty";else PATCH="$$COMMIT";fi;\
|
if [ -n "$$DIRTY" ];then PATCH="$$COMMIT-dirty";else PATCH="$$COMMIT";fi;\
|
||||||
TIME=`date "+%F %T"`;\
|
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); \
|
echo "/*" > $(VERSION); \
|
||||||
sed 's/^/ * /' ../LICENSE >> $(VERSION); \
|
sed 's/^/ * /' ../LICENSE >> $(VERSION); \
|
||||||
echo " */" >> $(VERSION); \
|
echo " */" >> $(VERSION); \
|
||||||
|
@ -16,6 +16,10 @@ config PLATFORM
|
|||||||
default "uefi" if PLATFORM_UEFI
|
default "uefi" if PLATFORM_UEFI
|
||||||
default "sbl" if PLATFORM_SBL
|
default "sbl" if PLATFORM_SBL
|
||||||
|
|
||||||
|
config RELEASE
|
||||||
|
bool "Release build"
|
||||||
|
default n
|
||||||
|
|
||||||
config NR_IOAPICS
|
config NR_IOAPICS
|
||||||
int "Maximum number of IOAPICs supported"
|
int "Maximum number of IOAPICs supported"
|
||||||
default 1
|
default 1
|
||||||
|
@ -30,7 +30,6 @@
|
|||||||
# POSSIBILITY OF SUCH DAMAGE.
|
# POSSIBILITY OF SUCH DAMAGE.
|
||||||
#
|
#
|
||||||
|
|
||||||
RELEASE:=0
|
|
||||||
HV_OBJDIR:=build
|
HV_OBJDIR:=build
|
||||||
HV_FILE:=acrn
|
HV_FILE:=acrn
|
||||||
EFI_OBJDIR:=$(HV_OBJDIR)/bsp/uefi/efi
|
EFI_OBJDIR:=$(HV_OBJDIR)/bsp/uefi/efi
|
||||||
|
@ -20,8 +20,18 @@ HV_CONFIG_MK := include/config.mk
|
|||||||
|
|
||||||
KCONFIG_DIR := $(BASEDIR)/../scripts/kconfig
|
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)
|
-include $(HV_OBJDIR)/$(HV_CONFIG_MK)
|
||||||
$(eval $(call override_config,PLATFORM,sbl))
|
$(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,python3,KCONFIG_DEPS))
|
||||||
$(eval $(call check_dep_exec,pip3,KCONFIG_DEPS))
|
$(eval $(call check_dep_exec,pip3,KCONFIG_DEPS))
|
||||||
@ -62,7 +72,8 @@ oldconfig: $(KCONFIG_DEPS)
|
|||||||
@mkdir -p $(HV_OBJDIR)
|
@mkdir -p $(HV_OBJDIR)
|
||||||
@python3 $(KCONFIG_DIR)/silentoldconfig.py Kconfig \
|
@python3 $(KCONFIG_DIR)/silentoldconfig.py Kconfig \
|
||||||
$(HV_OBJDIR)/$(HV_CONFIG) \
|
$(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
|
# Minimize the current .config. This target can be used to generate a defconfig
|
||||||
# for future use.
|
# for future use.
|
||||||
|
Loading…
Reference in New Issue
Block a user