From b62446db0e9bff816b456b3ae2e6a2e42b51882d Mon Sep 17 00:00:00 2001 From: heck Date: Wed, 6 May 2020 18:10:06 +0200 Subject: [PATCH] Add DEBUG or RELEASE build option --- Makefile.conf | 12 +++++++++++- local.conf.example | 2 ++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/Makefile.conf b/Makefile.conf index 459204b..36bd911 100644 --- a/Makefile.conf +++ b/Makefile.conf @@ -12,7 +12,7 @@ ifeq ($(PLATFORM),linux) endif ######### C and C++ ######### -CXXFLAGS+=-g -O0 -std=c++11 +CXXFLAGS+=-O0 -std=c++11 LDFLAGS+=-shared $(ENGINE_LIB) $(AD_LIB) LDLIBS=-lstdc++ -lpEpEngine -lpEpAdapter @@ -35,6 +35,7 @@ ENGINE_LIB_PATH=$(HOME)/lib ENGINE_INC_PATH=$(HOME)/include AD_LIB_PATH=$(HOME)/lib AD_INC_PATH=$(HOME)/include +DEBUG=1 ######### Overrides from the config file(s) ######### -include $(HERE)/local.conf @@ -49,5 +50,14 @@ ifdef BUILD_CONFIG include $(BUILD_CONFIG) endif +# Debug or Release build +ifeq ($(DEBUG),1) + $(info Debug build (set DEBUG=0 for release build)) + CXXFLAGS+=-g +else + $(info Release Build (set DEBUG=1 for debug build)) + CXXFLAGS+=-DNDEBUG=1 +endif + # YML_PATH is needed in the environment of every call to a program of the YML2 distribution export YML_PATH=$(YML2_PATH) diff --git a/local.conf.example b/local.conf.example index be8405d..8de0aa8 100644 --- a/local.conf.example +++ b/local.conf.example @@ -6,6 +6,8 @@ ######### C++ Compiler ######### # Should work with clang and g++ # CXX=g++ +# DEBUG=1 # DEBUG Build (Default) +# DEBUG=0 # RELEASE Build ######### JAVA ######### # JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_231.jdk/Contents/Home