diff --git a/netutils/mqttc/.gitignore b/netutils/mqttc/.gitignore new file mode 100644 index 000000000..5d6e9a06e --- /dev/null +++ b/netutils/mqttc/.gitignore @@ -0,0 +1,2 @@ +/MQTT-C +/*tar.gz diff --git a/netutils/mqttc/Kconfig b/netutils/mqttc/Kconfig new file mode 100644 index 000000000..d17d19480 --- /dev/null +++ b/netutils/mqttc/Kconfig @@ -0,0 +1,18 @@ +# +# For a description of the syntax of this configuration file, +# see the file kconfig-language.txt in the NuttX tools repository. +# + +config NETUTILS_MQTTC + tristate "Enable MQTT-C" + default n + ---help--- + Enable MQTT-C + +if NETUTILS_MQTTC + +config NETUTILS_MQTTC_VERSION + string "MQTT-C Version" + default "1.1.4" + +endif diff --git a/netutils/mqttc/Make.defs b/netutils/mqttc/Make.defs new file mode 100644 index 000000000..878961a03 --- /dev/null +++ b/netutils/mqttc/Make.defs @@ -0,0 +1,32 @@ +############################################################################ +# apps/netutils/mqttc/Make.defs +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. The +# ASF licenses this file to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance with the +# License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. +# +############################################################################ + +ifneq ($(CONFIG_NETUTILS_MQTTC),) +CONFIGURED_APPS += $(APPDIR)/netutils/mqttc + +CFLAGS += -D__unix__ +CXXFLAGS += -D__unix__ + +CFLAGS += ${shell $(INCDIR) $(INCDIROPT) "$(CC)" \ + $(APPDIR)/netutils/mqttc/MQTT-C/include} +CXXFLAGS += ${shell $(INCDIR) $(INCDIROPT) "$(CC)" \ + $(APPDIR)/netutils/mqttc/MQTT-C/include} + +endif diff --git a/netutils/mqttc/Makefile b/netutils/mqttc/Makefile new file mode 100644 index 000000000..3398f9a22 --- /dev/null +++ b/netutils/mqttc/Makefile @@ -0,0 +1,48 @@ +############################################################################ +# apps/netutils/mqttc/Makefile +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. The +# ASF licenses this file to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance with the +# License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. +# +############################################################################ + +include $(APPDIR)/Make.defs + +MQTTC_VERSION := $(patsubst "%",%,$(CONFIG_NETUTILS_MQTTC_VERSION)) +MQTTC_TARBALL = $(MQTTC_VERSION).tar.gz +MQTTC_UNPACK = MQTT-C +MQTTC_SRCDIR = $(MQTTC_UNPACK)$(DELIM)src + +DEPPATH += --dep-path $(MQTTC_SRCDIR) +VPATH += :$(MQTTC_SRCDIR) + +CSRCS := $(notdir $(wildcard $(MQTTC_SRCDIR)$(DELIM)*.c)) + +$(MQTTC_TARBALL): + $(Q) echo "Downloading MQTT-C-$(MQTTC_VERSION)" + $(Q) curl -O -L https://github.com/LiamBindle/MQTT-C/archive/$(MQTTC_TARBALL) + +$(MQTTC_UNPACK): $(MQTTC_TARBALL) + $(Q) tar zxf $(MQTTC_TARBALL) + $(Q) mv MQTT-C-$(MQTTC_VERSION) $(MQTTC_UNPACK) + $(Q) touch $(MQTTC_UNPACK) + +context:: $(MQTTC_UNPACK) + +distclean:: + $(call DELFILE, $(MQTTC_TARBALL)) + $(call DELDIR, $(MQTTC_UNPACK)) + +include $(APPDIR)/Application.mk