include ../deps/makefiles/platform.mak

LIBRARIES += ../back_end_src ../deps/libencryptmsg/src ../deps/state_machine ../deps/libencryptmsg/deps/botan_1_openpgp_codec

ifeq ($(PLATFORM),MACOS)
LDFLAGS += -all_load
else
LDFLAGS += -Wl,--whole-archive
LDLIBS += -Wl,--no-whole-archive
#-dl
endif

ifeq ($(RELEASE),on)
CXXFLAGS += -ggdb
endif

CXXFLAGS += -I../deps/libencryptmsg/include
CXXFLAGS += -I../deps/libencryptmsg/deps/plog/include

LDLIBS += ../deps/gtest/googletest/build/libgtest.a ../deps/stlplus/portability/$(SUBDIR)/libportability.a -lpthread
CXXFLAGS += -I../deps/gtest/googletest/include -pthread -std=c++11 -Wall -Wextra

ifeq ($(WINDOWS),on)
LDFLAGS += -lgdi32 -lkernel32 -luser32
BOTANLIBFILE = ../deps/botan/botan.lib -fstack-protector
else
BOTANLIBFILE = ../deps/botan/libbotan-2.a -lm
LIBDL = -ldl
endif

ifneq ($(USE_SYSTEM_LIBS),on)
LDLIBS += $(BOTANLIBFILE) ../deps/zlib/libz.a -lpthread $(LIBDL)
CXXFLAGS += -I../deps/botan/build/include -I../deps/zlib -pthread -std=c++11
else
BOTANLIB := $(shell pkg-config --libs botan-2)
BOTANCXX := $(shell pkg-config --cflags botan-2)
LDLIBS += $(BOTANLIB) -lz
CXXFLAGS += $(BOTANCXX)
endif

LDFLAGS += -Wall

ifeq ($(RELEASE),on)
TARGETDIR := ../../bin/release
else
TARGETDIR := ../../bin/debug
endif

IMAGENAME := $(TARGETDIR)/encrypt_pad_tests
include ../deps/makefiles/gcc.mak
