1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00
RIOT/pkg/cryptoauthlib/Makefile
Marian Buschsieweke d16f5366da
pkg/cryptoauthlib: add -Wno-cast-align
Also split compiler flags into individual lines and sort them
alphabetically.
2021-12-03 10:12:37 +01:00

66 lines
2.1 KiB
Makefile

PKG_NAME=cryptoauthlib
PKG_URL=https://github.com/MicrochipTech/cryptoauthlib
PKG_VERSION=af8187776cd3f3faf8bed412eaf6ff7221862e19
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
CFLAGS += $(INCLUDES)
CFLAGS += -DATCA_HAL_I2C
CFLAGS += -Wno-cast-align
CFLAGS += -Wno-char-subscripts
CFLAGS += -Wno-missing-field-initializers
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
TOOLCHAIN_FILE=$(PKG_SOURCE_DIR)/xcompile-toolchain.cmake
ifneq (,$(filter $(PKG_TEST_NAME),$(USEMODULE)))
all: cryptoauth build_tests
else
all: cryptoauth
endif
cryptoauth: $(PKG_BUILD_DIR)/Makefile
$(MAKE) -C $(PKG_BUILD_DIR)
cp $(PKG_BUILD_DIR)/libcryptoauth.a $(BINDIR)/$(PKG_NAME).a
$(PKG_BUILD_DIR)/Makefile: $(TOOLCHAIN_FILE)
cmake -DCMAKE_TOOLCHAIN_FILE=$(TOOLCHAIN_FILE) \
-Wno-dev \
-DATCA_HAL_I2C:BOOL=TRUE \
-B$(PKG_BUILD_DIR) \
-H$(PKG_SOURCE_DIR)/lib
$(TOOLCHAIN_FILE): git-download
$(RIOTTOOLS)/cmake/generate-xcompile-toolchain.sh > $(TOOLCHAIN_FILE)
build_tests:
$(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
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