From ff37e8ee6da53b11ee7dd872ac6e2f4bd0df3d13 Mon Sep 17 00:00:00 2001 From: Alexandre Abadie Date: Thu, 11 Jun 2020 17:29:26 +0200 Subject: [PATCH] pkg/cryptoauthlib: use out-of-source build / remove unused variable --- pkg/cryptoauthlib/Makefile | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/pkg/cryptoauthlib/Makefile b/pkg/cryptoauthlib/Makefile index 1ee6062ede..61eb8c49b2 100644 --- a/pkg/cryptoauthlib/Makefile +++ b/pkg/cryptoauthlib/Makefile @@ -3,12 +3,14 @@ PKG_URL=https://github.com/MicrochipTech/cryptoauthlib PKG_VERSION=af8187776cd3f3faf8bed412eaf6ff7221862e19 PKG_LICENSE=LGPL-2.1 PKG_TEST_NAME=cryptoauthlib_test -PKG_TESTINCLDIR = $(PKG_BUILDDIR)/test include $(RIOTBASE)/pkg/pkg.mk .PHONY: all..cmake_version_supported +CRYPTOAUTHLIB_SOURCE_DIR = $(PKG_BUILDDIR) +CRYPTOAUTHLIB_BUILD_DIR = $(PKG_BUILDDIR)/build + CMAKE_MINIMAL_VERSION = 3.6.0 CFLAGS += $(INCLUDES) @@ -17,7 +19,7 @@ CFLAGS += -Wno-type-limits -Wno-strict-aliasing -Wno-unused-variable -DATCA_HAL_ CFLAGS += -Wno-unused-parameter -Wno-sign-compare -Wno-overflow -Wno-pointer-to-int-cast CFLAGS += -Wno-char-subscripts -TOOLCHAIN_FILE=$(PKG_BUILDDIR)/xcompile-toolchain.cmake +TOOLCHAIN_FILE=$(CRYPTOAUTHLIB_SOURCE_DIR)/xcompile-toolchain.cmake ifneq (,$(filter $(PKG_TEST_NAME),$(USEMODULE))) all: cryptoauth build_tests @@ -25,25 +27,25 @@ else all: cryptoauth endif -cryptoauth: $(PKG_BUILDDIR)/lib/Makefile - $(MAKE) -C $(PKG_BUILDDIR)/lib - cp $(PKG_BUILDDIR)/lib/libcryptoauth.a $(BINDIR)/$(PKG_NAME).a +cryptoauth: $(CRYPTOAUTHLIB_BUILD_DIR)/Makefile + $(MAKE) -C $(CRYPTOAUTHLIB_BUILD_DIR) + cp $(CRYPTOAUTHLIB_BUILD_DIR)/libcryptoauth.a $(BINDIR)/$(PKG_NAME).a -$(PKG_BUILDDIR)/lib/Makefile: $(TOOLCHAIN_FILE) - cd $(PKG_BUILDDIR)/lib && \ +$(CRYPTOAUTHLIB_BUILD_DIR)/Makefile: $(TOOLCHAIN_FILE) cmake -DCMAKE_TOOLCHAIN_FILE=$(TOOLCHAIN_FILE) \ -Wno-dev \ - -DBUILD_TESTS=OFF \ - -DATCA_HAL_I2C:BOOL=TRUE . + -DATCA_HAL_I2C:BOOL=TRUE \ + -B$(CRYPTOAUTHLIB_BUILD_DIR) \ + -H$(CRYPTOAUTHLIB_SOURCE_DIR)/lib $(TOOLCHAIN_FILE): git-download $(RIOTTOOLS)/cmake/generate-xcompile-toolchain.sh > $(TOOLCHAIN_FILE) build_tests: - "$(MAKE)" MODULE=$(PKG_TEST_NAME) -C $(PKG_BUILDDIR)/test -f $(RIOTBASE)/Makefile.base - "$(MAKE)" MODULE=$(PKG_TEST_NAME)_jwt -C $(PKG_BUILDDIR)/test/jwt -f $(RIOTBASE)/Makefile.base - "$(MAKE)" MODULE=$(PKG_TEST_NAME)_tng -C $(PKG_BUILDDIR)/test/tng -f $(RIOTBASE)/Makefile.base - "$(MAKE)" MODULE=$(PKG_TEST_NAME)_atcacert -C $(PKG_BUILDDIR)/test/atcacert -f $(RIOTBASE)/Makefile.base + "$(MAKE)" -C $(CRYPTOAUTHLIB_SOURCE_DIR)/test -f $(RIOTBASE)/Makefile.base MODULE=$(PKG_TEST_NAME) + "$(MAKE)" -C $(CRYPTOAUTHLIB_SOURCE_DIR)/test/jwt -f $(RIOTBASE)/Makefile.base MODULE=$(PKG_TEST_NAME)_jwt + "$(MAKE)" -C $(CRYPTOAUTHLIB_SOURCE_DIR)/test/tng -f $(RIOTBASE)/Makefile.base MODULE=$(PKG_TEST_NAME)_tng + "$(MAKE)" -C $(CRYPTOAUTHLIB_SOURCE_DIR)/test/atcacert -f $(RIOTBASE)/Makefile.base MODULE=$(PKG_TEST_NAME)_atcacert git-download: | ..cmake_version_supported