add target for dynamic library. only for MacOS, yet. UNTESTED SO FAR!

master
Roker 2 years ago
parent 7f0647830b
commit 6af33529e1

@ -4,7 +4,7 @@
.PHONY: lib all clean install test
CXX=c++
CXXFLAGS+=-Wall -O0 -std=c++14 -g -fstack-protector-all -DLOG_TO_STDERR -fsanitize=address
CXXFLAGS+=-Wall -O0 -std=c++14 -g -fPIC -fstack-protector-all -DLOG_TO_STDERR -fsanitize=address
LDFLAGS+=-fsanitize=address
PREFIX=/usr/local
@ -12,7 +12,7 @@ PREFIX=/usr/local
# !FIXME!
GTEST_DIR=/opt/local/src/googletest
######### General #########
BUILD_ON:=$(shell uname)
# This variable specifies the platform that the engine should be cross-compiled for.
@ -29,20 +29,31 @@ ifeq ($(BUILD_FOR),Darwin)
LDLIBS+= -liconv
endif
# Filename of the shared library
ifeq ($(BUILD_FOR),Linux)
TARGET=libpEpMIME.so
else ifeq ($(BUILD_FOR),Darwin)
TARGET=libpEpMIME.dylib
endif
lib: libpEpMIME.a
all: libpEpMIME.a unittests fuzz
all: libpEpMIME.a unittests fuzz $(TARGET)
-include local.conf
libpEpMIME.a: pEpMIME.o pEpMIME_internal.o rules.o bodyparser.o \
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 $@ $^
$(TARGET): ${LIB_OBJ}
${CXX} ${LDFLAGS} ${LDLIBS} -shared -undefined dynamic_lookup $^ -o $@
unittests: unittest_mime.o unittest_nfc.o unittest_timestamp.o \
unittest_stringcase.o unittest_toutf8.o unittest_address.o \
unittest_rule.o unittest_subject.o unittest_base64.o \

Loading…
Cancel
Save