Merge ENGINE-261
authorDamiano Boppart <damiano@pep-security.net>
Thu, 26 Oct 2017 17:32:18 +0200
changeset 2215872b9aa07656
parent 2207 5a57a595349e
parent 2214 37627cafddbb
child 2216 ef23982e4744
Merge ENGINE-261
     1.1 --- a/Makefile	Thu Oct 26 15:54:03 2017 +0200
     1.2 +++ b/Makefile	Thu Oct 26 17:32:18 2017 +0200
     1.3 @@ -5,10 +5,22 @@
     1.4  
     1.5  HERE_REL := $(notdir $(CURDIR))
     1.6  
     1.7 -include Makefile.conf
     1.8 +include default.conf
     1.9 +
    1.10 +ifneq ($(wildcard local.conf),)
    1.11 +    $(info ================================================)
    1.12 +    $(info Overrides in \`local.conf\` are used.)
    1.13 +    $(info ================================================)
    1.14 +endif
    1.15 +
    1.16 +ifdef BUILD_CONFIG
    1.17 +    $(info ================================================)
    1.18 +    $(info Overrides in \`$(BUILD_CONFIG)\` are used.)
    1.19 +    $(info ================================================)
    1.20 +endif
    1.21  
    1.22  .PHONY: all
    1.23 -all: _override_info
    1.24 +all:
    1.25  	$(MAKE) -C asn.1 generate
    1.26  	$(MAKE) -C asn.1
    1.27  	$(MAKE) -C sync
    1.28 @@ -20,12 +32,12 @@
    1.29  	$(MAKE) -C asn.1 install
    1.30  
    1.31  .PHONY: uninstall
    1.32 -uninstall: _override_info
    1.33 +uninstall:
    1.34  	$(MAKE) -C src uninstall
    1.35  	$(MAKE) -C asn.1 uninstall
    1.36  
    1.37  .PHONY: clean
    1.38 -clean: _override_info
    1.39 +clean:
    1.40  	$(MAKE) -C src clean
    1.41  	$(MAKE) -C test clean
    1.42  	$(MAKE) -C db clean
    1.43 @@ -46,24 +58,5 @@
    1.44  	cd .. ; COPYFILE_DISABLE=true tar cjf pEpEngine.tar.bz2 "$(HERE_REL)"
    1.45  
    1.46  .PHONY: db
    1.47 -db: _override_info
    1.48 +db:
    1.49  	$(MAKE) -C db db
    1.50 -
    1.51 -.PHONY: _override_info
    1.52 -_override_info: _local_conf_info _build_config_info
    1.53 -
    1.54 -.PHONY: _local_conf_info
    1.55 -_local_conf_info:
    1.56 -ifneq ($(wildcard local.conf),)
    1.57 -	@echo "================================================"
    1.58 -	@echo "Overrides in \`local.conf\` are used."
    1.59 -	@echo "================================================"
    1.60 -endif
    1.61 -
    1.62 -.PHONY: _build_config_info
    1.63 -_build_config_info:
    1.64 -ifdef BUILD_CONFIG
    1.65 -	@echo "================================================"
    1.66 -	@echo "Overrides in \`$(BUILD_CONFIG)\` are used."
    1.67 -	@echo "================================================"
    1.68 -endif
     2.1 --- a/Makefile.conf	Thu Oct 26 15:54:03 2017 +0200
     2.2 +++ b/Makefile.conf	Thu Oct 26 17:32:18 2017 +0200
     2.3 @@ -3,233 +3,107 @@
     2.4  # This file may be used under the terms of the GNU General Public License version 3
     2.5  # see LICENSE.txt
     2.6  
     2.7 -# This file gives an overview over all the parameters that can be easily customized for a build.
     2.8 -# There are three ways in which you can customize your build:
     2.9 -# 1) Edit the variable assignments in this file
    2.10 -# 2) Create `local.conf` and fill it with variable assignments.
    2.11 -#    These `local.conf` takes precedence over the assignments below.
    2.12 -# 3) Set the environment variable `BUILD_CONFIG` to an absolute path.
    2.13 -#    The variable assignments found at the path indicated by `BUILD_CONFIG` take precedence over the assignments below and the assignments in `local.conf`.
    2.14 -# If nothing is changed according to these 3 methods, a default configuration for your platform will be used for the build.
    2.15 -
    2.16 -HERE:=$(dir $(lastword $(MAKEFILE_LIST)))
    2.17  
    2.18  ######### General #########
    2.19  # To use (only) system libraries, set all the *_INC and *_LIB variables to the empty string.
    2.20  # All the *_INC and *_LIB variables are command line flags, not paths.
    2.21  # Thus, all *_INC variables' values must start with "-I", and all *_LIB variables' values must start with "-L".
    2.22  
    2.23 -BUILD_ON:=$(shell uname)
    2.24 +#BUILD_ON:=$(shell uname)
    2.25  
    2.26  # This variable specifies the platform that the engine should be cross-compiled for.
    2.27 -BUILD_FOR=$(BUILD_ON)
    2.28 -
    2.29 -# Cross-compiling is currently not supported.
    2.30 -# Maybe you can hack something with `local.conf`.
    2.31 -ifneq ($(BUILD_ON),$(BUILD_FOR))
    2.32 -    $(error I don't know how to build for $(BUILD_FOR) on $(BUILD_ON).)
    2.33 -endif
    2.34 +#BUILD_FOR=$(BUILD_ON)
    2.35  
    2.36  # Installation path prefix for libraries and binaries, except for system.db
    2.37 -PREFIX=$(HOME)
    2.38 +#PREFIX=$(HOME)
    2.39  
    2.40  # Installation path for system.db
    2.41 -SYSTEM_DB=/usr/local/share/pEp/system.db
    2.42 +#SYSTEM_DB=/usr/local/share/pEp/system.db
    2.43  
    2.44  # Filename of the pEpEngine library
    2.45 -ifeq ($(BUILD_FOR),Linux)
    2.46 -    TARGET=libpEpEngine.so
    2.47 -else ifeq ($(BUILD_FOR),Darwin)
    2.48 -    TARGET=libpEpEngine.dylib
    2.49 -endif
    2.50 -
    2.51 -# If empty, create a release build.
    2.52 -# Otherwise, create a debug build.
    2.53 -# This variable is ineffective in your local.conf file.
    2.54 -DEBUG=YES
    2.55 -
    2.56 -# If empty, suppress compiler warnings.
    2.57 -# Otherwise, print warnings.
    2.58 -# This variable is ineffective in your local.conf file.
    2.59 -WARN=placeholder
    2.60 +#TARGET=libpEpEngine.so
    2.61  
    2.62  
    2.63  ######### C and C++ #########
    2.64 -TARGET_ARCH=
    2.65 +#TARGET_ARCH=
    2.66 +
    2.67  # The following two variables will be appended to.
    2.68  # You can thus not set them to a fixed value here.
    2.69 -ifeq ($(BUILD_FOR),Linux)
    2.70 -    LDFLAGS=
    2.71 -else ifeq ($(BUILD_FOR),Darwin)
    2.72 -    # "-bind_at_load" helps find symbol resolution errors faster
    2.73 -    LDFLAGS=-bind_at_load
    2.74 -endif
    2.75 +#LDFLAGS=
    2.76  
    2.77 -LDLIBS=
    2.78 +#LDLIBS=
    2.79  
    2.80  
    2.81  ######### C #########
    2.82 -ifeq ($(BUILD_FOR),Linux)
    2.83 -    CC=gcc -std=c99 -pthread
    2.84 -else ifeq ($(BUILD_FOR),Darwin)
    2.85 -    # clang issues a warning when "-pthread" is used for linking.
    2.86 -    # So, include it in CFLAGS, and not in CC
    2.87 -    CC=clang -std=c99
    2.88 -endif
    2.89 +#CC=
    2.90  
    2.91 -ifeq ($(BUILD_FOR),Linux)
    2.92 -    CFLAGS=-fPIC -fstrict-aliasing -fdiagnostics-color=always
    2.93 -else ifeq ($(BUILD_FOR),Darwin)
    2.94 -    CFLAGS=-pthread -fPIC -fstrict-aliasing -fcolor-diagnostics
    2.95 -endif
    2.96 +#CFLAGS=-fPIC -fstrict-aliasing -fdiagnostics-color=always
    2.97  
    2.98 -CPPFLAGS=
    2.99 +#CPPFLAGS=
   2.100  
   2.101 -# The flag -DNDEBUG will always be removed from CFLAGS for compiling tests.
   2.102 -# The tests do not work properly, if compiled with -DNDEBUG
   2.103 -ifeq ($(BUILD_FOR),Linux)
   2.104 -    ifdef WARN
   2.105 -        CFLAGS+= -Wall -pedantic -Wstrict-aliasing=3
   2.106 -    else
   2.107 -        CFLAGS+= -w
   2.108 -    endif
   2.109 -    ifdef DEBUG
   2.110 -        CFLAGS+= -Og -ggdb -DDEBUG_ERRORSTACK
   2.111 -    else
   2.112 -        CFLAGS+= -O3 -DNDEBUG
   2.113 -    endif
   2.114 -else ifeq ($(BUILD_FOR),Darwin)
   2.115 -    ifdef WARN
   2.116 -        # FIXME Remove 'no-extended-offsetof' after ENGINE-236 is closed.
   2.117 -        CFLAGS+= -Wall -pedantic -Wno-extended-offsetof
   2.118 -    else
   2.119 -        CFLAGS+= -w
   2.120 -    endif
   2.121 -    ifdef DEBUG
   2.122 -        CFLAGS+= -O0 -g -DDEBUG_ERRORSTACK
   2.123 -    else
   2.124 -        CFLAGS+= -O3 -DNDEBUG
   2.125 -    endif
   2.126 -endif
   2.127 +#CFLAGS+= -w -O3 -DNDEBUG
   2.128  
   2.129  # Additional CFLAGS used for compiling ASN1C-generated code
   2.130 -ifeq ($(BUILD_FOR),Linux)
   2.131 -    # The '_DEFAULT_SOURCE' feature test macro is required to suppress the warning
   2.132 -    #   _BSD_SOURCE and _SVID_SOURCE are deprecated, use _DEFAULT_SOURCE
   2.133 -    # otherwise printed during the compilation of every asn1c-generated C file.
   2.134 -    # It's a glibc specific warning, only present in few versions around ~2.19.
   2.135 -    # See https://lwn.net/Articles/590381/ for a discussion.
   2.136 -    CFLAGS_GENERATED=-D_DEFAULT_SOURCE
   2.137 -else ifeq ($(BUILD_FOR),Darwin)
   2.138 -    CFLAGS_GENERATED=
   2.139 -endif
   2.140 +#CFLAGS_GENERATED=-D_DEFAULT_SOURCE
   2.141  
   2.142  
   2.143  ######### C++ #########
   2.144 -ifeq ($(BUILD_FOR),Linux)
   2.145 -    CXX=g++ -std=gnu++11 -pthread
   2.146 -else ifeq ($(BUILD_FOR),Darwin)
   2.147 -    # clang issues a warning when "-pthread" is used for linking. So, include it in CXXFLAGS, and not in CXX
   2.148 -    CXX=clang -std=c++11
   2.149 -endif
   2.150 +#CXX=g++ -std=gnu++11 -pthread
   2.151  
   2.152 -# The flag -DNDEBUG will always be removed from CXXFLAGS for compiling tests.
   2.153 -# The tests do not work properly, if compiled with -DNDEBUG
   2.154 -ifeq ($(BUILD_FOR),Linux)
   2.155 -    CXXFLAGS=-fdiagnostics-color=always -I../src -I../asn.1 $(ETPAN_INC)
   2.156 -    ifdef WARN
   2.157 -        CXXFLAGS+=
   2.158 -    else
   2.159 -        CXXFLAGS+= -w
   2.160 -    endif
   2.161 -    ifdef DEBUG
   2.162 -        CXXFLAGS+= -Og -ggdb
   2.163 -    else
   2.164 -        CXXFLAGS+= -O3 -DNDEBUG
   2.165 -    endif
   2.166 -else ifeq ($(BUILD_FOR),Darwin)
   2.167 -    CXXFLAGS=-pthread -fcolor-diagnostics -I../src -I../asn.1 $(ETPAN_INC)
   2.168 -    ifdef WARN
   2.169 -        CXXFLAGS+=
   2.170 -    else
   2.171 -        CXXFLAGS+= -w
   2.172 -    endif
   2.173 -    ifdef DEBUG
   2.174 -        CXXFLAGS+= -O0 -g
   2.175 -    else
   2.176 -        CXXFLAGS+= -O3 -DNDEBUG
   2.177 -    endif
   2.178 -endif
   2.179 +#CXXFLAGS=-fdiagnostics-color=always -I../src -I../asn.1 $(ETPAN_INC) -w -O3 -DNDEBUG
   2.180  
   2.181  
   2.182  ######### YML2 #########
   2.183 -YML2_PATH=$(HOME)/yml2
   2.184 +#YML2_PATH=$(HOME)/yml2
   2.185  
   2.186 -YML2_PROC=$(YML2_PATH)/yml2proc
   2.187 +#YML2_PROC=$(YML2_PATH)/yml2proc
   2.188  
   2.189 -YML2_OPTS=--encoding=utf8
   2.190 +#YML2_OPTS=--encoding=utf8
   2.191  
   2.192 -# YML_PATH is needed in the environment of every call to a program of the YML2 distribution
   2.193 -export YML_PATH=$(YML2_PATH)
   2.194  
   2.195  ######### asn1c #########
   2.196  # asn1c binary
   2.197 -ASN1C=asn1c
   2.198 +#ASN1C=asn1c
   2.199  
   2.200  # asn1c include search flag
   2.201 -ASN1C_INC=
   2.202  #ASN1C_INC=-I$(HOME)/include
   2.203  
   2.204  
   2.205  ######### libetpan #########
   2.206  # libetpan library search flag
   2.207 -ETPAN_LIB=-L$(PREFIX)/lib
   2.208 +#ETPAN_LIB=-L$(PREFIX)/lib
   2.209  
   2.210  # libetpan include search flag
   2.211 -ETPAN_INC=-I$(PREFIX)/include
   2.212 +#ETPAN_INC=-I$(PREFIX)/include
   2.213  
   2.214  
   2.215  ######### sqlite3 #########
   2.216  # If empty (or undefined), compile sqlite3 from the sources shipped with the pEp distribution.
   2.217  # Otherwise, use an sqlite3 implementation found in the OS's include/library paths.
   2.218 -SQLITE3_FROM_OS=placeholder
   2.219 +#SQLITE3_FROM_OS=placeholder
   2.220  
   2.221  
   2.222  ######### OpenPGP #########
   2.223  # Path of GPG binary
   2.224  # gpgconf is not available for old version of GPG, for example GPG 2.0.30. Override this variable, if you compile the engine for such an old version.
   2.225 -GPG_CMD:=$(shell gpgconf --list-components | awk -F: '/^gpg:/ { print $$3; exit 0; }')
   2.226 +#GPG_CMD:=$(shell gpgconf --list-components | awk -F: '/^gpg:/ { print $$3; exit 0; }')
   2.227  
   2.228  # Selects OpenPGP implementation. must be either `GPG` or `NETPGP`
   2.229 -OPENPGP=GPG
   2.230 +#OPENPGP=GPG
   2.231  
   2.232  # Path of libGPGME binary
   2.233 -ifeq ($(BUILD_FOR),Linux)
   2.234 -    LIBGPGME=libgpgme.so.11
   2.235 -else ifeq ($(BUILD_FOR),Darwin)
   2.236 -    LIBGPGME=libgpgme.dylib
   2.237 -endif
   2.238 +#LIBGPGME=libgpgme.so.11
   2.239  
   2.240  # libGPGME library search flag
   2.241 -ifeq ($(BUILD_FOR),Linux)
   2.242 -    GPGME_LIB=
   2.243 -else ifeq ($(BUILD_FOR),Darwin)
   2.244 -    GPGME_LIB=-L$(HOME)/lib
   2.245 -endif
   2.246 +#GPGME_LIB=
   2.247  
   2.248  # libGPGME include search flag
   2.249 -ifeq ($(BUILD_FOR),Linux)
   2.250 -    GPGME_INC=
   2.251 -else ifeq ($(BUILD_FOR),Darwin)
   2.252 -    GPGME_INC=-I$(HOME)/include
   2.253 -endif
   2.254 +#GPGME_INC=
   2.255  
   2.256  # NETPGP library search flag
   2.257 -NETPGP_LIB=
   2.258  #NETPGP_LIB=-L$(PREFIX)/lib
   2.259  
   2.260  # libGPGME include search flag
   2.261 -NETPGP_INC=
   2.262  #NETPGP_INC=-I$(PREFIX)/include
   2.263  
   2.264  
   2.265 @@ -239,17 +113,4 @@
   2.266  # CRASHDUMP_DEFAULT_LINES - number of log lines to deliver for crashdumps
   2.267  # Example:
   2.268  #    EXTRA_MACROS=-DDEFAULT_KEYSERVER=\"default-server.org\" -DCRASHDUMP_DEFAULT_LINES=23
   2.269 -EXTRA_MACROS=
   2.270 -
   2.271 -
   2.272 -######### Misc #########
   2.273 -# FIXME Maybe include these variables here.
   2.274 -# Check how they are used throughout the project before setting them here
   2.275 -#LLDB_BIN
   2.276 -
   2.277 -
   2.278 --include $(HERE)/local.conf
   2.279 -
   2.280 -ifdef BUILD_CONFIG
   2.281 -    -include $(BUILD_CONFIG)
   2.282 -endif
   2.283 +#EXTRA_MACROS=
     3.1 --- a/asn.1/Makefile	Thu Oct 26 15:54:03 2017 +0200
     3.2 +++ b/asn.1/Makefile	Thu Oct 26 17:32:18 2017 +0200
     3.3 @@ -3,7 +3,7 @@
     3.4  # This file may be used under the terms of the GNU General Public License version 3
     3.5  # see LICENSE.txt
     3.6  
     3.7 -include ../Makefile.conf
     3.8 +include ../default.conf
     3.9  
    3.10  ALL_SOURCE=$(wildcard *.c)
    3.11  ALL_OBJECTS=$(subst .c,.o,$(ALL_SOURCE))
     4.1 --- a/db/Makefile	Thu Oct 26 15:54:03 2017 +0200
     4.2 +++ b/db/Makefile	Thu Oct 26 17:32:18 2017 +0200
     4.3 @@ -3,7 +3,7 @@
     4.4  # This file may be used under the terms of the GNU General Public License version 3
     4.5  # see LICENSE.txt
     4.6  
     4.7 -include ../Makefile.conf
     4.8 +include ../default.conf
     4.9  
    4.10  .PHONY: db
    4.11  db: system.db
     5.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     5.2 +++ b/default.conf	Thu Oct 26 17:32:18 2017 +0200
     5.3 @@ -0,0 +1,264 @@
     5.4 +# Copyright 2017, pEp Foundation
     5.5 +# This file is part of pEpEngine
     5.6 +# This file may be used under the terms of the GNU General Public License version 3
     5.7 +# see LICENSE.txt
     5.8 +
     5.9 +# This file sets all the make variables that allow you to customize a build.
    5.10 +# There are 4 ways in which you can customize your build:
    5.11 +# 1) Edit the variable assignments in this file (this is a tracked file, so your repository will be dirty)
    5.12 +# 2) Edit the variable assignments in `Makefile.conf` (which is a tracked file, so your repository will be dirty)
    5.13 +# 3) Create `local.conf` and fill it with variable assignments.
    5.14 +# 4) Set the environment variable `BUILD_CONFIG` to an absolute path.
    5.15 +#    The variable assignments found in the make file at the path indicated by `BUILD_CONFIG` will be evaluated.
    5.16 +# Customization options are applied in the order given above. Later variable assignments take precedence over earlier ones.
    5.17 +# It is possible to use multiple variants simultaniously.
    5.18 +# If nothing is changed according to these 4 methods, a default configuration for your platform (specified below) will be used for the build.
    5.19 +
    5.20 +
    5.21 +######### Header #########
    5.22 +HERE:=$(dir $(lastword $(MAKEFILE_LIST)))
    5.23 +
    5.24 +
    5.25 +######### General #########
    5.26 +# To use (only) system libraries, set all the *_INC and *_LIB variables to the empty string.
    5.27 +# All the *_INC and *_LIB variables are command line flags, not paths.
    5.28 +# Thus, all *_INC variables' values must start with "-I", and all *_LIB variables' values must start with "-L".
    5.29 +
    5.30 +BUILD_ON:=$(shell uname)
    5.31 +
    5.32 +# This variable specifies the platform that the engine should be cross-compiled for.
    5.33 +BUILD_FOR=$(BUILD_ON)
    5.34 +
    5.35 +# Cross-compiling is currently not supported.
    5.36 +# Maybe you can hack something with `local.conf`.
    5.37 +ifneq ($(BUILD_ON),$(BUILD_FOR))
    5.38 +    $(error I don't know how to build for $(BUILD_FOR) on $(BUILD_ON).)
    5.39 +endif
    5.40 +
    5.41 +# Installation path prefix for libraries and binaries, except for system.db
    5.42 +PREFIX=$(HOME)
    5.43 +
    5.44 +# Installation path for system.db
    5.45 +SYSTEM_DB=/usr/local/share/pEp/system.db
    5.46 +
    5.47 +# Filename of the pEpEngine library
    5.48 +ifeq ($(BUILD_FOR),Linux)
    5.49 +    TARGET=libpEpEngine.so
    5.50 +else ifeq ($(BUILD_FOR),Darwin)
    5.51 +    TARGET=libpEpEngine.dylib
    5.52 +endif
    5.53 +
    5.54 +# If empty, create a release build.
    5.55 +# Otherwise, create a debug build.
    5.56 +# This variable is ineffective in your local.conf file.
    5.57 +DEBUG=YES
    5.58 +
    5.59 +# If empty, suppress compiler warnings.
    5.60 +# Otherwise, print warnings.
    5.61 +# This variable is ineffective in your local.conf file.
    5.62 +WARN=placeholder
    5.63 +
    5.64 +
    5.65 +######### C and C++ #########
    5.66 +TARGET_ARCH=
    5.67 +# The following two variables will be appended to.
    5.68 +# You can thus not set them to a fixed value here.
    5.69 +ifeq ($(BUILD_FOR),Linux)
    5.70 +    LDFLAGS=
    5.71 +else ifeq ($(BUILD_FOR),Darwin)
    5.72 +    # "-bind_at_load" helps find symbol resolution errors faster
    5.73 +    LDFLAGS=-bind_at_load
    5.74 +endif
    5.75 +
    5.76 +LDLIBS=
    5.77 +
    5.78 +
    5.79 +######### C #########
    5.80 +ifeq ($(BUILD_FOR),Linux)
    5.81 +    CC=gcc -std=c99 -pthread
    5.82 +else ifeq ($(BUILD_FOR),Darwin)
    5.83 +    # clang issues a warning when "-pthread" is used for linking.
    5.84 +    # So, include it in CFLAGS, and not in CC
    5.85 +    CC=clang -std=c99
    5.86 +endif
    5.87 +
    5.88 +ifeq ($(BUILD_FOR),Linux)
    5.89 +    CFLAGS=-fPIC -fstrict-aliasing -fdiagnostics-color=always
    5.90 +else ifeq ($(BUILD_FOR),Darwin)
    5.91 +    CFLAGS=-pthread -fPIC -fstrict-aliasing -fcolor-diagnostics
    5.92 +endif
    5.93 +
    5.94 +CPPFLAGS=
    5.95 +
    5.96 +# The flag -DNDEBUG will always be removed from CFLAGS for compiling tests.
    5.97 +# The tests do not work properly, if compiled with -DNDEBUG
    5.98 +ifeq ($(BUILD_FOR),Linux)
    5.99 +    ifdef WARN
   5.100 +        CFLAGS+= -Wall -pedantic -Wstrict-aliasing=3
   5.101 +    else
   5.102 +        CFLAGS+= -w
   5.103 +    endif
   5.104 +    ifdef DEBUG
   5.105 +        CFLAGS+= -Og -ggdb -DDEBUG_ERRORSTACK
   5.106 +    else
   5.107 +        CFLAGS+= -O3 -DNDEBUG
   5.108 +    endif
   5.109 +else ifeq ($(BUILD_FOR),Darwin)
   5.110 +    ifdef WARN
   5.111 +        # FIXME Remove 'no-extended-offsetof' after ENGINE-236 is closed.
   5.112 +        CFLAGS+= -Wall -pedantic -Wno-extended-offsetof
   5.113 +    else
   5.114 +        CFLAGS+= -w
   5.115 +    endif
   5.116 +    ifdef DEBUG
   5.117 +        CFLAGS+= -O0 -g -DDEBUG_ERRORSTACK
   5.118 +    else
   5.119 +        CFLAGS+= -O3 -DNDEBUG
   5.120 +    endif
   5.121 +endif
   5.122 +
   5.123 +# Additional CFLAGS used for compiling ASN1C-generated code
   5.124 +ifeq ($(BUILD_FOR),Linux)
   5.125 +    # The '_DEFAULT_SOURCE' feature test macro is required to suppress the warning
   5.126 +    #   _BSD_SOURCE and _SVID_SOURCE are deprecated, use _DEFAULT_SOURCE
   5.127 +    # otherwise printed during the compilation of every asn1c-generated C file.
   5.128 +    # It's a glibc specific warning, only present in few versions around ~2.19.
   5.129 +    # See https://lwn.net/Articles/590381/ for a discussion.
   5.130 +    CFLAGS_GENERATED=-D_DEFAULT_SOURCE
   5.131 +else ifeq ($(BUILD_FOR),Darwin)
   5.132 +    CFLAGS_GENERATED=
   5.133 +endif
   5.134 +
   5.135 +
   5.136 +######### C++ #########
   5.137 +ifeq ($(BUILD_FOR),Linux)
   5.138 +    CXX=g++ -std=gnu++11 -pthread
   5.139 +else ifeq ($(BUILD_FOR),Darwin)
   5.140 +    # clang issues a warning when "-pthread" is used for linking. So, include it in CXXFLAGS, and not in CXX
   5.141 +    CXX=clang -std=c++11
   5.142 +endif
   5.143 +
   5.144 +# The flag -DNDEBUG will always be removed from CXXFLAGS for compiling tests.
   5.145 +# The tests do not work properly, if compiled with -DNDEBUG
   5.146 +ifeq ($(BUILD_FOR),Linux)
   5.147 +    CXXFLAGS=-fdiagnostics-color=always -I../src -I../asn.1 $(ETPAN_INC)
   5.148 +    ifdef WARN
   5.149 +        CXXFLAGS+=
   5.150 +    else
   5.151 +        CXXFLAGS+= -w
   5.152 +    endif
   5.153 +    ifdef DEBUG
   5.154 +        CXXFLAGS+= -Og -ggdb
   5.155 +    else
   5.156 +        CXXFLAGS+= -O3 -DNDEBUG
   5.157 +    endif
   5.158 +else ifeq ($(BUILD_FOR),Darwin)
   5.159 +    CXXFLAGS=-pthread -fcolor-diagnostics -I../src -I../asn.1 $(ETPAN_INC)
   5.160 +    ifdef WARN
   5.161 +        CXXFLAGS+=
   5.162 +    else
   5.163 +        CXXFLAGS+= -w
   5.164 +    endif
   5.165 +    ifdef DEBUG
   5.166 +        CXXFLAGS+= -O0 -g
   5.167 +    else
   5.168 +        CXXFLAGS+= -O3 -DNDEBUG
   5.169 +    endif
   5.170 +endif
   5.171 +
   5.172 +
   5.173 +######### YML2 #########
   5.174 +YML2_PATH=$(HOME)/yml2
   5.175 +
   5.176 +YML2_PROC=$(YML2_PATH)/yml2proc
   5.177 +
   5.178 +YML2_OPTS=--encoding=utf8
   5.179 +
   5.180 +
   5.181 +######### asn1c #########
   5.182 +# asn1c binary
   5.183 +ASN1C=asn1c
   5.184 +
   5.185 +# asn1c include search flag
   5.186 +ASN1C_INC=
   5.187 +#ASN1C_INC=-I$(HOME)/include
   5.188 +
   5.189 +
   5.190 +######### libetpan #########
   5.191 +# libetpan library search flag
   5.192 +ETPAN_LIB=-L$(PREFIX)/lib
   5.193 +
   5.194 +# libetpan include search flag
   5.195 +ETPAN_INC=-I$(PREFIX)/include
   5.196 +
   5.197 +
   5.198 +######### sqlite3 #########
   5.199 +# If empty (or undefined), compile sqlite3 from the sources shipped with the pEp distribution.
   5.200 +# Otherwise, use an sqlite3 implementation found in the OS's include/library paths.
   5.201 +SQLITE3_FROM_OS=placeholder
   5.202 +
   5.203 +
   5.204 +######### OpenPGP #########
   5.205 +# Path of GPG binary
   5.206 +# gpgconf is not available for old version of GPG, for example GPG 2.0.30. Override this variable, if you compile the engine for such an old version.
   5.207 +GPG_CMD:=$(shell gpgconf --list-components | awk -F: '/^gpg:/ { print $$3; exit 0; }')
   5.208 +
   5.209 +# Selects OpenPGP implementation. must be either `GPG` or `NETPGP`
   5.210 +OPENPGP=GPG
   5.211 +
   5.212 +# Path of libGPGME binary
   5.213 +ifeq ($(BUILD_FOR),Linux)
   5.214 +    LIBGPGME=libgpgme.so.11
   5.215 +else ifeq ($(BUILD_FOR),Darwin)
   5.216 +    LIBGPGME=libgpgme.dylib
   5.217 +endif
   5.218 +
   5.219 +# libGPGME library search flag
   5.220 +ifeq ($(BUILD_FOR),Linux)
   5.221 +    GPGME_LIB=
   5.222 +else ifeq ($(BUILD_FOR),Darwin)
   5.223 +    GPGME_LIB=-L$(HOME)/lib
   5.224 +endif
   5.225 +
   5.226 +# libGPGME include search flag
   5.227 +ifeq ($(BUILD_FOR),Linux)
   5.228 +    GPGME_INC=
   5.229 +else ifeq ($(BUILD_FOR),Darwin)
   5.230 +    GPGME_INC=-I$(HOME)/include
   5.231 +endif
   5.232 +
   5.233 +# NETPGP library search flag
   5.234 +NETPGP_LIB=
   5.235 +#NETPGP_LIB=-L$(PREFIX)/lib
   5.236 +
   5.237 +# libGPGME include search flag
   5.238 +NETPGP_INC=
   5.239 +#NETPGP_INC=-I$(PREFIX)/include
   5.240 +
   5.241 +
   5.242 +######### Engine internals #########
   5.243 +# C macros (not environment variables) that can be overridden:
   5.244 +# DEFAULT_KEYSERVER - string with default keyserver
   5.245 +# CRASHDUMP_DEFAULT_LINES - number of log lines to deliver for crashdumps
   5.246 +# Example:
   5.247 +#    EXTRA_MACROS=-DDEFAULT_KEYSERVER=\"default-server.org\" -DCRASHDUMP_DEFAULT_LINES=23
   5.248 +EXTRA_MACROS=
   5.249 +
   5.250 +
   5.251 +######### Misc #########
   5.252 +# FIXME Maybe include these variables here.
   5.253 +# Check how they are used throughout the project before setting them here
   5.254 +#LLDB_BIN
   5.255 +
   5.256 +
   5.257 +######### Footer #########
   5.258 +include $(HERE)/Makefile.conf
   5.259 +
   5.260 +-include $(HERE)/local.conf
   5.261 +
   5.262 +ifdef BUILD_CONFIG
   5.263 +    include $(BUILD_CONFIG)
   5.264 +endif
   5.265 +
   5.266 +# YML_PATH is needed in the environment of every call to a program of the YML2 distribution
   5.267 +export YML_PATH=$(YML2_PATH)
     6.1 --- a/doc/build-debian.md	Thu Oct 26 15:54:03 2017 +0200
     6.2 +++ b/doc/build-debian.md	Thu Oct 26 17:32:18 2017 +0200
     6.3 @@ -66,6 +66,8 @@
     6.4  
     6.5  Note: Everything PLATFORM_OVERRIDE-related is currenty outdated. Do not rely on the documentation here!
     6.6  
     6.7 +Note: Everything Makefile.conf-related is currenty outdated. Do not rely on the documentation here!
     6.8 +
     6.9  For an explanation of the mechanics of `PLATFORM_OVERRIDE`, see the inline comments in `Makefile.conf`.
    6.10  In this guide, the platform-specific configuration will be called `local`.
    6.11  The installation directory will be a subdirectory of the repository.
     7.1 --- a/doc/build-macos.md	Thu Oct 26 15:54:03 2017 +0200
     7.2 +++ b/doc/build-macos.md	Thu Oct 26 17:32:18 2017 +0200
     7.3 @@ -78,6 +78,8 @@
     7.4  
     7.5  Note: Everything PLATFORM_OVERRIDE-related is currenty outdated. Do not rely on the documentation here!
     7.6  
     7.7 +Note: Everything Makefile.conf-related is currenty outdated. Do not rely on the documentation here!
     7.8 +
     7.9  For an explanation of the mechanics of `PLATFORM_OVERRIDE`, see the inline comments in `Makefile.conf`.
    7.10  In this guide, the platform-specific configuration will be called `local`.
    7.11  The installation directory will be a subdirectory of the repository.
     8.1 --- a/src/Makefile	Thu Oct 26 15:54:03 2017 +0200
     8.2 +++ b/src/Makefile	Thu Oct 26 17:32:18 2017 +0200
     8.3 @@ -3,7 +3,7 @@
     8.4  # This file may be used under the terms of the GNU General Public License version 3
     8.5  # see LICENSE.txt
     8.6  
     8.7 -include ../Makefile.conf
     8.8 +include ../default.conf
     8.9  
    8.10  CFLAGS+= $(ETPAN_INC) -I../asn.1 -DSYSTEM_DB=\"$(SYSTEM_DB)\" $(EXTRA_MACROS)
    8.11  LDFLAGS+= $(ETPAN_LIB) -L../asn.1 -shared
     9.1 --- a/sync/Makefile	Thu Oct 26 15:54:03 2017 +0200
     9.2 +++ b/sync/Makefile	Thu Oct 26 17:32:18 2017 +0200
     9.3 @@ -3,7 +3,7 @@
     9.4  # This file may be used under the terms of the GNU General Public License version 3
     9.5  # see LICENSE.txt
     9.6  
     9.7 -include ../Makefile.conf
     9.8 +include ../default.conf
     9.9  
    9.10  .PHONY: all
    9.11  all: .codegen
    10.1 --- a/test/Makefile	Thu Oct 26 15:54:03 2017 +0200
    10.2 +++ b/test/Makefile	Thu Oct 26 17:32:18 2017 +0200
    10.3 @@ -5,7 +5,7 @@
    10.4  
    10.5  HERE:=$(CURDIR)
    10.6  
    10.7 -include ../Makefile.conf
    10.8 +include ../default.conf
    10.9  
   10.10  TARGET=pEpEngineTest
   10.11