Refactored GPGME/NetPGP config in src/Makefile
authorEdouard Tisserant <edouard@pep-project.org>
Thu, 16 Mar 2017 22:08:12 +0100
changeset 16764184ee019f65
parent 1674 5639f969866a
child 1677 e02c53c94550
Refactored GPGME/NetPGP config in src/Makefile
src/Makefile
     1.1 --- a/src/Makefile	Wed Mar 15 18:02:46 2017 +0100
     1.2 +++ b/src/Makefile	Thu Mar 16 22:08:12 2017 +0100
     1.3 @@ -1,20 +1,19 @@
     1.4  include ../Makefile.conf
     1.5  
     1.6 -OPENPGP?=GPG
     1.7 +ETPAN_IN?=$(HOME)
     1.8  
     1.9  ifeq ($(BUILD_ON),Darwin)
    1.10  ifeq ($(BUILD_FOR),Darwin)
    1.11  
    1.12  TARGET?=libpEpEngine.dylib
    1.13  MACOSX_VERSION_MIN=10.6
    1.14 -GPGME_IN=$(HOME)
    1.15  LIBGPGME?=libgpgme.dylib
    1.16  CC?=clang -std=c99 -pthread
    1.17  LD?=clang
    1.18 -CFLAGS?=-I$(GPGME_IN)/include -I$(HOME)/include -I/opt/local/include $(OPTIMIZE) -pedantic \
    1.19 -	-DSYSTEM_DB=\"$(SYSTEM_DB)\" -DLIBGPGME=\"$(LIBGPGME)\" -DNDEBUG -I../asn.1 $(EXTRAMACROS)
    1.20 -LDFLAGS?=-lc -shared -arch x86_64 \
    1.21 -	-L$(HOME)/lib -L/usr/lib -L/opt/local/lib -letpan -lsqlite3 -L../asn.1 -lasn1 -lz -liconv
    1.22 +CFLAGS?= -I$(ETPAN_IN)/include -I/opt/local/include $(OPTIMIZE) -pedantic \
    1.23 +	-DSYSTEM_DB=\"$(SYSTEM_DB)\" -I../asn.1 $(EXTRAMACROS)
    1.24 +LDFLAGS?= -lc -shared -arch x86_64 \
    1.25 +	-L$(ETPAN_IN)/lib -L/usr/lib -L/opt/local/lib -letpan -lsqlite3 -L../asn.1 -lasn1 -lz -liconv
    1.26  
    1.27  else
    1.28  $(error don't know how to make for $(BUILD_FOR) on $(BUILD_ON))
    1.29 @@ -24,13 +23,11 @@
    1.30  ifeq ($(BUILD_FOR),Linux)
    1.31  
    1.32  TARGET=libpEpEngine.so
    1.33 -GPGME_IN=$(HOME)
    1.34 -LIBGPGME=libgpgme.so.11
    1.35 +LIBGPGME?=libgpgme.so.11
    1.36  CC=gcc -std=c99
    1.37 -CFLAGS?=-I$(GPGME_IN)/include $(OPTIMIZE) -fPIC -pedantic \
    1.38 -	-DSYSTEM_DB=\"$(SYSTEM_DB)\" -DLIBGPGME=\"$(LIBGPGME)\" \
    1.39 -	-DSQLITE_THREADSAFE=1 -D_GNU_SOURCE -DNDEBUG -I../asn.1 $(EXTRAMACROS)
    1.40 -LDFLAGS?=-L$(GPGME_IN)/lib -shared -lc -ldl -letpan -lpthread -L../asn.1 -lasn1 -luuid
    1.41 +CFLAGS?= $(OPTIMIZE) -fPIC -pedantic -DSYSTEM_DB=\"$(SYSTEM_DB)\" \
    1.42 +	-DSQLITE_THREADSAFE=1 -D_GNU_SOURCE -I../asn.1 $(EXTRAMACROS)
    1.43 +LDFLAGS?= -L$(ETPAN_IN)/lib -shared -lc -ldl -letpan -lpthread -L../asn.1 -lasn1 -luuid
    1.44  
    1.45  else
    1.46  $(error don't know how to make for $(BUILD_FOR) on $(BUILD_ON))
    1.47 @@ -40,14 +37,22 @@
    1.48  $(error don't know how to make for $(BUILD_FOR) on $(BUILD_ON))
    1.49  endif
    1.50  
    1.51 +DEBUG?=NO
    1.52 +ifeq ("$(DEBUG)","NO")
    1.53 +    CFLAGS+= -DNDEBUG
    1.54 +endif
    1.55 +
    1.56 +OPENPGP?=GPG
    1.57  ifeq ("$(OPENPGP)","GPG")
    1.58 -	NO_SOURCE=pgp_netpgp.c
    1.59 -	CFLAGS+= -DUSE_GPG
    1.60 -	LDFLAGS+= -lgpgme
    1.61 +    NO_SOURCE=pgp_netpgp.c
    1.62 +    GPGME_IN?=$(HOME)
    1.63 +    CFLAGS+= -DUSE_GPG -I$(GPGME_IN)/include -DLIBGPGME=\"$(LIBGPGME)\"
    1.64 +    #LDFLAGS+= -L$(GPGME_IN)/lib -lgpgme
    1.65  else ifeq ("$(OPENPGP)","NETPGP")
    1.66 -	NO_SOURCE=pgp_gpg.c
    1.67 -	CFLAGS+= -DUSE_NETPGP
    1.68 -	LDFLAGS+= -lnetpgp -lcurl
    1.69 +    NO_SOURCE=pgp_gpg.c
    1.70 +    NETPGP_IN?=$(HOME)
    1.71 +    CFLAGS+= -DUSE_NETPGP -I$(NETPGP_IN)/include
    1.72 +    LDFLAGS+= -L$(NETPGP_IN)/lib -lnetpgp -lcurl
    1.73  else
    1.74  	$(error Unknown OpenPGP library : $(OPENPGP))
    1.75  endif