Makefile.conf
changeset 1988 ea7bceda4dc8
parent 1942 f734d5bd851a
child 1989 d3e5bc4a9854
     1.1 --- a/Makefile.conf	Tue Aug 22 09:08:15 2017 +0200
     1.2 +++ b/Makefile.conf	Tue Aug 22 15:34:17 2017 +0200
     1.3 @@ -1,30 +1,21 @@
     1.4 -# this file is in the Public Domain
     1.5 +# Copyright 2017, pEp Foundation
     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 +# This file assembles all the make variables that a maintainer or dev may want to taylor to his or her needs on a given 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 +# To use custom build configuration variables, put them in a new file with the path `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.33  
    1.34 -#EXTRAMACROS=-DDEFAULT_KEYSERVER=\"default-server.org\" -DCRASHDUMP_DEFAULT_LINES=23
    1.35 +BUILD_CONFIG:=$(dir $(lastword $(MAKEFILE_LIST)))build-config
    1.36  
    1.37 -# second instance for testing
    1.38 -
    1.39 -#EXTRAMACROS=-DLOCAL_DB_FILENAME=\".pEp_management2.db\"
    1.40 -#TARGET=libpEpEngine2.dylib 
    1.41 +include $(BUILD_CONFIG)/common.conf
    1.42 +# cross-compiling is currently not supported, but maybe you can hack something with `PLATFORM_OVERRIDE`
    1.43 +ifeq ($(BUILD_ON),$(BUILD_FOR))
    1.44 +    include $(BUILD_CONFIG)/$(BUILD_ON).conf
    1.45 +else
    1.46 +    $(error I don't know how to build for $(BUILD_FOR) on $(BUILD_ON))
    1.47 +endif
    1.48 +ifdef PLATFORM_OVERRIDE
    1.49 +    include $(BUILD_CONFIG)/$(PLATFORM_OVERRIDE).conf
    1.50 +endif