2014-12-16 17:36:38 +01:00
|
|
|
PKG_NAME=relic
|
2017-01-08 21:55:46 +01:00
|
|
|
PKG_URL=https://github.com/relic-toolkit/relic.git
|
2017-04-25 22:27:47 +02:00
|
|
|
PKG_VERSION=0b0442a8218df8d309266923f2dd5b9ae3b318ce
|
2017-01-08 21:55:46 +01:00
|
|
|
PKG_LICENSE=LGPL-2.1
|
2014-12-16 17:36:38 +01:00
|
|
|
|
2019-10-02 12:47:02 +02:00
|
|
|
include $(RIOTBASE)/pkg/pkg.mk
|
2018-08-06 14:56:51 +02:00
|
|
|
|
2019-10-02 12:47:02 +02:00
|
|
|
.PHONY: ..cmake_version_supported
|
2018-08-06 14:56:51 +02:00
|
|
|
|
2019-10-02 12:47:02 +02:00
|
|
|
CMAKE_MINIMAL_VERSION = 3.6.0
|
2014-12-16 17:36:38 +01:00
|
|
|
|
2018-03-27 19:03:51 +02:00
|
|
|
CFLAGS += -Wno-gnu-zero-variadic-macro-arguments -Wno-unused-function -Wno-newline-eof
|
|
|
|
|
2019-10-02 12:47:02 +02:00
|
|
|
TOOLCHAIN_FILE = $(PKG_BUILDDIR)/xcompile-toolchain.cmake
|
|
|
|
|
|
|
|
all: $(BINDIR)/$(PKG_NAME).a
|
|
|
|
|
|
|
|
$(BINDIR)/$(PKG_NAME).a: $(PKG_BUILDDIR)/lib/librelic_s.a
|
|
|
|
cp $< $@
|
2018-03-27 19:03:51 +02:00
|
|
|
|
2019-10-02 12:47:02 +02:00
|
|
|
$(PKG_BUILDDIR)/lib/librelic_s.a: $(PKG_BUILDDIR)/Makefile
|
|
|
|
$(MAKE) -C $(PKG_BUILDDIR)
|
2014-12-16 17:36:38 +01:00
|
|
|
|
2019-09-27 18:07:35 +02:00
|
|
|
# Pass 'COMP' with a target specific export to not have issues with the shell
|
|
|
|
# escaping evaluation.
|
|
|
|
COMP = $(filter-out -Werror -Werror=old-style-definition -Werror=strict-prototypes -std=gnu99,$(CFLAGS))
|
|
|
|
$(PKG_BUILDDIR)/Makefile: export COMP ?=
|
2019-10-02 12:47:02 +02:00
|
|
|
$(PKG_BUILDDIR)/Makefile: $(PKG_PREPARED) $(TOOLCHAIN_FILE) | ..cmake_version_supported
|
|
|
|
cmake -B$(PKG_BUILDDIR) -H$(PKG_BUILDDIR) \
|
|
|
|
-DCMAKE_TOOLCHAIN_FILE=$(TOOLCHAIN_FILE) \
|
|
|
|
-DCHECK=off -DTESTS=0 -DBENCH=0 -DSHLIB=off -Wno-dev $(RELIC_CONFIG_FLAGS)
|
2019-09-27 18:07:35 +02:00
|
|
|
|
2019-10-02 12:47:02 +02:00
|
|
|
$(TOOLCHAIN_FILE): FORCE
|
2018-06-28 14:11:00 +02:00
|
|
|
$(RIOTTOOLS)/cmake/generate-xcompile-toolchain.sh > $(TOOLCHAIN_FILE)
|
2014-12-16 17:36:38 +01:00
|
|
|
|
2018-08-06 14:56:51 +02:00
|
|
|
..cmake_version_supported:
|
|
|
|
@ # Remove '-rcX' from version as they are not well handled
|
|
|
|
$(Q)\
|
|
|
|
CMAKE_VERSION=$$(cmake --version | sed -n '1 {s/cmake version //;s/-rc.*//;p;}'); \
|
|
|
|
$(RIOTTOOLS)/has_minimal_version/has_minimal_version.sh "$${CMAKE_VERSION}" "$(CMAKE_MINIMAL_VERSION)" cmake
|