Clean up some Make issues introduced with merge make-cleanup
authorDamiano Boppart <damiano.boppart@pep.security>
Wed, 23 Jan 2019 15:29:54 +0100
branchmake-cleanup
changeset 3236efb3aff10882
parent 3235 7633eeee2cd4
child 3237 574cba8e448f
Clean up some Make issues introduced with merge
Makefile.conf
default.conf
test/Makefile
     1.1 --- a/Makefile.conf	Wed Jan 23 11:59:43 2019 +0100
     1.2 +++ b/Makefile.conf	Wed Jan 23 15:29:54 2019 +0100
     1.3 @@ -212,6 +212,12 @@
     1.4  # Selects OpenPGP implementation. must be either `GPG` or `NETPGP`
     1.5  OPENPGP=GPG
     1.6  
     1.7 +# Sequoia-specific variables
     1.8 +SEQUOIA_CFLAGS:=$(shell pkg-config --cflags-only-other sequoia)
     1.9 +SEQUOIA_LDFLAGS:=$(shell pkg-config --libs-only-L --libs-only-other sequoia)
    1.10 +SEQUOIA_LIB:=$(shell pkg-config --libs-only-l sequoia)
    1.11 +SEQUOIA_INC:=$(shell pkg-config --cflags-only-I sequoia)
    1.12 +
    1.13  # libGPGME filename
    1.14  ifeq ($(OPENPGP),GPG)
    1.15      ifeq ($(BUILD_FOR),Linux)
     2.1 --- a/default.conf	Wed Jan 23 11:59:43 2019 +0100
     2.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.3 @@ -1,280 +0,0 @@
     2.4 -# Copyright 2017, pEp Foundation
     2.5 -# This file is part of pEpEngine
     2.6 -# This file may be used under the terms of the GNU General Public License version 3
     2.7 -# see LICENSE.txt
     2.8 -
     2.9 -# See `doc/build-<your platform>.md` for documentation on how to build, and customize your build.
    2.10 -
    2.11 -# This file sets all the make variables that allow you to customize a build.
    2.12 -# There are 4 ways in which you can customize your build:
    2.13 -# 1) Edit the variable assignments in this file (this is a tracked file, so your repository will be dirty)
    2.14 -# 2) Edit the variable assignments in `Makefile.conf` (which is a tracked file, so your repository will be dirty)
    2.15 -# 3) Create `local.conf` and fill it with variable assignments.
    2.16 -# 4) Set the environment variable `BUILD_CONFIG` to an absolute path.
    2.17 -#    The variable assignments found in the make file at the path indicated by `BUILD_CONFIG` will be evaluated.
    2.18 -# Customization options are applied in the order given above. Later variable assignments take precedence over earlier ones.
    2.19 -# It is possible to use multiple variants simultaniously.
    2.20 -# If nothing is changed according to these 4 methods, a default configuration for your platform (specified below) will be used for the build.
    2.21 -
    2.22 -
    2.23 -######### Header #########
    2.24 -HERE:=$(dir $(lastword $(MAKEFILE_LIST)))
    2.25 -
    2.26 -
    2.27 -######### General #########
    2.28 -# To use (only) system libraries, set all the *_INC and *_LIB variables to the empty string.
    2.29 -# All the *_INC and *_LIB variables are command line flags, not paths.
    2.30 -# Thus, all *_INC variables' values must start with "-I", and all *_LIB variables' values must start with "-L".
    2.31 -
    2.32 -BUILD_ON:=$(shell uname)
    2.33 -
    2.34 -# This variable specifies the platform that the engine should be cross-compiled for.
    2.35 -BUILD_FOR=$(BUILD_ON)
    2.36 -
    2.37 -# Cross-compiling is currently not supported.
    2.38 -# Maybe you can hack something with `local.conf`.
    2.39 -ifneq ($(BUILD_ON),$(BUILD_FOR))
    2.40 -    $(error I don't know how to build for $(BUILD_FOR) on $(BUILD_ON).)
    2.41 -endif
    2.42 -
    2.43 -# Installation path prefix for libraries and binaries, except for system.db
    2.44 -PREFIX=$(HOME)
    2.45 -
    2.46 -# Installation path for system.db
    2.47 -SYSTEM_DB=/usr/local/share/pEp/system.db
    2.48 -
    2.49 -# Filename of the pEpEngine library
    2.50 -ifeq ($(BUILD_FOR),Linux)
    2.51 -    TARGET=libpEpEngine.so
    2.52 -else ifeq ($(BUILD_FOR),Darwin)
    2.53 -    TARGET=libpEpEngine.dylib
    2.54 -endif
    2.55 -
    2.56 -# If empty, create a release build.
    2.57 -# Otherwise, create a debug build.
    2.58 -# This variable is ineffective in your local.conf file.
    2.59 -DEBUG=placeholder
    2.60 -
    2.61 -# If empty, suppress compiler warnings.
    2.62 -# Otherwise, print warnings.
    2.63 -# This variable is ineffective in your local.conf file.
    2.64 -WARN=placeholder
    2.65 -
    2.66 -
    2.67 -######### C and C++ #########
    2.68 -TARGET_ARCH=
    2.69 -# The following two variables will be appended to.
    2.70 -# You can thus not set them to a fixed value here.
    2.71 -ifeq ($(BUILD_FOR),Linux)
    2.72 -    LDFLAGS=
    2.73 -else ifeq ($(BUILD_FOR),Darwin)
    2.74 -    # "-bind_at_load" helps find symbol resolution errors faster
    2.75 -    LDFLAGS=-bind_at_load
    2.76 -endif
    2.77 -
    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 -
    2.90 -ifeq ($(BUILD_FOR),Linux)
    2.91 -    CFLAGS=-fPIC -fstrict-aliasing -fdiagnostics-color=always
    2.92 -else ifeq ($(BUILD_FOR),Darwin)
    2.93 -    CFLAGS=-pthread -fPIC -fstrict-aliasing -fcolor-diagnostics
    2.94 -endif
    2.95 -
    2.96 -CPPFLAGS=
    2.97 -
    2.98 -# The flag -DNDEBUG will always be removed from CFLAGS for compiling tests.
    2.99 -# The tests do not work properly, if compiled with -DNDEBUG
   2.100 -ifeq ($(BUILD_FOR),Linux)
   2.101 -    ifdef WARN
   2.102 -        CFLAGS+= -Wall -pedantic -Wstrict-aliasing=3
   2.103 -    else
   2.104 -        CFLAGS+= -w
   2.105 -    endif
   2.106 -    ifdef DEBUG
   2.107 -        CFLAGS+= -g -ggdb -DDEBUG_ERRORSTACK
   2.108 -    else
   2.109 -        CFLAGS+= -O3 -DNDEBUG
   2.110 -    endif
   2.111 -else ifeq ($(BUILD_FOR),Darwin)
   2.112 -    ifdef WARN
   2.113 -        # FIXME Remove 'no-extended-offsetof' after ENGINE-236 is closed.
   2.114 -        CFLAGS+= -Wall -pedantic -Wno-extended-offsetof
   2.115 -    else
   2.116 -        CFLAGS+= -w
   2.117 -    endif
   2.118 -    ifdef DEBUG
   2.119 -        CFLAGS+= -O0 -g -DDEBUG_ERRORSTACK
   2.120 -    else
   2.121 -        CFLAGS+= -O3 -DNDEBUG
   2.122 -    endif
   2.123 -endif
   2.124 -
   2.125 -# Additional CFLAGS used for compiling ASN1C-generated code
   2.126 -ifeq ($(BUILD_FOR),Linux)
   2.127 -    # The '_DEFAULT_SOURCE' feature test macro is required to suppress the warning
   2.128 -    #   _BSD_SOURCE and _SVID_SOURCE are deprecated, use _DEFAULT_SOURCE
   2.129 -    # otherwise printed during the compilation of every asn1c-generated C file.
   2.130 -    # It's a glibc specific warning, only present in few versions around ~2.19.
   2.131 -    # See https://lwn.net/Articles/590381/ for a discussion.
   2.132 -    CFLAGS_GENERATED=-D_DEFAULT_SOURCE
   2.133 -else ifeq ($(BUILD_FOR),Darwin)
   2.134 -    CFLAGS_GENERATED=
   2.135 -endif
   2.136 -
   2.137 -
   2.138 -######### C++ #########
   2.139 -ifeq ($(BUILD_FOR),Linux)
   2.140 -    CXX=g++ -std=gnu++11 -pthread
   2.141 -else ifeq ($(BUILD_FOR),Darwin)
   2.142 -    # clang issues a warning when "-pthread" is used for linking. So, include it in CXXFLAGS, and not in CXX
   2.143 -    CXX=clang -std=c++11
   2.144 -endif
   2.145 -
   2.146 -# The flag -DNDEBUG will always be removed from CXXFLAGS for compiling tests.
   2.147 -# The tests do not work properly, if compiled with -DNDEBUG
   2.148 -ifeq ($(BUILD_FOR),Linux)
   2.149 -    CXXFLAGS=-fdiagnostics-color=always -I../src -I../asn.1 $(ETPAN_INC)
   2.150 -    ifdef WARN
   2.151 -        CXXFLAGS+=
   2.152 -    else
   2.153 -        CXXFLAGS+= -w
   2.154 -    endif
   2.155 -    ifdef DEBUG
   2.156 -        CXXFLAGS+= -g -ggdb
   2.157 -    else
   2.158 -        CXXFLAGS+= -O3 -DNDEBUG
   2.159 -    endif
   2.160 -else ifeq ($(BUILD_FOR),Darwin)
   2.161 -    CXXFLAGS=-pthread -fcolor-diagnostics -I../src -I../asn.1 $(ETPAN_INC)
   2.162 -    ifdef WARN
   2.163 -        CXXFLAGS+=
   2.164 -    else
   2.165 -        CXXFLAGS+= -w
   2.166 -    endif
   2.167 -    ifdef DEBUG
   2.168 -        CXXFLAGS+= -O0 -g
   2.169 -    else
   2.170 -        CXXFLAGS+= -O3 -DNDEBUG
   2.171 -    endif
   2.172 -endif
   2.173 -
   2.174 -
   2.175 -######### YML2 #########
   2.176 -YML2_PATH=$(HOME)/yml2
   2.177 -
   2.178 -YML2_PROC=$(YML2_PATH)/yml2proc
   2.179 -
   2.180 -YML2_OPTS=--encoding=utf8
   2.181 -
   2.182 -
   2.183 -######### asn1c #########
   2.184 -# asn1c binary
   2.185 -ASN1C=asn1c
   2.186 -
   2.187 -# asn1c include search flag
   2.188 -ASN1C_INC=-I$(PREFIX)/include
   2.189 -
   2.190 -
   2.191 -######### libetpan #########
   2.192 -# libetpan library search flag
   2.193 -ETPAN_LIB=-L$(PREFIX)/lib
   2.194 -
   2.195 -# libetpan include search flag
   2.196 -ETPAN_INC=-I$(PREFIX)/include
   2.197 -
   2.198 -
   2.199 -######### sqlite3 #########
   2.200 -# If empty (or undefined), compile sqlite3 from the sources shipped with the pEp distribution.
   2.201 -# Otherwise, use an sqlite3 implementation found in the OS's include/library paths.
   2.202 -SQLITE3_FROM_OS=placeholder
   2.203 -
   2.204 -
   2.205 -######### OpenPGP #########
   2.206 -# Path of GPG binary
   2.207 -# 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.208 -GPG_CMD:=$(shell gpgconf --list-components | awk -F: '/^gpg:/ { print $$3; exit 0; }')
   2.209 -
   2.210 -# Selects OpenPGP implementation. must be either `GPG` or `NETPGP` or `SEQUOIA`
   2.211 -OPENPGP=GPG
   2.212 -
   2.213 -# Path of libGPGME binary
   2.214 -ifeq ($(BUILD_FOR),Linux)
   2.215 -    LIBGPGME=libgpgme.so.11
   2.216 -else ifeq ($(BUILD_FOR),Darwin)
   2.217 -    LIBGPGME=libgpgme.11.dylib
   2.218 -endif
   2.219 -
   2.220 -# libGPGME library search flag
   2.221 -ifeq ($(BUILD_FOR),Linux)
   2.222 -    GPGME_LIB=
   2.223 -else ifeq ($(BUILD_FOR),Darwin)
   2.224 -    GPGME_LIB=-L$(HOME)/lib
   2.225 -endif
   2.226 -
   2.227 -# libGPGME include search flag
   2.228 -ifeq ($(BUILD_FOR),Linux)
   2.229 -    GPGME_INC=
   2.230 -else ifeq ($(BUILD_FOR),Darwin)
   2.231 -    GPGME_INC=-I$(HOME)/include
   2.232 -endif
   2.233 -
   2.234 -# NETPGP library search flag
   2.235 -NETPGP_LIB=
   2.236 -#NETPGP_LIB=-L$(PREFIX)/lib
   2.237 -
   2.238 -# libGPGME include search flag
   2.239 -NETPGP_INC=
   2.240 -#NETPGP_INC=-I$(PREFIX)/include
   2.241 -
   2.242 -SEQUOIA_CFLAGS=$(shell pkg-config --cflags-only-other sequoia)
   2.243 -SEQUOIA_LDFLAGS=$(shell pkg-config --libs-only-L --libs-only-other sequoia)
   2.244 -SEQUOIA_LIB=$(shell pkg-config --libs-only-l sequoia)
   2.245 -SEQUOIA_INC=$(shell pkg-config --cflags-only-I sequoia)
   2.246 -
   2.247 -
   2.248 -######### OpenPGP #########
   2.249 -# CppUnit library search flag
   2.250 -CPPUNIT_LIB=
   2.251 -#CPPUNIT_LIB=-L$(HOME)/local/lib
   2.252 -
   2.253 -# CppUnit include search flag
   2.254 -CPPUNIT_INC=
   2.255 -#CPPUNIT_INC=-I$(HOME)/local/inc
   2.256 -
   2.257 -
   2.258 -######### Engine internals #########
   2.259 -# C macros (not environment variables) that can be overridden:
   2.260 -# DEFAULT_KEYSERVER - string with default keyserver
   2.261 -# CRASHDUMP_DEFAULT_LINES - number of log lines to deliver for crashdumps
   2.262 -# Example:
   2.263 -#    EXTRA_MACROS=-DDEFAULT_KEYSERVER=\"default-server.org\" -DCRASHDUMP_DEFAULT_LINES=23
   2.264 -EXTRA_MACROS=
   2.265 -
   2.266 -
   2.267 -######### Misc #########
   2.268 -# FIXME Maybe include these variables here.
   2.269 -# Check how they are used throughout the project before setting them here
   2.270 -#LLDB_BIN
   2.271 -
   2.272 -
   2.273 -######### Footer #########
   2.274 -include $(HERE)/Makefile.conf
   2.275 -
   2.276 --include $(HERE)/local.conf
   2.277 -
   2.278 -ifdef BUILD_CONFIG
   2.279 -    include $(BUILD_CONFIG)
   2.280 -endif
   2.281 -
   2.282 -# YML_PATH is needed in the environment of every call to a program of the YML2 distribution
   2.283 -export YML_PATH=$(YML2_PATH)
     3.1 --- a/test/Makefile	Wed Jan 23 11:59:43 2019 +0100
     3.2 +++ b/test/Makefile	Wed Jan 23 15:29:54 2019 +0100
     3.3 @@ -35,10 +35,10 @@
     3.4  endif
     3.5  
     3.6  ifeq ($(OPENPGP),SEQUOIA)
     3.7 -	LDFLAGS+= $(SEQUOIA_LDFLAGS)
     3.8 -	LDLIBS+= $(SEQUOIA_LIB)
     3.9 -	CFLAGS+= $(SEQUOIA_CFLAGS) -DUSE_SEQUOIA
    3.10 -	INC_FLAGS+= $(SEQUOIA_INC)
    3.11 +    LDFLAGS+= $(SEQUOIA_LDFLAGS)
    3.12 +    LDLIBS+= $(SEQUOIA_LIB)
    3.13 +    CFLAGS+= $(SEQUOIA_CFLAGS) -DUSE_SEQUOIA
    3.14 +    INC_FLAGS+= $(SEQUOIA_INC)
    3.15  endif
    3.16  
    3.17  ifdef SQLITE3_FROM_OS
    3.18 @@ -123,7 +123,7 @@
    3.19  
    3.20  .PHONY: test
    3.21  test: all
    3.22 -    $(TEST_CMD_PFX) $(TEST_DEBUGGER) ./$(TARGET)
    3.23 +	$(TEST_CMD_PFX) $(TEST_DEBUGGER) ./$(TARGET)
    3.24  
    3.25  .PHONY: clean
    3.26  clean: