From 38112f1e622eebe278e5faf04c0566e91482447f Mon Sep 17 00:00:00 2001 From: heck Date: Wed, 23 Aug 2023 12:12:57 +0200 Subject: [PATCH] Build: pEp wide consistent Makefiles - add env var BUILD_CONF / change local.conf to build.conf --- Makefile.conf | 15 ++++++--------- local.conf.example => build.conf.example | 4 ++-- 2 files changed, 8 insertions(+), 11 deletions(-) rename local.conf.example => build.conf.example (74%) diff --git a/Makefile.conf b/Makefile.conf index 6eeb044..a095768 100644 --- a/Makefile.conf +++ b/Makefile.conf @@ -3,12 +3,13 @@ # This file may be used under the terms of the GNU General Public License version 3 # see LICENSE -HERE:=$(dir $(lastword $(MAKEFILE_LIST))) +BUILD_CONF?=./build.conf +-include $(BUILD_CONF) TARGET=libpEpCxx11.a # Defaults -DEBUG=1 +DEBUG?=debug PREFIX?=$(HOME) LANG_VERSION=c++11 CXXFLAGS+=-fPIC -Wall -Wextra -pedantic @@ -19,16 +20,12 @@ else ifneq (,$(findstring clang,$(CXX))) CXXFLAGS+=-fcolor-diagnostics endif - -######### Overrides ######### --include $(HERE)local.conf - CXXFLAGS+=-std=$(LANG_VERSION) -ifeq ($(DEBUG),1) - CXXFLAGS+=-g -O0 -else +ifeq ($(DEBUG),release) CXXFLAGS+=-DNDEBUG=1 -O3 +else + CXXFLAGS+=-g -O0 endif CXXFLAGS+=-I$(PREFIX)/include diff --git a/local.conf.example b/build.conf.example similarity index 74% rename from local.conf.example rename to build.conf.example index 6ed7024..c1d8adc 100644 --- a/local.conf.example +++ b/build.conf.example @@ -5,8 +5,8 @@ ######### C++ Compiler ######### # Should work with clang and g++ -# DEBUG=1 # DEBUG Build (Default) -# DEBUG=0 # RELEASE Build +# DEBUG=debug # DEBUG Build (Default) +# DEBUG=release # RELEASE Build ############# DIRS ############# # PREFIX=$(HOME)/local \ No newline at end of file