|
@ -3,27 +3,33 @@ |
|
|
# 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
|
|
|
|
|
|
|
|
|
######### Header #########
|
|
|
|
|
|
HERE:=$(dir $(lastword $(MAKEFILE_LIST))) |
|
|
HERE:=$(dir $(lastword $(MAKEFILE_LIST))) |
|
|
|
|
|
|
|
|
######### General #########
|
|
|
|
|
|
BUILD_FOR:=$(shell uname) |
|
|
|
|
|
PREFIX=$(HOME) |
|
|
PREFIX=$(HOME) |
|
|
|
|
|
CXXFLAGS=-std=c++11 |
|
|
|
|
|
|
|
|
######### C and C++ #########
|
|
|
# Build target
|
|
|
CXXFLAGS=-std=c++11 |
|
|
BUILD_FOR:=$(shell uname) |
|
|
|
|
|
|
|
|
######### C++ #########
|
|
|
|
|
|
ifeq ($(BUILD_FOR),Linux) |
|
|
ifeq ($(BUILD_FOR),Linux) |
|
|
|
|
|
$(info Building for Linux) |
|
|
CXX=g++ |
|
|
CXX=g++ |
|
|
|
|
|
CXXFLAGS+=-fdiagnostics-color=always -O0 $(ENGINE_INC) -fPIC |
|
|
else ifeq ($(BUILD_FOR),Darwin) |
|
|
else ifeq ($(BUILD_FOR),Darwin) |
|
|
|
|
|
$(info Building for Darwin) |
|
|
CXX=clang |
|
|
CXX=clang |
|
|
|
|
|
CXXFLAGS+=-fcolor-diagnostics -O0 $(ENGINE_INC) |
|
|
endif |
|
|
endif |
|
|
|
|
|
|
|
|
ifeq ($(BUILD_FOR),Linux) |
|
|
# Debug or Release build
|
|
|
CXXFLAGS+=-fdiagnostics-color=always -O0 -g $(ENGINE_INC) -fPIC |
|
|
DEBUG=1 |
|
|
else ifeq ($(BUILD_FOR),Darwin) |
|
|
ifeq ($(DEBUG),1) |
|
|
CXXFLAGS+=-fcolor-diagnostics -O0 -g $(ENGINE_INC) |
|
|
$(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 |
|
|
endif |
|
|
|
|
|
|
|
|
######### Engine #########
|
|
|
######### Engine #########
|
|
@ -33,7 +39,8 @@ ENGINE_INC_PATH=$(HOME)/include |
|
|
######### Overrides #########
|
|
|
######### Overrides #########
|
|
|
-include $(HERE)/local.conf |
|
|
-include $(HERE)/local.conf |
|
|
|
|
|
|
|
|
# Add Prefixes to paths, if not already explicitly set in local.conf(s)
|
|
|
# Add -L Prefixes to LIB/INC paths,
|
|
|
|
|
|
# if not already explicitly set in local.conf
|
|
|
ifndef ENGINE_LIB |
|
|
ifndef ENGINE_LIB |
|
|
ENGINE_LIB=-L$(ENGINE_LIB_PATH) |
|
|
ENGINE_LIB=-L$(ENGINE_LIB_PATH) |
|
|
endif |
|
|
endif |
|
|