-
Notifications
You must be signed in to change notification settings - Fork 2k
/
Makefile
43 lines (30 loc) · 1.41 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
PKG_NAME=relic
PKG_URL=https://github.com/relic-toolkit/relic.git
PKG_VERSION=0b0442a8218df8d309266923f2dd5b9ae3b318ce
PKG_LICENSE=LGPL-2.1
.PHONY: all ..cmake_version_supported
CMAKE_MINIMAL_VERSION = 3.6.0
CFLAGS += -Wno-gnu-zero-variadic-macro-arguments -Wno-unused-function -Wno-newline-eof
TOOLCHAIN_FILE=$(PKG_BUILDDIR)/xcompile-toolchain.cmake
all: $(PKG_BUILDDIR)/Makefile
$(MAKE) -C $(PKG_BUILDDIR) && \
cp $(PKG_BUILDDIR)/lib/librelic_s.a $(BINDIR)/$(PKG_NAME).a
# 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 ?=
$(PKG_BUILDDIR)/Makefile: $(TOOLCHAIN_FILE)
cd $(PKG_BUILDDIR) && \
cmake -DCMAKE_TOOLCHAIN_FILE=$(TOOLCHAIN_FILE) \
-DCHECK=off -DTESTS=0 -DBENCH=0 -DSHLIB=off -Wno-dev $(RELIC_CONFIG_FLAGS) .
$(TOOLCHAIN_FILE): git-download
$(RIOTTOOLS)/cmake/generate-xcompile-toolchain.sh > $(TOOLCHAIN_FILE)
git-download: | ..cmake_version_supported
..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
clean::
@rm -rf $(BINDIR)/$(PKG_NAME).a
include $(RIOTBASE)/pkg/pkg.mk