From 687ca36c07e935ca83b0fbac693d9fffcf76609c Mon Sep 17 00:00:00 2001 From: "Roger A. Light" Date: Tue, 13 Oct 2020 16:49:18 +0100 Subject: [PATCH] Makefile build fixes for message-timestamp plugin. --- apps/Makefile | 3 +-- plugins/Makefile | 26 ++++++++++++++++++++++++++ plugins/message-timestamp/Makefile | 24 ++++++++++++++++++++++-- 3 files changed, 49 insertions(+), 4 deletions(-) create mode 100644 plugins/Makefile diff --git a/apps/Makefile b/apps/Makefile index 910fcc4d..c31ef483 100644 --- a/apps/Makefile +++ b/apps/Makefile @@ -17,8 +17,7 @@ reallyclean : set -e; for d in ${DIRS}; do $(MAKE) -C $${d} $@; done check : test - -test : mosquitto +test : set -e; for d in ${DIRS}; do $(MAKE) -C $${d} $@; done install : diff --git a/plugins/Makefile b/plugins/Makefile new file mode 100644 index 00000000..c2ca7875 --- /dev/null +++ b/plugins/Makefile @@ -0,0 +1,26 @@ +DIRS= \ + message-timestamp + +.PHONY : all binary check clean reallyclean test install uninstall + +all : + set -e; for d in ${DIRS}; do $(MAKE) -C $${d}; done + +binary : + set -e; for d in ${DIRS}; do $(MAKE) -C $${d} $@; done + +clean : + set -e; for d in ${DIRS}; do $(MAKE) -C $${d} $@; done + +reallyclean : + set -e; for d in ${DIRS}; do $(MAKE) -C $${d} $@; done + +check : test +test : + set -e; for d in ${DIRS}; do $(MAKE) -C $${d} $@; done + +install : + set -e; for d in ${DIRS}; do $(MAKE) -C $${d} $@; done + +uninstall : + set -e; for d in ${DIRS}; do $(MAKE) -C $${d} $@; done diff --git a/plugins/message-timestamp/Makefile b/plugins/message-timestamp/Makefile index 77563d71..f7383c4f 100644 --- a/plugins/message-timestamp/Makefile +++ b/plugins/message-timestamp/Makefile @@ -1,4 +1,24 @@ -all : mosquitto_timestamp.so +.PHONY : all binary check clean reallyclean test install uninstall -mosquitto_timestamp.so : mosquitto_timestamp.c +PLUGIN_NAME=mosquitto_message_timestamp + +all : binary + +binary : ${PLUGIN_NAME}.so + +${PLUGIN_NAME}.so : ${PLUGIN_NAME}.c $(CC) -I../../include -fPIC -shared $< -o $@ + +reallyclean : clean +clean: + -rm -f *.o ${PLUGIN_NAME}.so *.gcda *.gcno + +check: test +test: + +install: ${PLUGIN_NAME}.so + $(INSTALL) -d "${DESTDIR}$(prefix)/lib" + $(INSTALL) ${STRIP_OPTS} ${PLUGIN_NAME}.so "${DESTDIR}${prefix}/lib/${PLUGIN_NAME}.so" + +uninstall : + -rm -f "${DESTDIR}${prefix}/lib/${PLUGIN_NAME}.so"