2020-12-04 09:16:12 +01:00
|
|
|
############################################################################
|
|
|
|
# apps/system/argtable3/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
|
|
|
|
|
|
|
|
ARGTABLE3_VERSION := $(patsubst "%",%,$(CONFIG_SYSTEM_ARGTABLE3_VERSION))
|
|
|
|
ARGTABLE3_TARBALL = v$(ARGTABLE3_VERSION).tar.gz
|
|
|
|
ARGTABLE3_UNPACK = argtable3
|
2021-01-13 18:57:46 +01:00
|
|
|
ARGTABLE3_SRCDIR = $(ARGTABLE3_UNPACK)$(DELIM)src
|
2022-11-16 06:13:00 +01:00
|
|
|
ARGTABLE3_TESTSDIR = $(ARGTABLE3_UNPACK)$(DELIM)tests
|
2020-12-04 09:16:12 +01:00
|
|
|
|
|
|
|
DEPPATH += --dep-path $(ARGTABLE3_SRCDIR)
|
|
|
|
VPATH += :$(ARGTABLE3_SRCDIR)
|
|
|
|
|
2022-11-09 16:00:20 +01:00
|
|
|
CFLAGS += ${DEFINE_PREFIX}ARG_REPLACE_GETOPT=0
|
2021-01-13 18:57:46 +01:00
|
|
|
CSRCS := $(notdir $(wildcard $(ARGTABLE3_SRCDIR)$(DELIM)*.c))
|
2020-12-04 09:16:12 +01:00
|
|
|
|
2022-11-16 06:13:00 +01:00
|
|
|
ifneq ($(CONFIG_SYSTEM_ARGTABLE3_TEST),)
|
|
|
|
VPATH += $(ARGTABLE3_TESTSDIR)
|
|
|
|
MAINSRC += testall.c
|
|
|
|
|
|
|
|
CSRCS += testargdbl.c
|
|
|
|
CSRCS += testarghashtable.c
|
|
|
|
CSRCS += testargrex.c
|
|
|
|
CSRCS += CuTest.c
|
|
|
|
CSRCS += testargcmd.c
|
|
|
|
CSRCS += testargdstr.c
|
|
|
|
CSRCS += testargint.c
|
|
|
|
CSRCS += testargstr.c
|
|
|
|
CSRCS += testargdate.c
|
|
|
|
CSRCS += testargfile.c
|
|
|
|
CSRCS += testarglit.c
|
|
|
|
|
|
|
|
PROGNAME += $(CONFIG_SYSTEM_ARGTABLE3_TEST_PROGNAME)
|
|
|
|
PRIORITY += $(CONFIG_SYSTEM_ARGTABLE3_TEST_PRIORITY)
|
|
|
|
STACKSIZE += $(CONFIG_SYSTEM_ARGTABLE3_TEST_STACKSIZE)
|
|
|
|
endif
|
|
|
|
|
2021-06-17 06:33:27 +02:00
|
|
|
# workaround for clang.
|
|
|
|
#
|
|
|
|
# argtable3/src/arg_rex.c:100:104: error: unknown attribute 'optimize' ignored [-Werror,-Wunknown-attributes]
|
|
|
|
# TREX_API TRex* trex_compile(const TRexChar* pattern, const TRexChar** error, int flags) __attribute__((optimize(0)));
|
|
|
|
#
|
|
|
|
# the upstream fix:
|
|
|
|
# https://github.com/argtable/argtable3/commit/7704006f3cbb556e11da80a5b97469075a32892e
|
|
|
|
ifneq "$(shell $(CC) --version | grep clang)" ""
|
|
|
|
CFLAGS += -Wno-unknown-attributes
|
|
|
|
endif
|
|
|
|
|
2020-12-04 09:16:12 +01:00
|
|
|
$(ARGTABLE3_TARBALL):
|
|
|
|
$(Q) echo "Downloading argtable3-$(ARGTABLE3_VERSION)"
|
|
|
|
$(Q) echo "$(ARGTABLE3_SRCDIR)"
|
|
|
|
$(Q) echo "$(ARGTABLE3_TARBALL)--$(ARGTABLE3_UNPACK)"
|
2021-01-13 18:57:46 +01:00
|
|
|
$(Q) curl -O -L https://github.com/argtable/argtable3/archive/$(ARGTABLE3_TARBALL)
|
2020-12-04 09:16:12 +01:00
|
|
|
|
|
|
|
$(ARGTABLE3_UNPACK): $(ARGTABLE3_TARBALL)
|
|
|
|
$(Q) tar zxf $(ARGTABLE3_TARBALL)
|
|
|
|
$(Q) mv argtable3-$(ARGTABLE3_VERSION) $(ARGTABLE3_UNPACK)
|
|
|
|
|
2022-08-27 08:15:16 +02:00
|
|
|
# Download and unpack tarball if no git repo found
|
|
|
|
ifeq ($(wildcard $(ARGTABLE3_UNPACK)/.git),)
|
2021-01-16 21:02:18 +01:00
|
|
|
context:: $(ARGTABLE3_UNPACK)
|
2020-12-04 09:16:12 +01:00
|
|
|
|
|
|
|
distclean::
|
|
|
|
$(call DELFILE, $(ARGTABLE3_TARBALL))
|
|
|
|
$(call DELDIR, $(ARGTABLE3_UNPACK))
|
2022-08-27 08:15:16 +02:00
|
|
|
endif
|
2020-12-04 09:16:12 +01:00
|
|
|
|
|
|
|
include $(APPDIR)/Application.mk
|