2019-04-28 14:47:03 +02:00
|
|
|
#############################################################################
|
2019-04-28 14:34:20 +02:00
|
|
|
# apps/ netutils/cjson/Makefile
|
|
|
|
#
|
|
|
|
# Copyright (C) 2019 Gregory Nutt. All rights reserved.
|
|
|
|
# Author: Mateusz Szafoni <raiden00@railab.me>
|
|
|
|
#
|
|
|
|
# Redistribution and use in source and binary forms, with or without
|
|
|
|
# modification, are permitted provided that the following conditions
|
|
|
|
# are met:
|
|
|
|
#
|
|
|
|
# 1. Redistributions of source code must retain the above copyright
|
|
|
|
# notice, this list of conditions and the following disclaimer.
|
|
|
|
# 2. Redistributions in binary form must reproduce the above copyright
|
|
|
|
# notice, this list of conditions and the following disclaimer in
|
|
|
|
# the documentation and/or other materials provided with the
|
|
|
|
# distribution.
|
|
|
|
# 3. Neither the name NuttX nor the names of its contributors may be
|
|
|
|
# used to endorse or promote products derived from this software
|
|
|
|
# without specific prior written permission.
|
|
|
|
#
|
|
|
|
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
|
|
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
|
|
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
|
|
|
# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
|
|
|
# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
|
|
|
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
|
|
|
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
|
|
|
# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
|
|
|
# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
|
|
|
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
|
|
|
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
|
|
|
# POSSIBILITY OF SUCH DAMAGE.
|
|
|
|
#
|
2019-04-28 14:47:03 +02:00
|
|
|
#############################################################################
|
2019-04-28 14:34:20 +02:00
|
|
|
|
|
|
|
# Standard includes
|
|
|
|
|
2020-05-20 06:35:03 +02:00
|
|
|
include $(APPDIR)/Make.defs
|
2019-04-28 14:34:20 +02:00
|
|
|
|
|
|
|
# Set up build configuration and environment
|
|
|
|
|
2019-10-02 15:06:50 +02:00
|
|
|
WD := ${shell echo $(CURDIR) | sed -e 's/ /\\ /g'}
|
2019-04-28 14:34:20 +02:00
|
|
|
|
|
|
|
CONFIG_NETUTILS_CJSON_URL ?= "https://github.com/DaveGamble/cJSON/archive"
|
|
|
|
CONFIG_NETUTILS_CJSON_VERSION ?= "1.7.10"
|
|
|
|
CJSON_VERSION = $(patsubst "%",%,$(strip $(CONFIG_NETUTILS_CJSON_VERSION)))
|
|
|
|
|
|
|
|
CJSON_TARBALL = v$(CJSON_VERSION).tar.gz
|
|
|
|
|
|
|
|
CJSON_UNPACKNAME = cJSON-$(CJSON_VERSION)
|
|
|
|
UNPACK ?= tar -zxf
|
|
|
|
|
|
|
|
CJSON_UNPACKDIR = $(WD)/$(CJSON_UNPACKNAME)
|
2019-10-06 13:55:23 +02:00
|
|
|
CJSON_SRCDIR = $(CJSON_UNPACKNAME)
|
2019-04-28 14:34:20 +02:00
|
|
|
|
|
|
|
APPS_INCDIR = $(APPDIR)$(DELIM)include$(DELIM)netutils
|
|
|
|
|
2020-05-20 10:29:35 +02:00
|
|
|
CFLAGS += ${shell $(INCDIR) "$(CC)" $(APPS_INCDIR)}
|
|
|
|
CFLAGS += -DCJSON_INCLUDE_CONFIG_H
|
2019-04-28 14:34:20 +02:00
|
|
|
|
|
|
|
CSRCS = $(CJSON_SRCDIR)$(DELIM)cJSON.c
|
|
|
|
CSRCS += $(CJSON_SRCDIR)$(DELIM)cJSON_Utils.c
|
|
|
|
|
|
|
|
$(CJSON_TARBALL):
|
|
|
|
@echo "Downloading: $(CJSON_TARBALL)"
|
2020-12-21 12:48:58 +01:00
|
|
|
$(Q) curl -O -L $(CONFIG_NETUTILS_CJSON_URL)/$(CJSON_TARBALL)
|
2019-04-28 14:34:20 +02:00
|
|
|
|
|
|
|
$(CJSON_UNPACKNAME): $(CJSON_TARBALL)
|
|
|
|
@echo "Unpacking: $(CJSON_TARBALL) -> $(CJSON_UNPACKNAME)"
|
|
|
|
$(Q) $(UNPACK) $(CJSON_TARBALL)
|
2020-08-10 18:57:42 +02:00
|
|
|
$(Q) touch $(CJSON_UNPACKNAME)
|
2019-04-28 14:34:20 +02:00
|
|
|
|
|
|
|
$(CJSON_SRCDIR)$(DELIM)cJSON.h: $(CJSON_UNPACKNAME)
|
|
|
|
|
|
|
|
$(CJSON_SRCDIR)$(DELIM)cJSON_Utils.h: $(CJSON_UNPACKNAME)
|
|
|
|
|
|
|
|
$(APPS_INCDIR)$(DELIM)cJSON.h: $(CJSON_SRCDIR)$(DELIM)cJSON.h
|
|
|
|
$(Q) cp $< $@
|
|
|
|
|
|
|
|
$(APPS_INCDIR)$(DELIM)cJSON_Utils.h: $(CJSON_SRCDIR)$(DELIM)cJSON_Utils.h
|
|
|
|
$(Q) cp $< $@
|
|
|
|
|
|
|
|
context:: $(APPS_INCDIR)$(DELIM)cJSON.h $(APPS_INCDIR)$(DELIM)cJSON_Utils.h
|
|
|
|
|
|
|
|
distclean::
|
|
|
|
$(call DELDIR, $(CJSON_UNPACKNAME))
|
|
|
|
$(call DELFILE, $(CJSON_TARBALL))
|
|
|
|
$(call DELFILE, $(APPDIR)/include/netutils/cJSON.h)
|
|
|
|
$(call DELFILE, $(APPDIR)/include/netutils/cJSON_Utils.h)
|
|
|
|
|
|
|
|
include $(APPDIR)/Application.mk
|