Browse Source

Split platform-specific parts of Makefile.conf into separate files

ENGINE-228
Damiano Boppart 4 years ago
parent
commit
e6e10d03da
4 changed files with 158 additions and 27 deletions
  1. +15
    -27
      Makefile.conf
  2. +27
    -0
      build-config/Darwin.conf
  3. +27
    -0
      build-config/Linux.conf
  4. +89
    -0
      build-config/common.conf

+ 15
- 27
Makefile.conf View File

@ -1,30 +1,18 @@
# this file is in the Public Domain
# Copyright 2017, pEp Security SA
# This file is part of pEpEngine
# This file may be used under the terms of the GNU General Public License version 3
# see LICENSE.txt
BUILD_ON=$(shell uname)
BUILD_FOR=$(BUILD_ON)
OPTIMIZE=-g -Wall -O0 -fPIC -DDEBUG_ERRORSTACK
#OPTIMIZE=-O3 -Wall -DNDEBUG -std=c99
LD=$(CC)
#CC=gcc-mp-4.9 -std=c99 -fstrict-aliasing -Wstrict-aliasing=3
#LD=gcc-mp-4.9
SYSTEM_DB=/usr/local/share/pEp/system.db
PREFIX=$(HOME)
YML2PROC=$(HOME)/yml2/yml2proc
YML_OPTS=--encoding=utf8
YML_PATH=$(HOME)/yml2
ASN1C=asn1c
ASN1C_INCLUDE=/opt/local/share/asn1c
#ETPAN_IN=$(HOME)
#LIBGPGME=/opt/local/lib/libgpgme.11.dylib
# To use custom build configuration variables, put them in a new file at `build-config/<name>.conf`. Execute `export PLATFORM_OVERRIDE=<name>` before running make. If this environment variable is not set, make will load a default configuration for your platform.
# C makros (not environment variables) to overwrite:
#
# DEFAULT_KEYSERVER - string with default keyserver
# CRASHDUMP_DEFAULT_LINES - number of log lines to deliver for crashdumps
BUILD_CONFIG=build-config
#EXTRAMACROS=-DDEFAULT_KEYSERVER=\"default-server.org\" -DCRASHDUMP_DEFAULT_LINES=23
# second instance for testing
#EXTRAMACROS=-DLOCAL_DB_FILENAME=\".pEp_management2.db\"
#TARGET=libpEpEngine2.dylib
include $(BUILD_CONFIG)/common.conf
ifdef PLATFORM_OVERRIDE
include $(BUILD_CONFIG)/$(PLATFORM_OVERRIDE).conf
# cross-compiling is currently not supported, but maybe you can hack something with `PLATFORM_OVERRIDE`
else ifeq ($(BUILD_ON),$(BUILD_FOR))
include $(BUILD_CONFIG)/$(BUILD_ON).conf
else
$(error I don't know how to build for $(BUILD_FOR) on $(BUILD_ON))
endif

+ 27
- 0
build-config/Darwin.conf View File

@ -0,0 +1,27 @@
# Copyright 2017, pEp Security SA
# This file is part of pEpEngine
# This file may be used under the terms of the GNU General Public License version 3
# see LICENSE.txt
######### General #########
TARGET=libpEpEngine.dylib
######### C #########
CC=clang -std=c99 -pthread
######### C++ #########
CXX=clang -std=c++11
######### C and C++ #########
######### YML2 #########
######### asn1c #########
######### libetpan #########
######### OpenPGP #########
######### Engine internals #########
######### Misc #########

+ 27
- 0
build-config/Linux.conf View File

@ -0,0 +1,27 @@
# Copyright 2017, pEp Security SA
# This file is part of pEpEngine
# This file may be used under the terms of the GNU General Public License version 3
# see LICENSE.txt
######### General #########
TARGET=libpEpEngine.so
######### C #########
CC=gcc -std=c99
######### C++ #########
CXX=g++ -std=gnu++11 -pthread
######### C and C++ #########
######### YML2 #########
######### asn1c #########
######### libetpan #########
######### OpenPGP #########
######### Engine internals #########
######### Misc #########

+ 89
- 0
build-config/common.conf View File

@ -0,0 +1,89 @@
# Copyright 2017, pEp Security SA
# This file is part of pEpEngine
# This file may be used under the terms of the GNU General Public License version 3
# see LICENSE.txt
######### General #########
BUILD_ON:=$(shell uname)
BUILD_FOR=$(BUILD_ON)
# Installation path prefix for libraries and binaries, except for system.db
PREFIX=$(HOME)
# Installation path for system.db
SYSTEM_DB=/usr/local/share/pEp/system.db
# Filename of the pEpEngine library
#TARGET This option is platform-specific
# If defined, create a debug build
DEBUG=
# If defined, print compiler warnings
WARN=
######### C #########
#CC This option is platform-specific
CPPFLAGS=
CFLAGS= -fPIC -fstrict-aliasing
ifdef WARN
CFLAGS+= -Wall -pedantic -Wstrict-aliasing=3
else
CFLAGS+= -w
endif
ifdef DEBUG
CFLAGS+= -O0 -g -DNDEBUG -DDEBUG_ERRORSTACK
else
CFLAGS+= -O3
endif
######### C++ #########
#CXX This option is platform-specific
CXXFLAGS=
ifdef WARN
CXXFLAGS+=
else
CXXFLAGS+= -w
endif
ifdef DEBUG
CXXFLAGS+= -O0 -g -DNDEBUG
else
CXXFLAGS+= -O3
endif
######### C and C++ #########
#LD=
######### YML2 #########
YML2_PATH=$(HOME)/yml2
YML2_PROC=$(YML2_PATH)/yml2proc
YML2_OPTS=--encoding=utf8
######### asn1c #########
# asn1c binary path
ASN1C=asn1c
ASN1C_INCLUDE=/usr/include
######### libetpan #########
# libetpan distribution path
ETPAN_IN=$(HOME)
######### OpenPGP #########
# Selects OpenPGP implementation. must be either `GPG` or `NETPGP`
OPENPGP=GPG
# Path of libGPGME binary
#LIBGPGME=/opt/local/lib/libgpgme.11.dylib
# Path of GPG binary
GPG_CMD=gpg
ifneq ($(shell which gpg2),)
GPG_CMD = gpg2
endif
######### Engine internals #########
# C macros (not environment variables) that can be overridden:
# DEFAULT_KEYSERVER - string with default keyserver
# CRASHDUMP_DEFAULT_LINES - number of log lines to deliver for crashdumps
# Example:
# EXTRAMACROS= -DDEFAULT_KEYSERVER=\"default-server.org\" -DCRASHDUMP_DEFAULT_LINES=23
EXTRAMACROS=
######### Misc #########
# Maybe include these variables here. Check how they are used throughout the project before setting them here
#LDFLAGS=
#LDLIBS=
#LLDB_BIN

Loading…
Cancel
Save