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
|
2021-11-08 23:18:30 +01:00
|
|
|
PKG_VERSION=e3f82e36250b228f3b4646781f6e06a8be497d18
|
2017-01-08 21:55:46 +01:00
|
|
|
PKG_LICENSE=LGPL-2.1
|
2014-12-16 17:36:38 +01:00
|
|
|
|
2020-06-13 20:59:41 +02:00
|
|
|
PKG_CUSTOM_PREPARED = $(BINDIR)/pkg-build/$(PKG_NAME)/include
|
2020-06-15 10:51:19 +02: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
|
|
|
|
2021-11-08 23:18:30 +01:00
|
|
|
CFLAGS += -Wno-unused-function -Wno-old-style-definition -Wno-unused-parameter \
|
|
|
|
-Wno-pedantic -Wno-array-parameter -Wno-unused-but-set-variable \
|
|
|
|
-Wno-stringop-overflow
|
2018-03-27 19:03:51 +02:00
|
|
|
|
2023-05-20 21:43:21 +02:00
|
|
|
ifeq (llvm,$(TOOLCHAIN))
|
|
|
|
CFLAGS += $(GCC_C_INCLUDES)
|
|
|
|
CXXFLAGS += $(GCC_CXX_INCLUDES)
|
|
|
|
endif
|
|
|
|
|
2020-06-13 20:59:41 +02:00
|
|
|
TOOLCHAIN_FILE = $(PKG_SOURCE_DIR)/xcompile-toolchain.cmake
|
2019-10-02 12:47:02 +02:00
|
|
|
|
|
|
|
all: $(BINDIR)/$(PKG_NAME).a
|
|
|
|
|
2020-06-15 10:51:19 +02:00
|
|
|
$(PKG_CUSTOM_PREPARED):
|
|
|
|
$(info [INFO] Relic: create include directory in build)
|
|
|
|
mkdir -p $(PKG_CUSTOM_PREPARED)
|
|
|
|
|
2020-06-13 20:59:41 +02:00
|
|
|
$(BINDIR)/$(PKG_NAME).a: $(PKG_BUILD_DIR)/lib/librelic_s.a
|
2019-10-02 12:47:02 +02:00
|
|
|
cp $< $@
|
2018-03-27 19:03:51 +02:00
|
|
|
|
2020-06-13 20:59:41 +02:00
|
|
|
$(PKG_BUILD_DIR)/lib/librelic_s.a: $(PKG_BUILD_DIR)/Makefile
|
|
|
|
$(MAKE) -C $(PKG_BUILD_DIR)
|
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.
|
2020-08-10 11:55:46 +02:00
|
|
|
COMP = $(filter-out -Werror -Werror=old-style-definition -Werror=strict-prototypes -std=gnu11,$(CFLAGS))
|
2020-06-13 20:59:41 +02:00
|
|
|
$(PKG_BUILD_DIR)/Makefile: export COMP ?=
|
|
|
|
$(PKG_BUILD_DIR)/Makefile: $(PKG_PREPARED) $(TOOLCHAIN_FILE) | ..cmake_version_supported
|
|
|
|
cmake -B$(PKG_BUILD_DIR) -H$(PKG_SOURCE_DIR) \
|
2019-10-02 12:47:02 +02:00
|
|
|
-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
|