From d5f1a44d65e2a39a019fb668ae241afc9ab207ae Mon Sep 17 00:00:00 2001 From: Junjie Mao Date: Sun, 28 Feb 2021 10:59:52 +0800 Subject: [PATCH] Makefile: prefer RELEASE=y|n over RELEASE=0|1 For clarity, we now prefer y|n over 0|1 as the values of boolean options on make command lines. This patch applies this preference to the Makefile of the device model and tools, while RELEASE=0|1 is still supported for backward compatibility. Tracked-On: #5772 Signed-off-by: Junjie Mao --- Makefile | 9 +++++++++ devicemodel/Makefile | 16 ++++++++++++++-- hypervisor/scripts/makefile/config.mk | 4 ++-- misc/Makefile | 18 +++++++++++++++--- misc/debug_tools/acrn_crashlog/Makefile | 16 ++++++++++++++-- misc/services/acrn_manager/Makefile | 16 ++++++++++++++-- 6 files changed, 68 insertions(+), 11 deletions(-) diff --git a/Makefile b/Makefile index 7d47d6ad6..942026aa2 100644 --- a/Makefile +++ b/Makefile @@ -54,6 +54,15 @@ else endif endif +# Backward-compatibility for RELEASE=(0|1) +ifeq ($(RELEASE),1) + override RELEASE := y +else + ifeq ($(RELEASE),0) + override RELEASE := n + endif +endif + BOARD ?= kbl-nuc-i7 ifeq ($(BOARD), apl-nuc) diff --git a/devicemodel/Makefile b/devicemodel/Makefile index d4157ba69..06286613f 100644 --- a/devicemodel/Makefile +++ b/devicemodel/Makefile @@ -11,7 +11,19 @@ DM_BUILD_VERSION ?= DM_BUILD_TAG ?= CC ?= gcc -RELEASE ?= 0 + +ifndef RELEASE + override RELEASE := n +else + # Backward-compatibility for RELEASE=(0|1) + ifeq ($(RELEASE),1) + override RELEASE := y + else + ifeq ($(RELEASE),0) + override RELEASE := n + endif + endif +endif CFLAGS := -g -O0 -std=gnu11 CFLAGS += -D_GNU_SOURCE @@ -52,7 +64,7 @@ endif endif endif -ifeq ($(RELEASE),0) +ifeq ($(RELEASE),n) CFLAGS += -DDM_DEBUG else LDFLAGS += -s diff --git a/hypervisor/scripts/makefile/config.mk b/hypervisor/scripts/makefile/config.mk index 375e4ebae..ad74de465 100644 --- a/hypervisor/scripts/makefile/config.mk +++ b/hypervisor/scripts/makefile/config.mk @@ -99,9 +99,9 @@ ifdef RELEASE endif else ifdef CONFIG_RELEASE - RELEASE := $(CONFIG_RELEASE) + override RELEASE := $(CONFIG_RELEASE) else - RELEASE := $(1) + override RELEASE := $(1) endif endif endef diff --git a/misc/Makefile b/misc/Makefile index 8b2a703a6..6c822e17e 100644 --- a/misc/Makefile +++ b/misc/Makefile @@ -1,9 +1,21 @@ T := $(CURDIR) OUT_DIR ?= $(shell mkdir -p $(T)/build;cd $(T)/build;pwd) -RELEASE ?= 0 + +ifndef RELEASE + override RELEASE := n +else + # Backward-compatibility for RELEASE=(0|1) + ifeq ($(RELEASE),1) + override RELEASE := y + else + ifeq ($(RELEASE),0) + override RELEASE := n + endif + endif +endif .PHONY: all acrn-crashlog acrnlog acrn-manager acrntrace acrnbridge life_mngr -ifeq ($(RELEASE),0) +ifeq ($(RELEASE),n) all: acrn-crashlog acrnlog acrn-manager acrntrace acrnbridge life_mngr else all: acrn-manager acrnbridge life_mngr @@ -37,7 +49,7 @@ clean: rm -rf $(OUT_DIR) .PHONY: install -ifeq ($(RELEASE),0) +ifeq ($(RELEASE),n) install: acrn-crashlog-install acrnlog-install acrn-manager-install acrntrace-install acrnbridge-install \ acrn-life-mngr-install else diff --git a/misc/debug_tools/acrn_crashlog/Makefile b/misc/debug_tools/acrn_crashlog/Makefile index 1b166c9f1..c2367704e 100644 --- a/misc/debug_tools/acrn_crashlog/Makefile +++ b/misc/debug_tools/acrn_crashlog/Makefile @@ -9,9 +9,21 @@ OUT_DIR ?= $(BASEDIR) BUILDDIR := $(OUT_DIR)/acrn-crashlog CC ?= gcc RM = rm -RELEASE ?= 0 -ifeq ($(RELEASE),0) +ifndef RELEASE + override RELEASE := n +else + # Backward-compatibility for RELEASE=(0|1) + ifeq ($(RELEASE),1) + override RELEASE := y + else + ifeq ($(RELEASE),0) + override RELEASE := n + endif + endif +endif + +ifeq ($(RELEASE),n) CFLAGS += -DDEBUG_ACRN_CRASHLOG endif diff --git a/misc/services/acrn_manager/Makefile b/misc/services/acrn_manager/Makefile index 92a23b58e..4442fa969 100644 --- a/misc/services/acrn_manager/Makefile +++ b/misc/services/acrn_manager/Makefile @@ -3,7 +3,19 @@ include ../../../paths.make T := $(CURDIR) OUT_DIR ?= $(shell mkdir -p $(T)/build;cd $(T)/build;pwd) CC ?= gcc -RELEASE ?= 0 + +ifndef RELEASE + override RELEASE := n +else + # Backward-compatibility for RELEASE=(0|1) + ifeq ($(RELEASE),1) + override RELEASE := y + else + ifeq ($(RELEASE),0) + override RELEASE := n + endif + endif +endif MANAGER_CFLAGS := -g -O0 -std=gnu11 MANAGER_CFLAGS += -D_GNU_SOURCE @@ -50,7 +62,7 @@ endif endif endif -ifeq ($(RELEASE),0) +ifeq ($(RELEASE),n) MANAGER_CFLAGS += -g -DMNGR_DEBUG else MANAGER_LDFLAGS += -s