Merge branch 'ENGINE-864'. This merges in some generic Makefile refactoring as well as the changes so that pEpMIME can be built in to the engine (this requires a separately checked-out pEpMIME repo, setting PEP_MIME to 1 in the local.conf file, and ensuring PEP_MIME_SRC is set properly. System also needs boost to do built-in parsing, but if you don't touch the PEP_MIME variable, we still default to etpan. Please contact krista with a copy of your local.conf and the compiler error if you can't get it working. (Does not apply to non-MacOS/*nix-flavoured OSs for the time being...)

ENGINE-814
Krista Bennett 2 years ago
commit 0ddef895f7

4
.gitignore vendored

@ -86,6 +86,10 @@ lldb-history
test/EngineTests
test/googletest
test/tmp/*
.idea/
pEpMIME/*.hh
pEpMIME/*.cc
pEpMIME/*.hxx
# ignore generated test data

@ -19,24 +19,35 @@ ifdef BUILD_CONFIG
$(info ================================================)
endif
.PHONY: all sync asn1 build install dbinstall uninstall clean tags test package db
BUILT_IN_MIME=
build: asn1
ifdef PEP_MIME
BUILT_IN_MIME=pepmime
endif
.PHONY: all $(BUILT_IN_MIME) sync asn1 build install dbinstall uninstall clean tags test package db
build: $(BUILT_IN_MIME) asn1
$(MAKE) -C src
all: build
# `make all` is not for tests, that's what `make test` is for
# $(MAKE) -C test
pepmime:
$(MAKE) -C pEpMIME lib
sync:
$(MAKE) -C sync
asn1: sync
$(MAKE) -C asn.1
install: build
$(MAKE) -C src install
$(MAKE) -C asn.1 install
$(MAKE) -C pEpMIME install
beinstall:
$(MAKE) -C src beinstall
@ -55,6 +66,9 @@ clean:
$(MAKE) -C asn.1 clean
$(MAKE) -C sync clean
$(MAKE) -C build-android clean
ifdef PEP_MIME
$(MAKE) -C pEpMIME clean
endif
tags:
$(MAKE) -C asn.1 tags

@ -15,7 +15,6 @@
# It is possible to use multiple variants simultaniously.
# If nothing is changed according to these 3 methods, a default configuration for your platform (specified below) will be used for the build.
######### Header #########
HERE:=$(dir $(lastword $(MAKEFILE_LIST)))
@ -74,28 +73,29 @@ TARGET_ARCH=
# The following two variables will be appended to.
# You can thus not set them to a final, fixed value here.
ifeq ($(BUILD_FOR),Linux)
LDFLAGS=
LDFLAGS+=
else ifeq ($(BUILD_FOR),Darwin)
# "-bind_at_load" helps find symbol resolution errors faster
LDFLAGS=-bind_at_load
LDFLAGS+=-bind_at_load
endif
# Are we wiping this on purpose?
LDLIBS=
######### C #########
ifeq ($(BUILD_FOR),Linux)
CC=gcc -std=c99 -pthread
CC=gcc
else ifeq ($(BUILD_FOR),Darwin)
# clang issues a warning when "-pthread" is used for linking.
# So, include it in CFLAGS, and not in CC
CC=clang -std=c99
CC=clang
endif
CFLAGS+=-std=c99 -pthread
CFLAGS+=-fPIC -fstrict-aliasing
ifeq ($(BUILD_FOR),Linux)
CFLAGS=-fPIC -fstrict-aliasing -fdiagnostics-color=auto
CFLAGS+=-fdiagnostics-color=auto
else ifeq ($(BUILD_FOR),Darwin)
CFLAGS=-pthread -fPIC -fstrict-aliasing -fcolor-diagnostics
CFLAGS+=-fcolor-diagnostics
endif
# The flag -DNDEBUG will always be removed from CFLAGS for compiling tests.
@ -131,24 +131,28 @@ ifeq ($(BUILD_FOR),Linux)
# otherwise printed during the compilation of every asn1c-generated C file.
# It's a glibc specific warning, only present in few versions around ~2.19.
# See https://lwn.net/Articles/590381/ for a discussion.
CFLAGS_GENERATED=-D_DEFAULT_SOURCE
CPPFLAGS_GENERATED=-D_DEFAULT_SOURCE
else ifeq ($(BUILD_FOR),Darwin)
CFLAGS_GENERATED=
CPPFLAGS_GENERATED=
endif
######### C++ #########
ifeq ($(BUILD_FOR),Linux)
CXX=g++ -std=gnu++11 -pthread
CXX=g++
CXXFLAGS+=-std=gnu++11
else ifeq ($(BUILD_FOR),Darwin)
# clang issues a warning when "-pthread" is used for linking. So, include it in CXXFLAGS, and not in CXX
CXX=clang -std=c++11
CXX=clang
CXXFLAGS+=-std=c++11
endif
# The flag -DNDEBUG will always be removed from CXXFLAGS for compiling tests.
CXXFLAGS+=-pthread
# The flag -DNDEBUG will always be removed from CPPFLAGS for compiling tests.
#
# The tests do not work properly, if compiled with -DNDEBUG
ifeq ($(BUILD_FOR),Linux)
CXXFLAGS=-fdiagnostics-color=auto -I../src -I../asn.1 $(ETPAN_INC)
CXXFLAGS+=-fdiagnostics-color=auto -I../src -I../asn.1 $(ETPAN_INC)
ifdef WARN
CXXFLAGS+=
else
@ -157,10 +161,11 @@ ifeq ($(BUILD_FOR),Linux)
ifdef DEBUG
CXXFLAGS+= -g -ggdb
else
CXXFLAGS+= -O3 -DNDEBUG
CXXFLAGS+= -O3
CPPFLAGS+= -DNDEBUG
endif
else ifeq ($(BUILD_FOR),Darwin)
CXXFLAGS=-pthread -fcolor-diagnostics -I../src -I../asn.1 $(ETPAN_INC)
CXXFLAGS+=-fcolor-diagnostics -I../src -I../asn.1 $(ETPAN_INC)
ifdef WARN
CXXFLAGS+=
else
@ -169,16 +174,18 @@ else ifeq ($(BUILD_FOR),Darwin)
ifdef DEBUG
CXXFLAGS+= -O0 -g
else
CXXFLAGS+= -O3 -DNDEBUG
CXXFLAGS+= -O3
CPPFLAGS+= -DNDEBUG
endif
endif
######### C and C++ #########
ifeq ($(BUILD_FOR),Darwin)
CPPFLAGS=-D_DARWIN_C_SOURCE
CPPFLAGS+=-D_DARWIN_C_SOURCE
LDLIBS+=-liconv
else
CPPFLAGS=
LDLIBS+=-luuid
endif
@ -200,39 +207,42 @@ ASN1C_INC=
#ASN1C_INC=-I$(HOME)/include
######### libetpan #########
# libetpan library search flag
ETPAN_LIB=
#ETPAN_LIB=-L$(HOME)/lib
######### sqlite3 #########
# If empty (or undefined), compile sqlite3 from the sources shipped with the pEp distribution.
# Otherwise, use an sqlite3 implementation found in the OS's include/library paths.
SQLITE3_FROM_OS=placeholder
# libetpan include search flag
ETPAN_INC=
#ETPAN_INC=-I$(HOME)/include
######### MIME #########
######### pEp MIME #########
# set this to skip libetpan and use PEP_MIME instead
# PEP_MIME=1
# Set pEpMIME= anything (there are ifdefs on it) in your local.conf if you want
# to compile built-in pEpMIME (requires a separate libppEpMIME source repo to be
# checked out elsewhere on the system - define or redefine these in local.conf
# if you want to use it; otherwise, we default to etpan. (This will eventually
# become the default, but not yet.
#
# pEp MIME library search flag
PEP_MIME_LIB=
# pEp MIME include search flag
PEP_MIME_INC=
PEP_MIME=
PEP_MIME_SRC=$(HOME)/src/pEpMIME/src
######### sqlite3 #########
# If empty (or undefined), compile sqlite3 from the sources shipped with the pEp distribution.
# Otherwise, use an sqlite3 implementation found in the OS's include/library paths.
SQLITE3_FROM_OS=placeholder
######### libetpan #########
# libetpan library search flag
#
ETPAN_LIB=
#ETPAN_LIB=-L$(HOME)/lib
# libetpan include search flag
ETPAN_INC=
#ETPAN_INC=-I$(HOME)/include
######### OpenPGP #########
# Selects OpenPGP implementation. must be `SEQUOIA`
OPENPGP=SEQUOIA
# Sequoia-specific variables
SEQUOIA_CFLAGS=
SEQUOIA_LDFLAGS=
SEQUOIA_CFLAGS+=
SEQUOIA_LDFLAGS+=
SEQUOIA_LIB=
SEQUOIA_INC=
@ -258,6 +268,10 @@ EXCLUDE=
######### Footer #########
################################
# Include local.conf for any overrides and additional flags
################################
-include $(HERE)/local.conf
ifdef BUILD_CONFIG
@ -265,26 +279,43 @@ ifdef BUILD_CONFIG
endif
######### Post processing assignments ########
# These variables are ineffective when set anywhere else but here.
# KB: I have no idea why we do this - it totally defeats the purpose of
# local.conf.
# For now: set if has no value.
# If sequoia has been set up and the SEQUOIA flags aren't defined, set them up.
# Otherwise, add them to the CFLAGS/CXXFLAGS/LDFLAGS and library/include variables
ifeq ($(OPENPGP),SEQUOIA)
ifeq ($(SEQUOIA_CFLAGS),)
SEQUOIA_CFLAGS=$(shell pkg-config --cflags-only-other sequoia-openpgp)
SEQUOIA_CFLAGS+=$(shell pkg-config --cflags-only-other sequoia-openpgp)
endif
ifeq ($(SEQUOIA_LDFLAGS),)
SEQUOIA_LDFLAGS=$(shell pkg-config --libs-only-l --libs-only-other sequoia-openpgp)
SEQUOIA_LDFLAGS+=$(shell pkg-config --libs-only-L --libs-only-other sequoia-openpgp)
endif
ifeq ($(SEQUOIA_LIB),)
SEQUOIA_LIB=$(shell pkg-config --libs-only-L sequoia-openpgp)
SEQUOIA_LIB=$(shell pkg-config --libs-only-l sequoia-openpgp)
endif
ifeq ($(SEQUOIA_INC),)
SEQUOIA_INC=$(shell pkg-config --cflags-only-I sequoia-openpgp)
endif
CFLAGS+= $(SEQUOIA_CFLAGS)
CXXFLAGS+= $(SEQUOIA_CFLAGS)
LD_FLAGS+= $(SEQUOIA_LDFLAGS)
endif
# YML_PATH is needed in the environment of every call to a program of the YML2 distribution
export YML_PATH=$(YML2_PATH)
# Postprocess for pEpMIME
ifdef PEP_MIME
# Replace c++11 with c++14 for now (limiting the subst to the ++11 means it doesn't matter if gnu or not)
CXXFLAGS:=$(subst ++11,++14,$(CXXFLAGS)) -fPIC -fvisibility=hidden
endif
ifdef PEP_MIME
ifndef PEP_MIME_SRC
$(error "Compiling with the PEP_MIME option set requires the value of PEP_MIME_SRC to be set to the source directory for libpEpMIME")
else
CPPFLAGS+=-DPEP_BUILTIN_MIME
LDLIBS+=-lstdc++
ETPAN_LIB=
ETPAN_INC=
endif
endif

@ -5,7 +5,7 @@ include ../Makefile.conf
ALL_SOURCE=$(subst $(NO_SOURCE),,$(wildcard *.c))
ALL_OBJECTS=$(subst .c,.o,$(ALL_SOURCE))
CPPFLAGS+=$(CFLAGS_GENERATED)
CPPFLAGS+=$(CPPFLAGS_GENERATED)
ASN1C_INC+= -I.
.PHONY: all clean install uninstall
@ -17,7 +17,7 @@ libasn1.a: $(ALL_OBJECTS)
$(AR) -rc $@ $(ALL_OBJECTS)
%.o: %.c %.h
$(CC) $(CPPFLAGS) $(CFLAGS) $(OPTIMIZE) $(ASN1C_INC) -c $< -o $@
$(CC) $(CFLAGS) $(CPPFLAGS) $(OPTIMIZE) $(ASN1C_INC) -c $< -o $@
Sync.c: sync.asn1 keysync.asn1 pEp.asn1
$(ASN1C) -gen-PER -fincludes-quoted -fcompound-names -pdu=auto pEp.asn1 keysync.asn1 $<

@ -0,0 +1,102 @@
# This file is under GNU General Public License 3.0
# see LICENSE.txt
##################################################################################
# This is a modified Makefile based on that in the libpEpMIME repository.
# THEY ARE NOT INTERCHANGEABLE. This is SPECIFICALLY for the pEp engine and
# is only for the built-in variant of the compiler.
#
# Note that this is the only supported way of including pEpMIME within the engine.
#
# If additional object files are added to the repository object requirements, they
# will have to be included here specifically.
##################################################################################
.PHONY: mimesrc lib all clean install test
include ../Makefile.conf
######### General #########
BUILD_ON:=$(shell uname)
# This variable specifies the platform that the engine should be cross-compiled for.
BUILD_FOR=$(BUILD_ON)
# Cross-compiling is currently not supported.
# Maybe you can hack something with `local.conf`.
ifneq ($(BUILD_ON),$(BUILD_FOR))
$(error I don't know how to build for $(BUILD_FOR) on $(BUILD_ON).)
endif
SED=
# MacOS needs -liconv, Linix don't.
ifeq ($(BUILD_FOR),Darwin)
LDLIBS+= -liconv
SED=sed -i ''
else
SED=sed -i
endif
######################################################################
#
# libpEpMIME can be built as a separate library in its own repository.
#
# However, it is dependent on the engine, which obviously does not
# work within the engine, as the engine is dependent upon IT.
# Because header files within the engine are local and not defined
# to exist in some installed library under pEp/header_file.h, we simply
# copy them into this directory and build/modify them as needed.
#
######################################################################
# Repo source
PEPMIME_SRC_FILES:= $(wildcard $(PEP_MIME_SRC)/*.cc) $(wildcard $(PEP_MIME_SRC)/*.hh) $(wildcard $(PEP_MIME_SRC)/*.hxx)
# Stripped filenames
LOCAL_PEPMIME_SRC:= $(subst $(PEP_MIME_SRC)/,,$(PEPMIME_SRC_FILES))
all: lib
lib: mimesrc libpEpMIME.a
mimesrc: ${LOCAL_PEPMIME_SRC}
# Copy the files to the local directory and change their engine header references to quoted references
%.hh : $(PEP_MIME_SRC)/%.hh
cp -p $< $@
$(SED) 's/#include <pEp\/\(.*\)>/#include "..\/src\/\1"/g' $@
%.cc : $(PEP_MIME_SRC)/%.cc
cp -p $< $@
$(SED) 's/#include <pEp\/\(.*\)>/#include "..\/src\/\1"/g' $@
%.hxx : $(PEP_MIME_SRC)/%.hxx
cp -p $< $@
$(SED) 's/#include <pEp\/\(.*\)>/#include "..\/src\/\1"/g' $@
LIB_OBJ=pEpMIME.o pEpMIME_internal.o rules.o bodyparser.o \
attachment.o bodygenerator.o \
headerparser.o parse_timestamp.o parse_address.o nulllogger.o \
base64.o nfc.o mime_headers.o nfc_sets.o to_utf8.o quoted_printable.o \
header_generator.o message.o pEpEngine_mime.o
libpEpMIME.a: $(LIB_OBJ)
${AR} rcs $@ $^
%.o : %.cc %.hh
${CXX} ${CXXFLAGS} ${CPPFLAGS} -I${PREFIX}/include -o $@ -c $<
%.o : %.cc
${CXX} ${CXXFLAGS} ${CPPFLAGS} -I${PREFIX}/include -o $@ -c $<
clean:
rm -vf *.o *.a
srcclean:
rm *.cc *.hh *.hxx
install: lib
mkdir -p "$(PREFIX)/lib/"
cp -v libpEpMIME.a $(PREFIX)/lib
uninstall:
rm $(PREFIX)/lib/libpEpMIME.a

@ -0,0 +1,38 @@
# Instructions and caveats for using pEpMIME as the built-in engine parser
## Makefile variables and local.conf
We copy the necessary files from the user's *separate* libpEpMIME repository
on the machine.
**Note: The Makefile in this directory is *different* from the libpEpMIME Makefile.**
**DO NOT REPLACE THE pEpEngine's pEpMIME Makefile with the one from the libpEpMIME repository. It won't work!**
Source files in this directory are local copies only and will be copied over if the repository is
updated. We post-process the source to change the "installed-header" requirements of the "separate"
(quotes intentional) library.
* PEP_MIME=1
* PEP_MIME_SRC=<your checked-out libpEpMIME repo's src directory>
## Known issues
On MacOS, the built-in standard BSD C library provides strlcat et al. **However**, for some weird reason, when
compiling the engine with pEpMIME, the compiler thinks strlcat is no longer defined, though everything links and runs
in the end.
If you see something like:
```
platform_unix.c:280:5: warning: implicitly declaring library function 'strlcat' with type 'unsigned long (char *, const char *, unsigned long)' [-Wimplicit-function-declaration]
strlcat(*first, second, size);
^
platform_unix.c:280:5: note: include the header <string.h> or explicitly provide a declaration for 'strlcat'
1 warning generated.
```
It doesn't seem to be an actual issue, and maybe it's a problem of compiling part of the engine with clang and part of it with clang++ and c++14, but anyway, watch out for it, and
don't complain to the engine team unless you figure out how to fix it ;)
## TODO
* git submodules would be a good way to handle our "copy this in because it really isn't a separate library" issue

@ -13,28 +13,33 @@ ifdef PER_MACHINE_DIRECTORY
EXTRA_MACROS+= -DPER_MACHINE_DIRECTORY=\"$(PER_MACHINE_DIRECTORY)\"
endif
CFLAGS+= $(ETPAN_INC) $(PEP_MIME_INC) -I../asn.1 $(EXTRA_MACROS)
LDFLAGS+= $(ETPAN_LIB) $(PEP_MIME_LIB) -L../asn.1 -shared
LDLIBS+= -lc -lasn1
NO_SOURCE=
ifndef PEP_MIME
LDLIBS+= -letpan
CFLAGS+= $(ETPAN_INC)
LDFLAGS+= $(ETPAN_LIB)
LDLIBS+= -letpan
else
LDLIBS+= -lpEpMIME
NO_SOURCE+= etpan_mime.c
LDFLAGS+= -L../pEpMIME -shared
LDLIBS+= -lpEpMIME
NO_SOURCE+= etpan_mime.c
endif
CFLAGS+= -I../asn.1 $(EXTRA_MACROS)
CPPFLAGS+= -DSQLITE_THREADSAFE=1
LDFLAGS+= -L../asn.1 -shared
LDLIBS+= -lc -lasn1
ifeq ($(BUILD_ON),Darwin)
ifeq ($(BUILD_FOR),Darwin)
CFLAGS+= -DSQLITE_THREADSAFE=1
LDLIBS+= -lz -liconv -mmacosx-version-min=10.10
else
$(error I do not know how to make for $(BUILD_FOR) on $(BUILD_ON))
endif
else ifeq ($(BUILD_ON),Linux)
ifeq ($(BUILD_FOR),Linux)
CFLAGS+= -DSQLITE_THREADSAFE=1 -D_GNU_SOURCE
CPPFLAGS+= -D_GNU_SOURCE
LDLIBS+= -ldl -luuid
else
$(error I do not know how to make for $(BUILD_FOR) on $(BUILD_ON))
@ -45,12 +50,13 @@ endif
ifdef SQLITE3_FROM_OS
NO_SOURCE+= sqlite3.c
CFLAGS+= -DSQLITE3_FROM_OS
CPPFLAGS+= -DSQLITE3_FROM_OS
LDLIBS+= -lsqlite3
endif
ifeq ($(OPENPGP),SEQUOIA)
CFLAGS+= -DUSE_SEQUOIA $(SEQUOIA_CFLAGS) $(SEQUOIA_INC)
CPPFLAGS+= -DUSE_SEQUOIA
CFLAGS+= $(SEQUOIA_CFLAGS) $(SEQUOIA_INC)
LDFLAGS+= $(SEQUOIA_LDFLAGS)
LDLIBS+= $(SEQUOIA_LIB)
else
@ -67,7 +73,7 @@ all: $(TARGET)
%.d: %.c
@set -e; rm -f $@; \
$(CC) -MM $(CPPFLAGS) $(CFLAGS) $< > $@.$$$$; \
$(CC) -MM $(CFLAGS) $(CPPFLAGS) $< > $@.$$$$; \
sed 's,\($*\)\.o[ :]*,\1.o $@ : ,g' < $@.$$$$ > $@; \
rm -f $@.$$$$
@ -77,7 +83,7 @@ ifneq ($(MAKECMDGOALS),clean)
endif
$(TARGET): libpEpEngine.a
$(CC) $(CFLAGS) $(ALL_OBJECTS) $(LDFLAGS) $(LDLIBS) -o $@
$(CC) $(CFLAGS) $(CPPFLAGS) $(ALL_OBJECTS) $(LDFLAGS) $(LDLIBS) -o $@
.PHONY: objects clean install_headers install uninstall beinstall
@ -92,7 +98,7 @@ clean:
rm -f KeySync_fsm.* Sync_actions.c Sync_event.* Sync_func.* Sync_impl.* sync_codec.* distribution_codec.*
# CAVEAT:
# install_headers is needed for building pEp MIME
# install_headers is needed for building *STANDALONE* pEp MIME - it is NOT used for built-in functionality!!!
install_headers: $(TARGET)
mkdir -p $(PREFIX)/include/pEp
@ -103,6 +109,7 @@ install_headers: $(TARGET)
status_to_string.h aux_mime_msg.h keyreset_command.h platform.h platform_unix.h ../asn.1/*.h \
$(PREFIX)/include/pEp/
# FIXME: Does anyone but Roker use install_headers? Otherwise, remove the dependency.
install: $(TARGET) install_headers
mkdir -p "$(PREFIX)/lib/"
cp -v $< $(PREFIX)/lib/

@ -26,15 +26,15 @@ ifeq ($(shell grep -c $(GTEST_SUITE_SYM) $(GTEST_SRC_DIR)/src/gtest.cc),0)
GTEST_SUITE_SYM=test_case_name
endif
CXXFLAGS+= -DGTEST_SUITE_SYM=$(GTEST_SUITE_SYM)
CPPFLAGS+= -DGTEST_SUITE_SYM=$(GTEST_SUITE_SYM)
ifeq ($(OPENPGP),GPG)
LDFLAGS+= $(GPGME_LIB)
else ifeq ($(OPENPGP),NETPGP)
LDFLAGS+= $(NETGPG_LIB)
ifdef PEP_MIME
LDLIBS+= -lpEpMIME
else
LDLIBS+= -letpan
endif
LDLIBS+= -letpan -lpEpEngine -lstdc++ -lasn1
LDLIBS+= -lpEpEngine -lstdc++ -lasn1
ifeq ($(BUILD_FOR),Linux)
LDLIBS+= -luuid
@ -43,7 +43,8 @@ endif
ifeq ($(OPENPGP),SEQUOIA)
LDFLAGS+= $(SEQUOIA_LDFLAGS)
LDLIBS+= $(SEQUOIA_LIB)
CXXFLAGS+= $(SEQUOIA_CFLAGS) -DUSE_SEQUOIA
CXXFLAGS+= $(SEQUOIA_CFLAGS)
CPPFLAGS+= -DUSE_SEQUOIA
INC_FLAGS+= $(SEQUOIA_INC)
endif
@ -51,35 +52,16 @@ ifdef SQLITE3_FROM_OS
LDLIBS+= -lsqlite3
endif
ifeq ($(OPENPGP),GPG)
#LDLIBS+= -lgpgme
else ifeq ($(OPENPGP),NETPGP)
LDLIBS+= -lnetpgp
ifeq ($(BUILD_FOR),Linux)
LDLIBS+= -ltre
endif
endif
CXXFLAGS:=-I$(GTEST_INC_DIR) $(filter-out -DNDEBUG,$(CXXFLAGS))
CXXFLAGS:=$(filter-out -DNDEBUG,$(CXXFLAGS)) -I$(GTEST_INC_DIR)
CPPFLAGS:=$(filter-out -DNDEBUG,$(CPPFLAGS))
# FIXME Possibly missing incdirs: ASN1C_INC
CXXFLAGS+= -I./src -I../sync $(INC_FLAGS) -Wno-deprecated -Wno-unused-variable
ifeq ($(OPENPGP),GPG)
CXXFLAGS+= -DUSE_GPG $(GPGME_INC)
else ifeq ($(OPENPGP),NETPGP)
CXXFLAGS+= -DUSE_NETPGP $(NETPGP_INC)
endif
CXXFLAGS+= -I./src -I../src -I ../asn.1 -I../sync $(INC_FLAGS) -Wno-deprecated -Wno-unused-variable
EXTRA_LIB_PATHS=.:../src:
ifndef PEP_MIME
ifdef ETPAN_LIB
EXTRA_LIB_PATHS:=$(EXTRA_LIB_PATHS)$(patsubst -L%,%,$(ETPAN_LIB)):
endif
ifdef GPGME_LIB
EXTRA_LIB_PATHS:=$(EXTRA_LIB_PATHS)$(patsubst -L%,%,$(GPGME_LIB)):
endif
ifdef NETPGP_LIB
EXTRA_LIB_PATHS:=$(EXTRA_LIB_PATHS)$(patsubst -L%,%,$(NETPGP_LIB)):
endif
# Remove trailing ':'
@ -102,10 +84,10 @@ all:
make $(TARGET)
%.d: %.cc
$(CXX) -MM $(CPPFLAGS) $(CXXFLAGS) $< | sed -e 's,\($*\)\.o[ :]*,\1.o $@: ,g' > $@
$(CXX) -MM $(CXXFLAGS) $(CPPFLAGS) $< | sed -e 's,\($*\)\.o[ :]*,\1.o $@: ,g' > $@
$(TARGET): $(OBJS)
${CXX} ${LDFLAGS} -L${PREFIX}/lib -o $@ $^ -lpEpEngine -lgtest -lgtest_main -lsequoia_openpgp_ffi $(LDLIBS)
${CXX} ${CXXFLAGS} ${CPPFLAGS} ${LDFLAGS} -L${PREFIX}/lib -o $@ $^ -lpEpEngine -lgtest -lgtest_main -lsequoia_openpgp_ffi $(LDLIBS)
test: all

Loading…
Cancel
Save