p≡p engine FORK
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.

86 lines
2.4 KiB

  1. # This file is under GNU General Public License 3.0
  2. # see LICENSE.txt
  3. ##################################################################################
  4. # This is a modified Makefile based on that in the libpEpMIME repository.
  5. # THEY ARE NOT INTERCHANGEABLE. This is SPECIFICALLY for the pEp engine and
  6. # is only for the built-in variant of the compiler.
  7. #
  8. # Note that this is the only supported way of including pEpMIME within the engine.
  9. #
  10. # If additional object files are added to the repository object requirements, they
  11. # will have to be included here specifically.
  12. ##################################################################################
  13. .PHONY: mimesrc lib all clean install test
  14. include ../Makefile.conf
  15. ######### General #########
  16. BUILD_ON:=$(shell uname)
  17. # This variable specifies the platform that the engine should be cross-compiled for.
  18. BUILD_FOR=$(BUILD_ON)
  19. # Cross-compiling is currently not supported.
  20. # Maybe you can hack something with `local.conf`.
  21. ifneq ($(BUILD_ON),$(BUILD_FOR))
  22. $(error I don't know how to build for $(BUILD_FOR) on $(BUILD_ON).)
  23. endif
  24. # MacOS needs -liconv, Linix don't.
  25. ifeq ($(BUILD_FOR),Darwin)
  26. LDLIBS+= -liconv
  27. endif
  28. PEPMIME_SRC_FILES:= $(wildcard $(PEP_MIME_SRC)/*.cc) $(wildcard $(PEP_MIME_SRC)/*.hh) $(wildcard $(PEP_MIME_SRC)/*.hxx)
  29. LOCAL_PEPMIME_SRC:= $(subst $(PEP_MIME_SRC)/,,$(PEPMIME_SRC_FILES))
  30. #$(error $(PEP_MIME_SRC) BOB $(PEPMIME_SRC_FILES) ******************** $(LOCAL_PEPMIME_SRC))
  31. all: lib
  32. lib: mimesrc libpEpMIME.a
  33. mimesrc: ${LOCAL_PEPMIME_SRC}
  34. %.hh : $(PEP_MIME_SRC)/%.hh
  35. cp -p $< $@
  36. sed -i '' 's/#include <pEp\/\(.*\)>/#include "..\/src\/\1"/g' $@
  37. %.cc : $(PEP_MIME_SRC)/%.cc
  38. cp -p $< $@
  39. sed -i '' 's/#include <pEp\/\(.*\)>/#include "..\/src\/\1"/g' $@
  40. %.hxx : $(PEP_MIME_SRC)/%.hxx
  41. cp -p $< $@
  42. sed -i '' 's/#include <pEp\/\(.*\)>/#include "..\/src\/\1"/g' $@
  43. LIB_OBJ=pEpMIME.o pEpMIME_internal.o rules.o bodyparser.o \
  44. attachment.o bodygenerator.o \
  45. headerparser.o parse_timestamp.o parse_address.o nulllogger.o \
  46. base64.o nfc.o mime_headers.o nfc_sets.o to_utf8.o quoted_printable.o \
  47. header_generator.o message.o pEpEngine_mime.o
  48. libpEpMIME.a: $(LIB_OBJ)
  49. ${AR} rcs $@ $^
  50. %.o : %.cc %.hh
  51. ${CXX} ${CXXFLAGS} -I${PREFIX}/include -o $@ -c $<
  52. %.o : %.cc
  53. ${CXX} ${CXXFLAGS} -I${PREFIX}/include -o $@ -c $<
  54. clean:
  55. rm -vf *.o *.a
  56. srcclean:
  57. rm *.cc *.hh *.hxx
  58. install: lib
  59. mkdir -p "$(PREFIX)/lib/"
  60. cp -v libpEpMIME.a $(PREFIX)/lib
  61. uninstall:
  62. rm $(PREFIX)/lib/libpEpMIME.a