p≡p MIME library
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

59 lines
1.7 KiB

  1. .PHONY: clear install
  2. CXX=c++
  3. CXXFLAGS += -Wall -O0 -std=c++14 -g -glldb -fstack-protector-all
  4. PREFIX=/usr/local
  5. # !FIXME!
  6. GTEST_DIR=/opt/local/src/googletest
  7. lib: libpEpMIME.a
  8. all: libpEpMIME.a unittests fuzz
  9. -include local.conf
  10. libpEpMIME.a: pEpMIME.o pEpMIME_internal.o rules.o bodyparser.o \
  11. headerparser.o parse_timestamp.o parse_address.o nulllogger.o \
  12. base64.o nfc.o mime_headers.o nfc_sets.o to_utf8.o quoted_printable.o \
  13. message.o pEpEngine_mime.o
  14. ${AR} rcs $@ $^
  15. unittests: unittest_mime.o unittest_nfc.o unittest_timestamp.o \
  16. unittest_stringcase.o unittest_toutf8.o unittest_address.o \
  17. unittest_rule.o unittest_subject.o \
  18. gtest-all.o gtest_main.o libpEpMIME.a
  19. ${CXX} ${LDFLAGS} -L${PREFIX}/lib -o $@ $^ -lpEpAdapter -lpEpEngine -lpthread -liconv
  20. gtest-all.o: $(GTEST_DIR)/src/gtest-all.cc
  21. ${CXX} ${CXXFLAGS} $(CPPFLAGS) -I$(GTEST_DIR) $(CXXFLAGS) -isystem $(GTEST_DIR)/include -o $@ -c $<
  22. gtest_main.o: $(GTEST_DIR)/src/gtest_main.cc
  23. ${CXX} ${CXXFLAGS} $(CPPFLAGS) -I$(GTEST_DIR) $(CXXFLAGS) -isystem $(GTEST_DIR)/include -o $@ -c $<
  24. unittest_%.o : unittest_%.cc
  25. ${CXX} ${CXXFLAGS} -I${PREFIX}/include -isystem $(GTEST_DIR)/include -o $@ -c $<
  26. fuzz: fuzz.o libpEpMIME.a
  27. ${CXX} ${LDFLAGS} -L${PREFIX}/lib -o $@ $^ -lpEpAdapter -lpEpEngine -lpthread -liconv
  28. fuzz.o: fuzz.cc
  29. ${CXX} ${CXXFLAGS} -I${PREFIX}/include -o $@ -c $^
  30. %.o : %.cc %.hh
  31. ${CXX} ${CXXFLAGS} -I${PREFIX}/include -o $@ -c $<
  32. %.o : %.cc
  33. ${CXX} ${CXXFLAGS} -I${PREFIX}/include -o $@ -c $<
  34. clean:
  35. rm -vf *.o \
  36. *.a \
  37. unittests fuzz
  38. install: lib
  39. mkdir -p $(PREFIX)/include/pEp
  40. cp pEpMIME.hh $(PREFIX)/include/pEp
  41. mkdir -p $(PREFIX)/lib
  42. cp libpEpMIME.a $(PREFIX)/lib