From 59f11aa0942732d11802d190c2be151f58853a6c Mon Sep 17 00:00:00 2001 From: "Roger A. Light" Date: Mon, 17 Jul 2017 20:47:57 +0100 Subject: [PATCH] Improve static client building. --- client/Makefile | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/client/Makefile b/client/Makefile index 2bb6bbaf..435714b3 100644 --- a/client/Makefile +++ b/client/Makefile @@ -1,10 +1,12 @@ include ../config.mk -.PHONY: all install uninstall reallyclean clean +.PHONY: all install uninstall reallyclean clean static static_pub static_sub all : mosquitto_pub mosquitto_sub static : static_pub static_sub + # This makes mosquitto_pub/sub versions that are statically linked with + # libmosquitto only. static_pub : pub_client.o client_shared.o ../lib/libmosquitto.a ${CROSS_COMPILE}${CC} $^ -o mosquitto_pub ${CLIENT_LDFLAGS} -lssl -lcrypto -lpthread @@ -30,6 +32,9 @@ client_shared.o : client_shared.c client_shared.h ../lib/libmosquitto.so.${SOVERSION} : $(MAKE) -C ../lib +../lib/libmosquitto.a : + $(MAKE) -C ../lib libmosquitto.a + install : all $(INSTALL) -d ${DESTDIR}$(prefix)/bin $(INSTALL) ${STRIP_OPTS} mosquitto_pub ${DESTDIR}${prefix}/bin/mosquitto_pub