Makefile 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  1. include config.mk
  2. DIRS=lib apps client plugins src
  3. DOCDIRS=man
  4. DISTDIRS=man
  5. DISTFILES= \
  6. apps/ \
  7. client/ \
  8. cmake/ \
  9. deps/ \
  10. examples/ \
  11. include/ \
  12. installer/ \
  13. lib/ \
  14. logo/ \
  15. man/ \
  16. misc/ \
  17. plugins/ \
  18. security/ \
  19. service/ \
  20. snap/ \
  21. src/ \
  22. test/ \
  23. \
  24. CMakeLists.txt \
  25. CONTRIBUTING.md \
  26. ChangeLog.txt \
  27. LICENSE.txt \
  28. Makefile \
  29. about.html \
  30. aclfile.example \
  31. config.h \
  32. config.mk \
  33. edl-v10 \
  34. epl-v20 \
  35. libmosquitto.pc.in \
  36. libmosquittopp.pc.in \
  37. mosquitto.conf \
  38. NOTICE.md \
  39. pskfile.example \
  40. pwfile.example \
  41. README-compiling.md \
  42. README-letsencrypt.md \
  43. README-windows.txt \
  44. README.md
  45. .PHONY : all mosquitto api docs binary check clean reallyclean test install uninstall dist sign copy localdocker
  46. all : $(MAKE_ALL)
  47. api :
  48. mkdir -p api p
  49. naturaldocs -o HTML api -i lib -p p
  50. rm -rf p
  51. docs :
  52. set -e; for d in ${DOCDIRS}; do $(MAKE) -C $${d}; done
  53. binary : mosquitto
  54. mosquitto :
  55. ifeq ($(UNAME),Darwin)
  56. $(error Please compile using CMake on Mac OS X)
  57. endif
  58. set -e; for d in ${DIRS}; do $(MAKE) -C $${d}; done
  59. clean :
  60. set -e; for d in ${DIRS}; do $(MAKE) -C $${d} clean; done
  61. set -e; for d in ${DOCDIRS}; do $(MAKE) -C $${d} clean; done
  62. $(MAKE) -C test clean
  63. reallyclean :
  64. set -e; for d in ${DIRS}; do $(MAKE) -C $${d} reallyclean; done
  65. set -e; for d in ${DOCDIRS}; do $(MAKE) -C $${d} reallyclean; done
  66. $(MAKE) -C test reallyclean
  67. -rm -f *.orig
  68. check : test
  69. test : mosquitto
  70. $(MAKE) -C test test
  71. ptest : mosquitto
  72. $(MAKE) -C test ptest
  73. utest : mosquitto
  74. $(MAKE) -C test utest
  75. install : all
  76. set -e; for d in ${DIRS}; do $(MAKE) -C $${d} install; done
  77. ifeq ($(WITH_DOCS),yes)
  78. set -e; for d in ${DOCDIRS}; do $(MAKE) -C $${d} install; done
  79. endif
  80. $(INSTALL) -d "${DESTDIR}/etc/mosquitto"
  81. $(INSTALL) -m 644 mosquitto.conf "${DESTDIR}/etc/mosquitto/mosquitto.conf.example"
  82. $(INSTALL) -m 644 aclfile.example "${DESTDIR}/etc/mosquitto/aclfile.example"
  83. $(INSTALL) -m 644 pwfile.example "${DESTDIR}/etc/mosquitto/pwfile.example"
  84. $(INSTALL) -m 644 pskfile.example "${DESTDIR}/etc/mosquitto/pskfile.example"
  85. uninstall :
  86. set -e; for d in ${DIRS}; do $(MAKE) -C $${d} uninstall; done
  87. rm -f "${DESTDIR}/etc/mosquitto/mosquitto.conf.example"
  88. rm -f "${DESTDIR}/etc/mosquitto/aclfile.example"
  89. rm -f "${DESTDIR}/etc/mosquitto/pwfile.example"
  90. rm -f "${DESTDIR}/etc/mosquitto/pskfile.example"
  91. dist : reallyclean
  92. set -e; for d in ${DISTDIRS}; do $(MAKE) -C $${d} dist; done
  93. mkdir -p dist/mosquitto-${VERSION}
  94. cp -r ${DISTFILES} dist/mosquitto-${VERSION}/
  95. cd dist; tar -zcf mosquitto-${VERSION}.tar.gz mosquitto-${VERSION}/
  96. sign : dist
  97. cd dist; gpg --detach-sign -a mosquitto-${VERSION}.tar.gz
  98. copy : sign
  99. cd dist; scp mosquitto-${VERSION}.tar.gz mosquitto-${VERSION}.tar.gz.asc mosquitto:site/mosquitto.org/files/source/
  100. scp ChangeLog.txt mosquitto:site/mosquitto.org/
  101. coverage :
  102. lcov --capture --directory . --output-file coverage.info
  103. genhtml coverage.info --output-directory out
  104. localdocker : reallyclean
  105. set -e; for d in ${DISTDIRS}; do $(MAKE) -C $${d} dist; done
  106. rm -rf dockertmp/
  107. mkdir -p dockertmp/mosquitto-${VERSION}
  108. cp -r ${DISTFILES} dockertmp/mosquitto-${VERSION}/
  109. cd dockertmp/; tar -zcf mosq.tar.gz mosquitto-${VERSION}/
  110. cp dockertmp/mosq.tar.gz docker/local
  111. rm -rf dockertmp/
  112. cd docker/local && docker build . -t eclipse-mosquitto:local