mirror of
https://github.com/eclipse-mosquitto/mosquitto.git
synced 2026-09-21 15:23:46 +08:00
Build the CPP static library with bare Makefiles
In order to make the CPP static library include all objects from the C static library, the list of objects (MOSQ_OBJS) is isolated into objects.mk to be used for building the C and CPP static libraries. Signed-off-by: Lance Chen <cyen0312@gmail.com>
This commit is contained in:
+9
-2
@@ -1,4 +1,5 @@
|
||||
include ../../config.mk
|
||||
include ../objects.mk
|
||||
|
||||
ifneq ($(UNAME),SunOS)
|
||||
LIB_LDFLAGS:=$(LDFLAGS) -Wl,-soname,libmosquittopp.so.${SOVERSION}
|
||||
@@ -6,26 +7,32 @@ endif
|
||||
|
||||
.PHONY : clean install
|
||||
|
||||
all : libmosquittopp.so.${SOVERSION}
|
||||
all : libmosquittopp.so.${SOVERSION} libmosquittopp.a
|
||||
|
||||
install : all
|
||||
$(INSTALL) -d ${DESTDIR}$(prefix)/lib${LIB_SUFFIX}/
|
||||
$(INSTALL) -s --strip-program=${CROSS_COMPILE}${STRIP} libmosquittopp.so.${SOVERSION} ${DESTDIR}${prefix}/lib${LIB_SUFFIX}/libmosquittopp.so.${SOVERSION}
|
||||
ln -sf libmosquittopp.so.${SOVERSION} ${DESTDIR}${prefix}/lib${LIB_SUFFIX}/libmosquittopp.so
|
||||
$(INSTALL) libmosquittopp.a ${DESTDIR}${prefix}/lib${LIB_SUFFIX}/libmosquittopp.a
|
||||
${CROSS_COMPILE}${STRIP} -g --strip-unneeded ${DESTDIR}${prefix}/lib${LIB_SUFFIX}/libmosquittopp.a
|
||||
$(INSTALL) -d ${DESTDIR}${prefix}/include/
|
||||
$(INSTALL) mosquittopp.h ${DESTDIR}${prefix}/include/mosquittopp.h
|
||||
|
||||
uninstall :
|
||||
-rm -f ${DESTDIR}${prefix}/lib${LIB_SUFFIX}/libmosquittopp.so.${SOVERSION}
|
||||
-rm -f ${DESTDIR}${prefix}/lib${LIB_SUFFIX}/libmosquittopp.so
|
||||
-rm -f ${DESTDIR}${prefix}/lib${LIB_SUFFIX}/libmosquittopp.a
|
||||
-rm -f ${DESTDIR}${prefix}/include/mosquittopp.h
|
||||
|
||||
clean :
|
||||
-rm -f *.o libmosquittopp.so.${SOVERSION}
|
||||
-rm -f *.o libmosquittopp.so.${SOVERSION} libmosquittopp.a
|
||||
|
||||
libmosquittopp.so.${SOVERSION} : mosquittopp.o
|
||||
${CROSS_COMPILE}$(CXX) -shared $(LIB_LDFLAGS) $< -o $@ ../libmosquitto.so.${SOVERSION}
|
||||
|
||||
libmosquittopp.a : mosquittopp.o ${MOSQ_C_OBJS}
|
||||
${CROSS_COMPILE}$(AR) cr $@ $^
|
||||
|
||||
mosquittopp.o : mosquittopp.cpp mosquittopp.h
|
||||
${CROSS_COMPILE}$(CXX) $(LIB_CXXFLAGS) -c $< -o $@
|
||||
|
||||
|
||||
Reference in New Issue
Block a user