Skip to content

Commit

Permalink
Separate the C and C++ static libraries.
Browse files Browse the repository at this point in the history
  • Loading branch information
ralight committed Jun 15, 2016
1 parent 2286caa commit fa2d314
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 37 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ test/broker/c/auth_plugin.so
test/broker/c/*.test

lib/cpp/libmosquittopp.so*
lib/cpp/libmosquittopp.a
lib/libmosquitto.so*
lib/libmosquitto.a

Expand Down
35 changes: 32 additions & 3 deletions lib/Makefile
Original file line number Diff line number Diff line change
@@ -1,8 +1,37 @@
include ../config.mk
include objects.mk

.PHONY : really clean install

MOSQ_OBJS=mosquitto.o \
handle_connack.o \
handle_ping.o \
handle_pubackcomp.o \
handle_publish.o \
handle_pubrec.o \
handle_pubrel.o \
handle_suback.o \
handle_unsuback.o \
helpers.o \
logging_mosq.o \
memory_mosq.o \
messages_mosq.o \
net_mosq.o \
packet_mosq.o \
read_handle.o \
send_connect.o \
send_disconnect.o \
send_mosq.o \
send_publish.o \
send_subscribe.o \
send_unsubscribe.o \
socks_mosq.o \
srv_mosq.o \
thread_mosq.o \
time_mosq.o \
tls_mosq.o \
util_mosq.o \
will_mosq.o

ALL_DEPS=libmosquitto.so.${SOVERSION}

ifeq ($(WITH_STATIC_LIBRARIES),yes)
Expand Down Expand Up @@ -36,10 +65,10 @@ clean :
-rm -f *.o libmosquitto.so.${SOVERSION} libmosquitto.so libmosquitto.a
$(MAKE) -C cpp clean

libmosquitto.so.${SOVERSION} : ${MOSQ_C_OBJS}
libmosquitto.so.${SOVERSION} : ${MOSQ_OBJS}
${CROSS_COMPILE}$(CC) -shared $(LIB_LDFLAGS) $^ -o $@ ${LIB_LIBS}

libmosquitto.a : ${MOSQ_C_OBJS}
libmosquitto.a : ${MOSQ_OBJS}
${CROSS_COMPILE}$(AR) cr $@ $^

mosquitto.o : mosquitto.c mosquitto.h
Expand Down
3 changes: 1 addition & 2 deletions lib/cpp/Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
include ../../config.mk
include ../objects.mk

ifneq ($(UNAME),SunOS)
LIB_LDFLAGS:=$(LDFLAGS) -Wl,-soname,libmosquittopp.so.${SOVERSION}
Expand Down Expand Up @@ -38,7 +37,7 @@ clean :
libmosquittopp.so.${SOVERSION} : mosquittopp.o
${CROSS_COMPILE}$(CXX) -shared $(LIB_LDFLAGS) $< -o $@ ../libmosquitto.so.${SOVERSION}

libmosquittopp.a : mosquittopp.o ${MOSQ_C_OBJS}
libmosquittopp.a : mosquittopp.o
${CROSS_COMPILE}$(AR) cr $@ $^

mosquittopp.o : mosquittopp.cpp mosquittopp.h
Expand Down
32 changes: 0 additions & 32 deletions lib/objects.mk

This file was deleted.

0 comments on commit fa2d314

Please sign in to comment.