Skip to content

Commit

Permalink
pkg/relic: adapt cmake xcompile on macOS
Browse files Browse the repository at this point in the history
  • Loading branch information
smlng committed Mar 27, 2018
1 parent 3ad07c6 commit 0e26cf8
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 36 deletions.
20 changes: 13 additions & 7 deletions pkg/relic/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,28 @@ PKG_LICENSE=LGPL-2.1

.PHONY: all

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) && \
$(MAKE) -C $(PKG_BUILDDIR) && \
cp $(PKG_BUILDDIR)/lib/librelic_s.a $(BINDIR)/$(PKG_NAME).a

$(PKG_BUILDDIR)/comp-options.cmake: fix_source
cd "$(PKG_BUILDDIR)" && perl $(PKG_DIR)/generate-cmake-xcompile.perl > comp-options.cmake
$(PKG_BUILDDIR)/Makefile: $(TOOLCHAIN_FILE)
cd $(PKG_BUILDDIR) && \
COMP="$(filter-out -Werror=old-style-definition -Werror=strict-prototypes, $(CFLAGS) ) " \
cmake -DCMAKE_TOOLCHAIN_FILE=$(TOOLCHAIN_FILE) \
-DCHECK=off -DTESTS=0 -DBENCH=0 -DSHLIB=off -Wno-dev $(RELIC_CONFIG_FLAGS) .

$(PKG_BUILDDIR)/Makefile: $(PKG_BUILDDIR)/comp-options.cmake
cd "$(PKG_BUILDDIR)" && COMP="$(filter-out -Werror=old-style-definition -Werror=strict-prototypes, $(CFLAGS) ) " cmake -DCMAKE_TOOLCHAIN_FILE=comp-options.cmake -DCHECK=off -DTESTS=0 -DBENCH=0 -DSHLIB=off -Wno-dev $(RELIC_CONFIG_FLAGS) .

CFLAGS += -Wno-gnu-zero-variadic-macro-arguments -Wno-unused-function -Wno-newline-eof
$(TOOLCHAIN_FILE): fix_source
$(RIOTBASE)/dist/tools/cmake/generate-xcompile-toolchain.sh > $(TOOLCHAIN_FILE)

fix_source: git-download
./fix-util_print_wo_args.sh $(PKG_BUILDDIR)
./fix-old-style-definitions.sh $(PKG_BUILDDIR)

clean::
@rm -rf $(BINDIR)/$(PKG_NAME).a

include $(RIOTBASE)/pkg/pkg.mk
29 changes: 0 additions & 29 deletions pkg/relic/generate-cmake-xcompile.perl

This file was deleted.

0 comments on commit 0e26cf8

Please sign in to comment.