Makefile 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373
  1. #*******************************************************************************
  2. # Copyright (c) 2009, 2021 IBM Corp.
  3. #
  4. # All rights reserved. This program and the accompanying materials
  5. # are made available under the terms of the Eclipse Public License v2.0
  6. # and Eclipse Distribution License v1.0 which accompany this distribution.
  7. #
  8. # The Eclipse Public License is available at
  9. # https://www.eclipse.org/legal/epl-2.0/
  10. # and the Eclipse Distribution License is available at
  11. # http://www.eclipse.org/org/documents/edl-v10.php.
  12. #
  13. # Contributors:
  14. # Ian Craggs - initial API and implementation and/or initial documentation
  15. # Allan Stockdill-Mander - SSL updates
  16. # Andy Piper - various fixes
  17. # Ian Craggs - OSX build
  18. # Rainer Poisel - support for multi-core builds and cross-compilation
  19. #*******************************************************************************/
  20. # Note: on OS X you should install XCode and the associated command-line tools
  21. SHELL = /bin/sh
  22. .PHONY: clean mkdir install install-strip uninstall html strip-options
  23. MAJOR_VERSION := $(shell cat version.major)
  24. MINOR_VERSION := $(shell cat version.minor)
  25. PATCH_VERSION := $(shell cat version.patch)
  26. ifndef release.version
  27. release.version = $(MAJOR_VERSION).$(MINOR_VERSION).$(PATCH_VERSION)
  28. endif
  29. # determine current platform
  30. BUILD_TYPE ?= debug
  31. ifeq ($(OS),Windows_NT)
  32. OSTYPE ?= $(OS)
  33. MACHINETYPE ?= $(PROCESSOR_ARCHITECTURE)
  34. else
  35. OSTYPE ?= $(shell uname -s)
  36. MACHINETYPE ?= $(shell uname -m)
  37. build.level = $(shell date)
  38. endif # OS
  39. ifeq ($(OSTYPE),linux)
  40. OSTYPE = Linux
  41. endif
  42. # assume this is normally run in the main Paho directory
  43. ifndef srcdir
  44. srcdir = src
  45. endif
  46. ifndef blddir
  47. blddir = build/output
  48. endif
  49. ifndef blddir_work
  50. blddir_work = build
  51. endif
  52. ifndef docdir
  53. docdir = $(blddir)/doc
  54. endif
  55. ifndef docdir_work
  56. docdir_work = $(blddir)/../doc
  57. endif
  58. ifndef prefix
  59. prefix = /usr/local
  60. endif
  61. ifndef exec_prefix
  62. exec_prefix = ${prefix}
  63. endif
  64. bindir = $(exec_prefix)/bin
  65. includedir = $(prefix)/include
  66. libdir = $(exec_prefix)/lib
  67. datarootdir = $(prefix)/share
  68. mandir = $(datarootdir)/man
  69. man1dir = $(mandir)/man1
  70. man2dir = $(mandir)/man2
  71. man3dir = $(mandir)/man3
  72. SOURCE_FILES = $(wildcard $(srcdir)/*.c)
  73. SOURCE_FILES_C = $(filter-out $(srcdir)/MQTTAsync.c $(srcdir)/MQTTAsyncUtils.c $(srcdir)/MQTTVersion.c $(srcdir)/SSLSocket.c, $(SOURCE_FILES))
  74. SOURCE_FILES_CS = $(filter-out $(srcdir)/MQTTAsync.c $(srcdir)/MQTTAsyncUtils.c $(srcdir)/MQTTVersion.c, $(SOURCE_FILES))
  75. SOURCE_FILES_A = $(filter-out $(srcdir)/MQTTClient.c $(srcdir)/MQTTVersion.c $(srcdir)/SSLSocket.c, $(SOURCE_FILES))
  76. SOURCE_FILES_AS = $(filter-out $(srcdir)/MQTTClient.c $(srcdir)/MQTTVersion.c, $(SOURCE_FILES))
  77. HEADERS = $(srcdir)/*.h
  78. HEADERS_C = $(filter-out $(srcdir)/MQTTAsync.h, $(HEADERS))
  79. HEADERS_A = $(HEADERS)
  80. SAMPLE_FILES_C = MQTTClient_publish MQTTClient_publish_async MQTTClient_subscribe
  81. SYNC_SAMPLES = ${addprefix ${blddir}/samples/,${SAMPLE_FILES_C}}
  82. UTIL_FILES_CS = paho_cs_pub paho_cs_sub
  83. SYNC_UTILS = ${addprefix ${blddir}/samples/,${UTIL_FILES_CS}}
  84. SAMPLE_FILES_A = MQTTAsync_subscribe MQTTAsync_publish
  85. ASYNC_SAMPLES = ${addprefix ${blddir}/samples/,${SAMPLE_FILES_A}}
  86. UTIL_FILES_AS = paho_c_pub paho_c_sub
  87. ASYNC_UTILS = ${addprefix ${blddir}/samples/,${UTIL_FILES_AS}}
  88. TEST_FILES_C = test1 test15 test2 sync_client_test test_mqtt4sync test10
  89. SYNC_TESTS = ${addprefix ${blddir}/test/,${TEST_FILES_C}}
  90. TEST_FILES_CS = test3
  91. SYNC_SSL_TESTS = ${addprefix ${blddir}/test/,${TEST_FILES_CS}}
  92. TEST_FILES_A = test4 test45 test6 test9 test95 test_mqtt4async test11
  93. ASYNC_TESTS = ${addprefix ${blddir}/test/,${TEST_FILES_A}}
  94. TEST_FILES_AS = test5
  95. ASYNC_SSL_TESTS = ${addprefix ${blddir}/test/,${TEST_FILES_AS}}
  96. # The names of the four different libraries to be built
  97. MQTTLIB_C = paho-mqtt3c
  98. MQTTLIB_CS = paho-mqtt3cs
  99. MQTTLIB_A = paho-mqtt3a
  100. MQTTLIB_AS = paho-mqtt3as
  101. CC ?= gcc
  102. ifndef INSTALL
  103. INSTALL = install
  104. endif
  105. INSTALL_PROGRAM = $(INSTALL)
  106. INSTALL_DATA = $(INSTALL) -m 644
  107. DOXYGEN_COMMAND = doxygen
  108. VERSION = ${MAJOR_VERSION}.${MINOR_VERSION}
  109. MQTTLIB_C_NAME = lib${MQTTLIB_C}.so.${VERSION}
  110. MQTTLIB_CS_NAME = lib${MQTTLIB_CS}.so.${VERSION}
  111. MQTTLIB_A_NAME = lib${MQTTLIB_A}.so.${VERSION}
  112. MQTTLIB_AS_NAME = lib${MQTTLIB_AS}.so.${VERSION}
  113. MQTTVERSION_NAME = paho_c_version
  114. PAHO_C_PUB_NAME = paho_c_pub
  115. PAHO_C_SUB_NAME = paho_c_sub
  116. PAHO_CS_PUB_NAME = paho_cs_pub
  117. PAHO_CS_SUB_NAME = paho_cs_sub
  118. MQTTLIB_C_TARGET = ${blddir}/${MQTTLIB_C_NAME}
  119. MQTTLIB_CS_TARGET = ${blddir}/${MQTTLIB_CS_NAME}
  120. MQTTLIB_A_TARGET = ${blddir}/${MQTTLIB_A_NAME}
  121. MQTTLIB_AS_TARGET = ${blddir}/${MQTTLIB_AS_NAME}
  122. MQTTVERSION_TARGET = ${blddir}/${MQTTVERSION_NAME}
  123. PAHO_C_PUB_TARGET = ${blddir}/samples/${PAHO_C_PUB_NAME}
  124. PAHO_C_SUB_TARGET = ${blddir}/samples/${PAHO_C_SUB_NAME}
  125. PAHO_CS_PUB_TARGET = ${blddir}/samples/${PAHO_CS_PUB_NAME}
  126. PAHO_CS_SUB_TARGET = ${blddir}/samples/${PAHO_CS_SUB_NAME}
  127. #CCFLAGS_SO = -g -fPIC $(CFLAGS) -Os -Wall -fvisibility=hidden -I$(blddir_work)
  128. #FLAGS_EXE = $(LDFLAGS) -I ${srcdir} -pthread -L ${blddir}
  129. #FLAGS_EXES = $(LDFLAGS) -I ${srcdir} ${START_GROUP} -pthread -lssl -lcrypto ${END_GROUP} -L ${blddir}
  130. CCFLAGS_SO = -g -fPIC $(CFLAGS) -D_GNU_SOURCE -Os -Wall -fvisibility=hidden -I$(blddir_work) -DPAHO_MQTT_EXPORTS=1
  131. FLAGS_EXE = $(LDFLAGS) -I ${srcdir} ${START_GROUP} -pthread ${GAI_LIB} ${END_GROUP} -L ${blddir}
  132. FLAGS_EXES = $(LDFLAGS) -I ${srcdir} ${START_GROUP} -pthread ${GAI_LIB} -lssl -lcrypto ${END_GROUP} -L ${blddir}
  133. LDCONFIG ?= /sbin/ldconfig
  134. LDFLAGS_C = $(LDFLAGS) -shared -Wl,-init,$(MQTTCLIENT_INIT) $(START_GROUP) -pthread $(GAI_LIB) $(END_GROUP)
  135. LDFLAGS_CS = $(LDFLAGS) -shared $(START_GROUP) -pthread $(GAI_LIB) $(EXTRA_LIB) -lssl -lcrypto $(END_GROUP) -Wl,-init,$(MQTTCLIENT_INIT)
  136. LDFLAGS_A = $(LDFLAGS) -shared -Wl,-init,$(MQTTASYNC_INIT) $(START_GROUP) -pthread $(GAI_LIB) $(END_GROUP)
  137. LDFLAGS_AS = $(LDFLAGS) -shared $(START_GROUP) -pthread $(GAI_LIB) $(EXTRA_LIB) -lssl -lcrypto $(END_GROUP) -Wl,-init,$(MQTTASYNC_INIT)
  138. SED_COMMAND = sed \
  139. -e "s/@CLIENT_VERSION@/${release.version}/g" \
  140. -e "s/@BUILD_TIMESTAMP@/${build.level}/g"
  141. ifeq ($(OSTYPE),Linux)
  142. MQTTCLIENT_INIT = MQTTClient_init
  143. MQTTASYNC_INIT = MQTTAsync_init
  144. START_GROUP = -Wl,--start-group
  145. END_GROUP = -Wl,--end-group
  146. GAI_LIB = -lanl
  147. EXTRA_LIB = -ldl
  148. LDFLAGS_C += -Wl,-soname,lib$(MQTTLIB_C).so.${MAJOR_VERSION}
  149. LDFLAGS_CS += -Wl,-soname,lib$(MQTTLIB_CS).so.${MAJOR_VERSION} -Wl,-no-whole-archive
  150. LDFLAGS_A += -Wl,-soname,lib${MQTTLIB_A}.so.${MAJOR_VERSION}
  151. LDFLAGS_AS += -Wl,-soname,lib${MQTTLIB_AS}.so.${MAJOR_VERSION} -Wl,-no-whole-archive
  152. else ifeq ($(OSTYPE),Darwin)
  153. MQTTCLIENT_INIT = _MQTTClient_init
  154. MQTTASYNC_INIT = _MQTTAsync_init
  155. START_GROUP =
  156. END_GROUP =
  157. GAI_LIB =
  158. EXTRA_LIB = -ldl
  159. CCFLAGS_SO += -Wno-deprecated-declarations -DOSX -I /usr/local/opt/openssl/include
  160. LDFLAGS_C += -Wl,-install_name,lib$(MQTTLIB_C).so.${MAJOR_VERSION}
  161. LDFLAGS_CS += -Wl,-install_name,lib$(MQTTLIB_CS).so.${MAJOR_VERSION} -L /usr/local/opt/openssl/lib
  162. LDFLAGS_A += -Wl,-install_name,lib${MQTTLIB_A}.so.${MAJOR_VERSION}
  163. LDFLAGS_AS += -Wl,-install_name,lib${MQTTLIB_AS}.so.${MAJOR_VERSION} -L /usr/local/opt/openssl/lib
  164. FLAGS_EXE += -DOSX
  165. FLAGS_EXES += -L /usr/local/opt/openssl/lib
  166. LDCONFIG = echo
  167. endif
  168. all: build
  169. build: | mkdir ${MQTTLIB_C_TARGET} ${MQTTLIB_CS_TARGET} ${MQTTLIB_A_TARGET} ${MQTTLIB_AS_TARGET} ${MQTTVERSION_TARGET} ${SYNC_SAMPLES} ${SYNC_UTILS} ${ASYNC_SAMPLES} ${ASYNC_UTILS} ${SYNC_TESTS} ${SYNC_SSL_TESTS} ${ASYNC_TESTS} ${ASYNC_SSL_TESTS}
  170. clean:
  171. rm -rf ${blddir}/*
  172. rm -rf ${blddir_work}/*
  173. mkdir:
  174. -mkdir -p ${blddir}/samples
  175. -mkdir -p ${blddir}/test
  176. echo OSTYPE is $(OSTYPE)
  177. ${SYNC_TESTS}: ${blddir}/test/%: ${srcdir}/../test/%.c $(MQTTLIB_C_TARGET)
  178. ${CC} -DNOSTACKTRACE -DNOLOG_MESSAGES $(srcdir)/Thread.c -g -o $@ $< -l${MQTTLIB_C} ${FLAGS_EXE}
  179. ${SYNC_SSL_TESTS}: ${blddir}/test/%: ${srcdir}/../test/%.c $(MQTTLIB_CS_TARGET)
  180. ${CC} -g -o $@ $< -l${MQTTLIB_CS} ${FLAGS_EXES}
  181. ${ASYNC_TESTS}: ${blddir}/test/%: ${srcdir}/../test/%.c $(MQTTLIB_A_TARGET)
  182. ${CC} -g -o $@ $< -l${MQTTLIB_A} ${FLAGS_EXE}
  183. ${ASYNC_SSL_TESTS}: ${blddir}/test/%: ${srcdir}/../test/%.c $(MQTTLIB_AS_TARGET)
  184. ${CC} -g -o $@ $< -l${MQTTLIB_AS} ${FLAGS_EXES}
  185. ${SYNC_SAMPLES}: ${blddir}/samples/%: ${srcdir}/samples/%.c $(MQTTLIB_CS_TARGET)
  186. ${CC} -o $@ $< -l${MQTTLIB_CS} ${FLAGS_EXES}
  187. ${SYNC_UTILS}: ${blddir}/samples/%: ${srcdir}/samples/%.c ${srcdir}/samples/pubsub_opts.c $(MQTTLIB_CS_TARGET)
  188. ${CC} -o $@ $< -l${MQTTLIB_CS} ${FLAGS_EXES} ${srcdir}/samples/pubsub_opts.c
  189. ${ASYNC_SAMPLES}: ${blddir}/samples/%: ${srcdir}/samples/%.c $(MQTTLIB_AS_TARGET)
  190. ${CC} -o $@ $< -l${MQTTLIB_AS} ${FLAGS_EXES}
  191. ${ASYNC_UTILS}: ${blddir}/samples/%: ${srcdir}/samples/%.c ${srcdir}/samples/pubsub_opts.c $(MQTTLIB_AS_TARGET)
  192. ${CC} -o $@ $< -l${MQTTLIB_AS} ${FLAGS_EXES} ${srcdir}/samples/pubsub_opts.c
  193. $(blddir_work)/VersionInfo.h: $(srcdir)/VersionInfo.h.in
  194. -mkdir -p $(blddir_work)
  195. $(SED_COMMAND) $< > $@
  196. ${MQTTLIB_C_TARGET}: ${SOURCE_FILES_C} ${HEADERS_C} $(blddir_work)/VersionInfo.h
  197. ${CC} ${CCFLAGS_SO} -o $@ ${SOURCE_FILES_C} ${LDFLAGS_C}
  198. -ln -s lib$(MQTTLIB_C).so.${VERSION} ${blddir}/lib$(MQTTLIB_C).so.${MAJOR_VERSION}
  199. -ln -s lib$(MQTTLIB_C).so.${MAJOR_VERSION} ${blddir}/lib$(MQTTLIB_C).so
  200. ${MQTTLIB_CS_TARGET}: ${SOURCE_FILES_CS} ${HEADERS_C} $(blddir_work)/VersionInfo.h
  201. ${CC} ${CCFLAGS_SO} -o $@ ${SOURCE_FILES_CS} -DOPENSSL ${LDFLAGS_CS}
  202. -ln -s lib$(MQTTLIB_CS).so.${VERSION} ${blddir}/lib$(MQTTLIB_CS).so.${MAJOR_VERSION}
  203. -ln -s lib$(MQTTLIB_CS).so.${MAJOR_VERSION} ${blddir}/lib$(MQTTLIB_CS).so
  204. ${MQTTLIB_A_TARGET}: ${SOURCE_FILES_A} ${HEADERS_A} $(blddir_work)/VersionInfo.h
  205. ${CC} ${CCFLAGS_SO} -o $@ ${SOURCE_FILES_A} ${LDFLAGS_A}
  206. -ln -s lib$(MQTTLIB_A).so.${VERSION} ${blddir}/lib$(MQTTLIB_A).so.${MAJOR_VERSION}
  207. -ln -s lib$(MQTTLIB_A).so.${MAJOR_VERSION} ${blddir}/lib$(MQTTLIB_A).so
  208. ${MQTTLIB_AS_TARGET}: ${SOURCE_FILES_AS} ${HEADERS_A} $(blddir_work)/VersionInfo.h
  209. ${CC} ${CCFLAGS_SO} -o $@ ${SOURCE_FILES_AS} -DOPENSSL ${LDFLAGS_AS}
  210. -ln -s lib$(MQTTLIB_AS).so.${VERSION} ${blddir}/lib$(MQTTLIB_AS).so.${MAJOR_VERSION}
  211. -ln -s lib$(MQTTLIB_AS).so.${MAJOR_VERSION} ${blddir}/lib$(MQTTLIB_AS).so
  212. ${MQTTVERSION_TARGET}: $(srcdir)/MQTTVersion.c $(srcdir)/MQTTAsync.h $(MQTTLIB_A_TARGET)
  213. ${CC} ${FLAGS_EXE} -o $@ -l${MQTTLIB_A} $(srcdir)/MQTTVersion.c -ldl
  214. strip_options:
  215. $(eval INSTALL_OPTS := -s)
  216. install-strip: build strip_options install
  217. install: build
  218. mkdir -p $(DESTDIR)$(PREFIX)${includedir}
  219. $(INSTALL_DATA) ${INSTALL_OPTS} ${MQTTLIB_C_TARGET} $(DESTDIR)${libdir}
  220. $(INSTALL_DATA) ${INSTALL_OPTS} ${MQTTLIB_CS_TARGET} $(DESTDIR)${libdir}
  221. $(INSTALL_DATA) ${INSTALL_OPTS} ${MQTTLIB_A_TARGET} $(DESTDIR)${libdir}
  222. $(INSTALL_DATA) ${INSTALL_OPTS} ${MQTTLIB_AS_TARGET} $(DESTDIR)${libdir}
  223. $(INSTALL_PROGRAM) ${INSTALL_OPTS} ${MQTTVERSION_TARGET} $(DESTDIR)${bindir}
  224. $(INSTALL_PROGRAM) ${INSTALL_OPTS} ${PAHO_C_PUB_TARGET} $(DESTDIR)${bindir}
  225. $(INSTALL_PROGRAM) ${INSTALL_OPTS} ${PAHO_C_SUB_TARGET} $(DESTDIR)${bindir}
  226. $(INSTALL_PROGRAM) ${INSTALL_OPTS} ${PAHO_CS_PUB_TARGET} $(DESTDIR)${bindir}
  227. $(INSTALL_PROGRAM) ${INSTALL_OPTS} ${PAHO_CS_SUB_TARGET} $(DESTDIR)${bindir}
  228. $(LDCONFIG) $(DESTDIR)${libdir}
  229. ln -s lib$(MQTTLIB_C).so.${MAJOR_VERSION} $(DESTDIR)${libdir}/lib$(MQTTLIB_C).so
  230. ln -s lib$(MQTTLIB_CS).so.${MAJOR_VERSION} $(DESTDIR)${libdir}/lib$(MQTTLIB_CS).so
  231. ln -s lib$(MQTTLIB_A).so.${MAJOR_VERSION} $(DESTDIR)${libdir}/lib$(MQTTLIB_A).so
  232. ln -s lib$(MQTTLIB_AS).so.${MAJOR_VERSION} $(DESTDIR)${libdir}/lib$(MQTTLIB_AS).so
  233. @if test ! -f $(DESTDIR)${libdir}/lib$(MQTTLIB_C).so.${MAJOR_VERSION}; then ln -s lib$(MQTTLIB_C).so.${VERSION} $(DESTDIR)${libdir}/lib$(MQTTLIB_C).so.${MAJOR_VERSION}; fi
  234. @if test ! -f $(DESTDIR)${libdir}/lib$(MQTTLIB_CS).so.${MAJOR_VERSION}; then ln -s lib$(MQTTLIB_CS).so.${VERSION} $(DESTDIR)${libdir}/lib$(MQTTLIB_CS).so.${MAJOR_VERSION}; fi
  235. @if test ! -f $(DESTDIR)${libdir}/lib$(MQTTLIB_A).so.${MAJOR_VERSION}; then ln -s lib$(MQTTLIB_A).so.${VERSION} $(DESTDIR)${libdir}/lib$(MQTTLIB_A).so.${MAJOR_VERSION}; fi
  236. @if test ! -f $(DESTDIR)${libdir}/lib$(MQTTLIB_AS).so.${MAJOR_VERSION}; then ln -s lib$(MQTTLIB_AS).so.${VERSION} $(DESTDIR)${libdir}/lib$(MQTTLIB_AS).so.${MAJOR_VERSION}; fi
  237. $(INSTALL_DATA) ${srcdir}/MQTTAsync.h $(DESTDIR)${includedir}
  238. $(INSTALL_DATA) ${srcdir}/MQTTClient.h $(DESTDIR)${includedir}
  239. $(INSTALL_DATA) ${srcdir}/MQTTClientPersistence.h $(DESTDIR)${includedir}
  240. $(INSTALL_DATA) ${srcdir}/MQTTProperties.h $(DESTDIR)${includedir}
  241. $(INSTALL_DATA) ${srcdir}/MQTTReasonCodes.h $(DESTDIR)${includedir}
  242. $(INSTALL_DATA) ${srcdir}/MQTTSubscribeOpts.h $(DESTDIR)${includedir}
  243. $(INSTALL_DATA) ${srcdir}/MQTTExportDeclarations.h $(DESTDIR)${includedir}
  244. - $(INSTALL_DATA) doc/man/man1/paho_c_pub.1 $(DESTDIR)${man1dir}
  245. - $(INSTALL_DATA) doc/man/man1/paho_c_sub.1 $(DESTDIR)${man1dir}
  246. - $(INSTALL_DATA) doc/man/man1/paho_cs_pub.1 $(DESTDIR)${man1dir}
  247. - $(INSTALL_DATA) doc/man/man1/paho_cs_sub.1 $(DESTDIR)${man1dir}
  248. ifneq ("$(wildcard ${blddir}/doc/MQTTClient/man/man3/MQTTClient.h.3)","")
  249. - $(INSTALL_DATA) ${blddir}/doc/MQTTClient/man/man3/MQTTClient.h.3 $(DESTDIR)${man3dir}
  250. endif
  251. ifneq ("$(wildcard ${blddir}/doc/MQTTAsync/man/man3/MQTTAsync.h.3)","")
  252. - $(INSTALL_DATA) ${blddir}/doc/MQTTAsync/man/man3/MQTTAsync.h.3 $(DESTDIR)${man3dir}
  253. endif
  254. uninstall:
  255. - rm $(DESTDIR)${libdir}/${MQTTLIB_C_NAME}
  256. - rm $(DESTDIR)${libdir}/${MQTTLIB_CS_NAME}
  257. - rm $(DESTDIR)${libdir}/${MQTTLIB_A_NAME}
  258. - rm $(DESTDIR)${libdir}/${MQTTLIB_AS_NAME}
  259. - rm $(DESTDIR)${bindir}/${MQTTVERSION_NAME}
  260. - rm $(DESTDIR)${bindir}/${PAHO_C_PUB_NAME}
  261. - rm $(DESTDIR)${bindir}/${PAHO_C_SUB_NAME}
  262. - rm $(DESTDIR)${bindir}/${PAHO_CS_PUB_NAME}
  263. - rm $(DESTDIR)${bindir}/${PAHO_CS_SUB_NAME}
  264. $(LDCONFIG) $(DESTDIR)${libdir}
  265. - rm $(DESTDIR)${libdir}/lib$(MQTTLIB_C).so
  266. - rm $(DESTDIR)${libdir}/lib$(MQTTLIB_CS).so
  267. - rm $(DESTDIR)${libdir}/lib$(MQTTLIB_A).so
  268. - rm $(DESTDIR)${libdir}/lib$(MQTTLIB_AS).so
  269. - rm $(DESTDIR)${libdir}/lib$(MQTTLIB_C).so.${MAJOR_VERSION}
  270. - rm $(DESTDIR)${libdir}/lib$(MQTTLIB_CS).so.${MAJOR_VERSION}
  271. - rm $(DESTDIR)${libdir}/lib$(MQTTLIB_A).so.${MAJOR_VERSION}
  272. - rm $(DESTDIR)${libdir}/lib$(MQTTLIB_AS).so.${MAJOR_VERSION}
  273. - rm $(DESTDIR)${includedir}/MQTTAsync.h
  274. - rm $(DESTDIR)${includedir}/MQTTClient.h
  275. - rm $(DESTDIR)${includedir}/MQTTClientPersistence.h
  276. - rm $(DESTDIR)${includedir}/MQTTProperties.h
  277. - rm $(DESTDIR)${includedir}/MQTTReasonCodes.h
  278. - rm $(DESTDIR)${includedir}/MQTTSubscribeOpts.h
  279. - rm $(DESTDIR)${includedir}/MQTTExportDeclarations.h
  280. - rm $(DESTDIR)${man1dir}/paho_c_pub.1
  281. - rm $(DESTDIR)${man1dir}/paho_c_sub.1
  282. - rm $(DESTDIR)${man1dir}/paho_cs_pub.1
  283. - rm $(DESTDIR)${man1dir}/paho_cs_sub.1
  284. ifneq ("$(wildcard $(DESTDIR)${man3dir}/MQTTClient.h.3)","")
  285. - rm $(DESTDIR)${man3dir}/MQTTClient.h.3
  286. endif
  287. ifneq ("$(wildcard $(DESTDIR)${man3dir}/MQTTAsync.h.3)","")
  288. - rm $(DESTDIR)${man3dir}/MQTTAsync.h.3
  289. endif
  290. REGEX_DOXYGEN := \
  291. 's;@PROJECT_SOURCE_DIR@/src/\?;;' \
  292. 's;@PROJECT_SOURCE_DIR@;..;' \
  293. 's;@CMAKE_CURRENT_BINARY_DIR@;../build/output;'
  294. SED_DOXYGEN := $(foreach sed_exp,$(REGEX_DOXYGEN),-e $(sed_exp))
  295. define process_doxygen
  296. cd ${srcdir}; sed $(SED_DOXYGEN) ../doc/${1}.in > ../$(docdir_work)/${1}
  297. cd ${srcdir}; $(DOXYGEN_COMMAND) ../$(docdir_work)/${1}
  298. endef
  299. html:
  300. -mkdir -p $(docdir_work)
  301. -mkdir -p ${docdir}
  302. $(call process_doxygen,DoxyfileV3ClientAPI)
  303. $(call process_doxygen,DoxyfileV3AsyncAPI)
  304. $(call process_doxygen,DoxyfileV3ClientInternal)