Browse Source

Build: pEp wide consistent Makefiles - add env var BUILD_CONF / change local.conf to build.conf

master^2
heck 2 years ago
parent
commit
1b76ec2393
  1. 16
      Makefile.conf
  2. 4
      build.conf.example

16
Makefile.conf

@ -3,18 +3,16 @@
# This file may be used under the terms of the GNU General Public License version 3 # This file may be used under the terms of the GNU General Public License version 3
# see LICENSE.txt # see LICENSE.txt
HERE:=$(dir $(lastword $(MAKEFILE_LIST))) BUILD_CONF?=./build.conf
-include $(BUILD_CONF)
TARGET=libpEpAdapter.a TARGET=libpEpAdapter.a
# Build config # Build config
# Defaults # Defaults
DEBUG=1 DEBUG?=debug
PREFIX?=$(HOME) PREFIX?=$(HOME)
# Overrides
-include $(HERE)local.conf
# Constants # Constants
CXXFLAGS+=-std=c++11 -fPIC CXXFLAGS+=-std=c++11 -fPIC
CXXFLAGS+=-Wall -pedantic-errors -Wno-unused-parameter -Wno-reorder-ctor CXXFLAGS+=-Wall -pedantic-errors -Wno-unused-parameter -Wno-reorder-ctor
@ -30,10 +28,10 @@ else ifneq (,$(findstring clang,$(CXX)))
CFLAGS+=-fcolor-diagnostics CFLAGS+=-fcolor-diagnostics
endif endif
ifeq ($(DEBUG),1) ifeq ($(DEBUG),release)
CXXFLAGS+=-g -O0
CFLAGS+=-g -O0
else
CXXFLAGS+=-DNDEBUG=1 -O3 CXXFLAGS+=-DNDEBUG=1 -O3
CFLAGS+=-DNDEBUG=1 -O3 CFLAGS+=-DNDEBUG=1 -O3
else
CXXFLAGS+=-g -O0
CFLAGS+=-g -O0
endif endif

4
local.conf.example → build.conf.example

@ -6,8 +6,8 @@
######### C++ Compiler ######### ######### C++ Compiler #########
# Should work with clang and g++ # Should work with clang and g++
# CXX=g++ # CXX=g++
# DEBUG=1 # DEBUG Build (Default) # DEBUG=debug # DEBUG Build (Default)
# DEBUG=0 # RELEASE Build # DEBUG=release # RELEASE Build
############# DIRS ############# ############# DIRS #############
# PREFIX=$(HOME)/local # PREFIX=$(HOME)/local
Loading…
Cancel
Save