You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
47 lines
1.2 KiB
47 lines
1.2 KiB
# Copyright 2022, pEp Foundation
|
|
# This file is part of libpEpCxx11
|
|
# This file may be used under the terms of the GNU General Public License version 3
|
|
# see LICENSE
|
|
|
|
# BUILD_CONF must be specified relative to the repo root or must be an absolute path
|
|
# BUILD_CONF defaults to ./build.conf
|
|
REPO_ROOT_REL:=$(dir $(lastword $(MAKEFILE_LIST)))
|
|
ifndef BUILD_CONF
|
|
BUILD_CONF=$(REPO_ROOT_REL)/build.conf
|
|
-include $(BUILD_CONF)
|
|
else
|
|
BUILD_CONF_EFF=$(BUILD_CONF)
|
|
ifeq ($(dir $(BUILD_CONF)),./)
|
|
BUILD_CONF_EFF=$(REPO_ROOT_REL)/$(BUILD_CONF)
|
|
endif
|
|
ifeq ($(wildcard $(BUILD_CONF_EFF)),)
|
|
$(info BUILD_CONF must be specified relative to the repo root or must be an absolute path)
|
|
$(error file specified using BUILD_CONF ($(BUILD_CONF)) not found)
|
|
endif
|
|
include $(BUILD_CONF_EFF)
|
|
endif
|
|
|
|
TARGET=libpEpCxx11.a
|
|
|
|
# Defaults
|
|
DEBUG?=debug
|
|
PREFIX?=$(HOME)
|
|
LANG_VERSION=c++11
|
|
CXXFLAGS+=-fPIC -Wall -Wextra -pedantic
|
|
|
|
ifneq (,$(findstring g++,$(CXX)))
|
|
CXXFLAGS+=-fdiagnostics-color=always
|
|
else ifneq (,$(findstring clang,$(CXX)))
|
|
CXXFLAGS+=-fcolor-diagnostics
|
|
endif
|
|
|
|
CXXFLAGS+=-std=$(LANG_VERSION)
|
|
|
|
ifeq ($(DEBUG),release)
|
|
CXXFLAGS+=-DNDEBUG=1 -O3
|
|
else
|
|
CXXFLAGS+=-g -O0
|
|
endif
|
|
|
|
CXXFLAGS+=-I$(PREFIX)/include
|
|
LDFLAGS=-L$(PREFIX)/lib
|