From f88f7d03516b6b4012d98b41183376ac4a809fc1 Mon Sep 17 00:00:00 2001 From: Krista Bennett Date: Wed, 3 Feb 2021 11:40:10 +0100 Subject: [PATCH] ENGINE-864: Makefile tweaks. Will have to come into default, but since we're doing this anyway... --- asn.1/Makefile | 2 +- src/Makefile | 4 ++-- test/Makefile | 17 +++++------------ 3 files changed, 8 insertions(+), 15 deletions(-) diff --git a/asn.1/Makefile b/asn.1/Makefile index a1fe1cc75..62d10a672 100644 --- a/asn.1/Makefile +++ b/asn.1/Makefile @@ -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 $< diff --git a/src/Makefile b/src/Makefile index 7f6d9d929..e577a4499 100644 --- a/src/Makefile +++ b/src/Makefile @@ -73,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 $@.$$$$ @@ -83,7 +83,7 @@ ifneq ($(MAKECMDGOALS),clean) endif $(TARGET): libpEpEngine.a - $(CC) $(CPPFLAGS) $(CFLAGS) $(ALL_OBJECTS) $(LDFLAGS) $(LDLIBS) -o $@ + $(CC) $(CFLAGS) $(CPPFLAGS) $(ALL_OBJECTS) $(LDFLAGS) $(LDLIBS) -o $@ .PHONY: objects clean install_headers install uninstall beinstall diff --git a/test/Makefile b/test/Makefile index 45ed5ec48..6a4068ce5 100644 --- a/test/Makefile +++ b/test/Makefile @@ -28,16 +28,10 @@ endif CPPFLAGS+= -DGTEST_SUITE_SYM=$(GTEST_SUITE_SYM) -ifeq ($(OPENPGP),GPG) - LDFLAGS+= $(GPGME_LIB) -else ifeq ($(OPENPGP),NETPGP) - LDFLAGS+= $(NETGPG_LIB) -endif - ifdef PEP_MIME -LDLIBS+= -lpEpMIME + LDLIBS+= -lpEpMIME else -LDLIBS_= -letpan + LDLIBS+= -letpan endif LDLIBS+= -lpEpEngine -lstdc++ -lasn1 @@ -58,10 +52,9 @@ ifdef SQLITE3_FROM_OS LDLIBS+= -lsqlite3 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../src -I ../asn.1 -I../sync $(INC_FLAGS) -Wno-deprecated -Wno-unused-variable EXTRA_LIB_PATHS=.:../src: @@ -91,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} ${CPPFLAGS} ${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