Makefile.conf
branchENGINE-228
changeset 1953 e9f2e628cc12
parent 1942 f734d5bd851a
child 1958 433df9ee336d
     1.1 --- a/Makefile.conf	Fri Aug 11 15:25:16 2017 +0200
     1.2 +++ b/Makefile.conf	Sun Aug 13 02:22:03 2017 +0200
     1.3 @@ -1,30 +1,18 @@
     1.4 -# this file is in the Public Domain
     1.5 +# Copyright 2017, pEp Security SA
     1.6 +# This file is part of pEpEngine
     1.7 +# This file may be used under the terms of the GNU General Public License version 3
     1.8 +# see LICENSE.txt
     1.9  
    1.10 -BUILD_ON=$(shell uname)
    1.11 -BUILD_FOR=$(BUILD_ON)
    1.12 -OPTIMIZE=-g -Wall -O0 -fPIC -DDEBUG_ERRORSTACK
    1.13 -#OPTIMIZE=-O3 -Wall -DNDEBUG -std=c99
    1.14 -LD=$(CC)
    1.15 -#CC=gcc-mp-4.9 -std=c99 -fstrict-aliasing -Wstrict-aliasing=3
    1.16 -#LD=gcc-mp-4.9
    1.17 -SYSTEM_DB=/usr/local/share/pEp/system.db
    1.18 -PREFIX=$(HOME)
    1.19 -YML2PROC=$(HOME)/yml2/yml2proc
    1.20 -YML_OPTS=--encoding=utf8
    1.21 -YML_PATH=$(HOME)/yml2
    1.22 -ASN1C=asn1c
    1.23 -ASN1C_INCLUDE=/opt/local/share/asn1c
    1.24 -#ETPAN_IN=$(HOME)
    1.25 -#LIBGPGME=/opt/local/lib/libgpgme.11.dylib
    1.26 +# 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.
    1.27  
    1.28 -# C makros (not environment variables) to overwrite:
    1.29 -#
    1.30 -# DEFAULT_KEYSERVER - string with default keyserver
    1.31 -# CRASHDUMP_DEFAULT_LINES - number of log lines to deliver for crashdumps
    1.32 +BUILD_CONFIG=build-config
    1.33  
    1.34 -#EXTRAMACROS=-DDEFAULT_KEYSERVER=\"default-server.org\" -DCRASHDUMP_DEFAULT_LINES=23
    1.35 -
    1.36 -# second instance for testing
    1.37 -
    1.38 -#EXTRAMACROS=-DLOCAL_DB_FILENAME=\".pEp_management2.db\"
    1.39 -#TARGET=libpEpEngine2.dylib 
    1.40 +include $(BUILD_CONFIG)/common.conf
    1.41 +ifdef PLATFORM_OVERRIDE
    1.42 +    include $(BUILD_CONFIG)/$(PLATFORM_OVERRIDE).conf
    1.43 +# cross-compiling is currently not supported, but maybe you can hack something with `PLATFORM_OVERRIDE`
    1.44 +else ifeq ($(BUILD_ON),$(BUILD_FOR))
    1.45 +    include $(BUILD_CONFIG)/$(BUILD_ON).conf
    1.46 +else
    1.47 +    $(error I don't know how to build for $(BUILD_FOR) on $(BUILD_ON))
    1.48 +endif