Makefile build fixes for message-timestamp plugin.

This commit is contained in:
Roger A. Light 2020-10-13 16:49:18 +01:00
parent a86ebe541c
commit 687ca36c07
3 changed files with 49 additions and 4 deletions

View File

@ -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 :

26
plugins/Makefile Normal file
View File

@ -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

View File

@ -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"