2019-12-18 20:18:50 +01:00
|
|
|
PKG_NAME=cryptoauthlib
|
|
|
|
PKG_URL=https://github.com/MicrochipTech/cryptoauthlib
|
2022-05-25 15:04:32 +02:00
|
|
|
PKG_VERSION=055dd4afafb019db1f4d61880aa441832139faa2
|
2019-12-18 20:18:50 +01:00
|
|
|
PKG_LICENSE=LGPL-2.1
|
|
|
|
PKG_TEST_NAME=cryptoauthlib_test
|
|
|
|
|
|
|
|
include $(RIOTBASE)/pkg/pkg.mk
|
|
|
|
|
|
|
|
.PHONY: all..cmake_version_supported
|
|
|
|
|
|
|
|
CMAKE_MINIMAL_VERSION = 3.6.0
|
|
|
|
|
2023-08-29 19:19:42 +02:00
|
|
|
CFLAGS += $(INCLUDES) # for some reason this is needed by llvm, but not for gcc
|
2021-11-07 21:58:18 +01:00
|
|
|
CFLAGS += -DATCA_HAL_I2C
|
|
|
|
CFLAGS += -Wno-cast-align
|
2020-02-03 12:04:32 +01:00
|
|
|
CFLAGS += -Wno-char-subscripts
|
2021-11-07 21:58:18 +01:00
|
|
|
CFLAGS += -Wno-overflow
|
|
|
|
CFLAGS += -Wno-pointer-to-int-cast
|
|
|
|
CFLAGS += -Wno-sign-compare
|
|
|
|
CFLAGS += -Wno-strict-aliasing
|
|
|
|
CFLAGS += -Wno-type-limits
|
|
|
|
CFLAGS += -Wno-unused-function
|
|
|
|
CFLAGS += -Wno-unused-parameter
|
|
|
|
CFLAGS += -Wno-unused-variable
|
2022-10-07 11:20:13 +02:00
|
|
|
CFLAGS += -Wno-maybe-uninitialized
|
2019-12-18 20:18:50 +01:00
|
|
|
|
2020-06-13 20:59:41 +02:00
|
|
|
TOOLCHAIN_FILE=$(PKG_SOURCE_DIR)/xcompile-toolchain.cmake
|
2019-12-18 20:18:50 +01:00
|
|
|
|
|
|
|
ifneq (,$(filter $(PKG_TEST_NAME),$(USEMODULE)))
|
|
|
|
all: cryptoauth build_tests
|
|
|
|
else
|
|
|
|
all: cryptoauth
|
|
|
|
endif
|
|
|
|
|
2020-06-13 20:59:41 +02:00
|
|
|
cryptoauth: $(PKG_BUILD_DIR)/Makefile
|
|
|
|
$(MAKE) -C $(PKG_BUILD_DIR)
|
|
|
|
cp $(PKG_BUILD_DIR)/libcryptoauth.a $(BINDIR)/$(PKG_NAME).a
|
2019-12-18 20:18:50 +01:00
|
|
|
|
2020-06-13 20:59:41 +02:00
|
|
|
$(PKG_BUILD_DIR)/Makefile: $(TOOLCHAIN_FILE)
|
2019-12-18 20:18:50 +01:00
|
|
|
cmake -DCMAKE_TOOLCHAIN_FILE=$(TOOLCHAIN_FILE) \
|
|
|
|
-Wno-dev \
|
2022-10-07 11:20:13 +02:00
|
|
|
-DATCA_NO_HEAP:BOOL=TRUE \
|
2020-06-13 20:59:41 +02:00
|
|
|
-B$(PKG_BUILD_DIR) \
|
|
|
|
-H$(PKG_SOURCE_DIR)/lib
|
2019-12-18 20:18:50 +01:00
|
|
|
|
|
|
|
$(TOOLCHAIN_FILE): git-download
|
|
|
|
$(RIOTTOOLS)/cmake/generate-xcompile-toolchain.sh > $(TOOLCHAIN_FILE)
|
|
|
|
|
|
|
|
build_tests:
|
2022-05-25 15:04:32 +02:00
|
|
|
$(QQ)"$(MAKE)" -C $(PKG_SOURCE_DIR)/third_party/unity -f $(RIOTBASE)/Makefile.base MODULE=$(PKG_TEST_NAME)_third_party_unity
|
2021-03-12 15:50:14 +01:00
|
|
|
$(QQ)"$(MAKE)" -C $(PKG_SOURCE_DIR)/test -f $(RIOTBASE)/Makefile.base MODULE=$(PKG_TEST_NAME)
|
|
|
|
$(QQ)"$(MAKE)" -C $(PKG_SOURCE_DIR)/test/jwt -f $(RIOTBASE)/Makefile.base MODULE=$(PKG_TEST_NAME)_jwt
|
|
|
|
$(QQ)"$(MAKE)" -C $(PKG_SOURCE_DIR)/test/tng -f $(RIOTBASE)/Makefile.base MODULE=$(PKG_TEST_NAME)_tng
|
|
|
|
$(QQ)"$(MAKE)" -C $(PKG_SOURCE_DIR)/test/atcacert -f $(RIOTBASE)/Makefile.base MODULE=$(PKG_TEST_NAME)_atcacert
|
2022-05-25 15:04:32 +02:00
|
|
|
$(QQ)"$(MAKE)" -C $(PKG_SOURCE_DIR)/test/api_atcab -f $(RIOTBASE)/Makefile.base MODULE=$(PKG_TEST_NAME)_api_atcab
|
|
|
|
$(QQ)"$(MAKE)" -C $(PKG_SOURCE_DIR)/test/api_calib -f $(RIOTBASE)/Makefile.base MODULE=$(PKG_TEST_NAME)_api_calib
|
|
|
|
$(QQ)"$(MAKE)" -C $(PKG_SOURCE_DIR)/test/api_crypto -f $(RIOTBASE)/Makefile.base MODULE=$(PKG_TEST_NAME)_api_crypto
|
|
|
|
$(QQ)"$(MAKE)" -C $(PKG_SOURCE_DIR)/test/vectors -f $(RIOTBASE)/Makefile.base MODULE=$(PKG_TEST_NAME)_vectors
|
2019-12-18 20:18:50 +01:00
|
|
|
|
|
|
|
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
|
|
|
|
@rm -rf $(BINDIR)/$(PKG_TEST_NAME).a
|