From d92b92c8443ffbe5dd4396593abcac4a636fcf6a Mon Sep 17 00:00:00 2001 From: heck Date: Thu, 13 Aug 2020 00:26:02 +0200 Subject: [PATCH] Unified local.conf with pEpJNIAdapter, added local.conf.example, (BUILD_CONFIG gone seemed to be broken, anyone missing it? /q heck) --- Makefile | 2 +- Makefile.conf | 32 +++++++++++++++++--------------- local.conf.example | 16 ++++++++++++++++ 3 files changed, 34 insertions(+), 16 deletions(-) create mode 100644 local.conf.example diff --git a/Makefile b/Makefile index ffe12d8..3c72e78 100644 --- a/Makefile +++ b/Makefile @@ -7,7 +7,7 @@ include Makefile.conf TARGET=libpEpAdapter.a -.PHONY: install, uninstall, clean +.PHONY: install uninstall clean SOURCE=$(wildcard *.cc) HEADERS=$(wildcard *.hh *.hxx) diff --git a/Makefile.conf b/Makefile.conf index 29a61ab..8a3afec 100644 --- a/Makefile.conf +++ b/Makefile.conf @@ -6,7 +6,12 @@ HERE:=$(dir $(lastword $(MAKEFILE_LIST))) -PREFIX?=$(HOME) +# Defaults +DEBUG=1 +PREFIX?=$(HOME)/local +ENGINE_LIB_PATH=$(PREFIX)/lib +ENGINE_INC_PATH=$(PREFIX)/include + CXXFLAGS+=-std=c++11 -fPIC # Build target @@ -18,20 +23,20 @@ else ifneq (,$(findstring clang,$(CXX))) CXXFLAGS+=-fcolor-diagnostics endif -# Debug or Release build -ifndef NDEBUG - CXXFLAGS+=-g -O0 +######### Overrides ######### +ifneq ("$(wildcard $(HERE)local.conf)","") + $(info including: $(HERE)local.conf) + -include $(HERE)local.conf else - CXXFLAGS+=-DNDEBUG -O2 + $(info Optional build config not found: $(HERE)local.conf) endif -######### Engine ######### -ENGINE_LIB_PATH=$(PREFIX)/lib -ENGINE_INC_PATH=$(PREFIX)/include - -######### Overrides ######### --include $(HERE)/local.conf +ifeq ($(DEBUG),1) + CXXFLAGS+=-g -O0 +else + CXXFLAGS+=-DNDEBUG=1 -O3 +endif # Add -L Prefixes to LIB/INC paths, # if not already explicitly set in local.conf @@ -42,12 +47,9 @@ ifndef ENGINE_INC ENGINE_INC=-I$(ENGINE_INC_PATH) endif -ifdef BUILD_CONFIG - include $(BUILD_CONFIG) -endif +CXXFLAGS += $(ENGINE_INC) ifndef ENGINE_TEST ENGINE_TEST = \"$(HOME)/dev/pEpEngine/test\" endif -CXXFLAGS += $(ENGINE_INC) diff --git a/local.conf.example b/local.conf.example new file mode 100644 index 0000000..3cd4ef8 --- /dev/null +++ b/local.conf.example @@ -0,0 +1,16 @@ +# This is an Example build config file (local.conf) +# you might not need this file, but if the defaults dont work for you +# You can override them here. +# Tweak the values to your needs and rename it to local.conf + +######### C++ Compiler ######### +# Should work with clang and g++ +# CXX=g++ +# DEBUG=1 # DEBUG Build (Default) +# DEBUG=0 # RELEASE Build + +############# DIRS ############# +# PREFIX=$(HOME)/local +# ENGINE_LIB_PATH=$(PREFIX)/lib +# ENGINE_INC_PATH=$(PREFIX)/include +# ENGINE_TEST= \ No newline at end of file