diff --git a/Makefile b/Makefile index 322825c20d11b51f0989ee15a80c2f7cc87188cf..9f9f002d362ec9558b4d083a57c4caa99f48e37e 100755 --- a/Makefile +++ b/Makefile @@ -23,6 +23,24 @@ SHELL = /bin/sh .PHONY: clean, mkdir, install, uninstall, html +ifndef release.version + release.version = 1.0.3 +endif + +# determine current platform +BUILD_TYPE ?= debug +ifeq ($(OS),Windows_NT) + OSTYPE ?= $(OS) + MACHINETYPE ?= $(PROCESSOR_ARCHITECTURE) +else + OSTYPE ?= $(shell uname -s) + MACHINETYPE ?= $(shell uname -m) + build.level = $(shell date) +endif # OS +ifeq ($(OSTYPE),linux) + OSTYPE = Linux +endif + # assume this is normally run in the main Paho directory ifndef srcdir srcdir = src @@ -78,19 +96,6 @@ MQTTLIB_CS = paho-mqtt3cs MQTTLIB_A = paho-mqtt3a MQTTLIB_AS = paho-mqtt3as -# determine current platform -BUILD_TYPE ?= debug -ifeq ($(OS),Windows_NT) - OSTYPE ?= $(OS) - MACHINETYPE ?= $(PROCESSOR_ARCHITECTURE) -else - OSTYPE ?= $(shell uname -s) - MACHINETYPE ?= $(shell uname -m) -endif # OS -ifeq ($(OSTYPE),linux) - OSTYPE = Linux -endif - CC ?= gcc ifndef INSTALL @@ -121,6 +126,8 @@ LDFLAGS_AS = $(LDFLAGS) -shared $(START_GROUP) -lpthread $(EXTRA_LIB) -lssl -lcr ifeq ($(OSTYPE),Linux) +SED_COMMAND = sed -i "s/\#\#MQTTCLIENT_VERSION_TAG\#\#/${release.version}/g; s/\#\#MQTTCLIENT_BUILD_TAG\#\#/${build.level}/g" + MQTTCLIENT_INIT = MQTTClient_init MQTTASYNC_INIT = MQTTAsync_init START_GROUP = -Wl,--start-group @@ -135,6 +142,8 @@ LDFLAGS_AS += -Wl,-soname,lib${MQTTLIB_AS}.so.${MAJOR_VERSION} -Wl,-no-whole-arc else ifeq ($(OSTYPE),Darwin) +SED_COMMAND = sed -i "" -e "s/\#\#MQTTCLIENT_VERSION_TAG\#\#/${release.version}/g" -e "s/\#\#MQTTCLIENT_BUILD_TAG\#\#/${build.level}/g" + MQTTCLIENT_INIT = _MQTTClient_init MQTTASYNC_INIT = _MQTTAsync_init START_GROUP = @@ -181,21 +190,25 @@ ${ASYNC_SAMPLES}: ${blddir}/samples/%: ${srcdir}/samples/%.c $(MQTTLIB_A_TARGET) ${CC} -o $@ $< -l${MQTTLIB_A} ${FLAGS_EXE} ${MQTTLIB_C_TARGET}: ${SOURCE_FILES_C} ${HEADERS_C} + $(SED_COMMAND) $(srcdir)/MQTTClient.c ${CC} ${CCFLAGS_SO} -o $@ ${SOURCE_FILES_C} ${LDFLAGS_C} -ln -s lib$(MQTTLIB_C).so.${VERSION} ${blddir}/lib$(MQTTLIB_C).so.${MAJOR_VERSION} -ln -s lib$(MQTTLIB_C).so.${MAJOR_VERSION} ${blddir}/lib$(MQTTLIB_C).so ${MQTTLIB_CS_TARGET}: ${SOURCE_FILES_CS} ${HEADERS_C} + $(SED_COMMAND) $(srcdir)/MQTTClient.c ${CC} ${CCFLAGS_SO} -o $@ ${SOURCE_FILES_CS} -DOPENSSL ${LDFLAGS_CS} -ln -s lib$(MQTTLIB_CS).so.${VERSION} ${blddir}/lib$(MQTTLIB_CS).so.${MAJOR_VERSION} -ln -s lib$(MQTTLIB_CS).so.${MAJOR_VERSION} ${blddir}/lib$(MQTTLIB_CS).so ${MQTTLIB_A_TARGET}: ${SOURCE_FILES_A} ${HEADERS_A} + $(SED_COMMAND) $(srcdir)/MQTTAsync.c ${CC} ${CCFLAGS_SO} -o $@ ${SOURCE_FILES_A} ${LDFLAGS_A} -ln -s lib$(MQTTLIB_A).so.${VERSION} ${blddir}/lib$(MQTTLIB_A).so.${MAJOR_VERSION} -ln -s lib$(MQTTLIB_A).so.${MAJOR_VERSION} ${blddir}/lib$(MQTTLIB_A).so ${MQTTLIB_AS_TARGET}: ${SOURCE_FILES_AS} ${HEADERS_A} + $(SED_COMMAND) $(srcdir)/MQTTAsync.c ${CC} ${CCFLAGS_SO} -o $@ ${SOURCE_FILES_AS} -DOPENSSL ${LDFLAGS_AS} -ln -s lib$(MQTTLIB_AS).so.${VERSION} ${blddir}/lib$(MQTTLIB_AS).so.${MAJOR_VERSION} -ln -s lib$(MQTTLIB_AS).so.${MAJOR_VERSION} ${blddir}/lib$(MQTTLIB_AS).so diff --git a/src/MQTTAsync.h b/src/MQTTAsync.h index c5d4d8f182eb97510f5519f9ba7c53dc69e31118..579ea80d5e993a5b2116cca1e3c00068904cd81b 100644 --- a/src/MQTTAsync.h +++ b/src/MQTTAsync.h @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2009, 2014 IBM Corp. + * Copyright (c) 2009, 2015 IBM Corp. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 @@ -23,7 +23,7 @@ * @cond MQTTAsync_main * @mainpage Asynchronous MQTT client library for C * - * © Copyright IBM Corp. 2009, 2014 + * © Copyright IBM Corp. 2009, 2015 * * @brief An Asynchronous MQTT client library for C. * @@ -447,7 +447,7 @@ DLLExport int MQTTAsync_setCallbacks(MQTTAsync handle, void* context, MQTTAsync_ * @param serverURI A null-terminated string specifying the server to * which the client will connect. It takes the form protocol://host:port. * protocol must be tcp or ssl. For host, you can - * specify either an IP address or a domain name. For instance, to connect to + * specify either an IP address or a host name. For instance, to connect to * a server running on the local machines with the default MQTT port, specify * tcp://localhost:1883. * @param clientId The client identifier passed to the server when the diff --git a/src/MQTTClient.h b/src/MQTTClient.h index 222bea5c660a3a302589b7836d49692954a1b8bb..21b74d7b7c46a3695539bd59e05a6975f8205c27 100644 --- a/src/MQTTClient.h +++ b/src/MQTTClient.h @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2009, 2014 IBM Corp. + * Copyright (c) 2009, 2015 IBM Corp. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 @@ -38,7 +38,7 @@ * @endcond * @cond MQTTClient_main * @mainpage MQTT Client library for C - * © Copyright IBM Corp. 2009, 2014 + * © Copyright IBM Corp. 2009, 2015 * * @brief An MQTT client library in C. * @@ -370,8 +370,9 @@ DLLExport int MQTTClient_setCallbacks(MQTTClient handle, void* context, MQTTClie * this function. * @param serverURI A null-terminated string specifying the server to * which the client will connect. It takes the form protocol://host:port. - * Currently, protocol must be tcp. For host, you can - * specify either an IP address or a domain name. For instance, to connect to + * Currently, protocol must be tcp or ssl. + * For host, you can + * specify either an IP address or a host name. For instance, to connect to * a server running on the local machines with the default MQTT port, specify * tcp://localhost:1883. * @param clientId The client identifier passed to the server when the @@ -567,13 +568,13 @@ typedef struct */ MQTTClient_willOptions* will; /** - * MQTT servers that support the MQTT v3.1 protocol provide authentication + * MQTT servers that support the MQTT v3.1.1 protocol provide authentication * and authorisation by user name and password. This is the user name * parameter. */ const char* username; /** - * MQTT servers that support the MQTT v3.1 protocol provide authentication + * MQTT servers that support the MQTT v3.1.1 protocol provide authentication * and authorisation by user name and password. This is the password * parameter. */ diff --git a/src/MQTTVersion.c b/src/MQTTVersion.c index a7a3fd188057be28427ffdd3f91c95e98ead69c6..32be1b3cb5a92ef5bb8077781b6e239405b9104c 100644 --- a/src/MQTTVersion.c +++ b/src/MQTTVersion.c @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2012, 2014 IBM Corp. + * Copyright (c) 2012, 2015 IBM Corp. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 @@ -178,7 +178,7 @@ void printEyecatchers(char* filename) int main(int argc, char** argv) { printf("MQTTVersion: print the version strings of an MQTT client library\n"); - printf("Copyright (c) 2013 IBM Corp.\n"); + printf("Copyright (c) 2012, 2015 IBM Corp.\n"); if (argc == 1) {