1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

pkg/wolfssl: improve build system integration

and avoid copying in the cloned repository when building
This commit is contained in:
Alexandre Abadie 2020-06-12 09:45:55 +02:00
parent ac8e27aab6
commit 86f9190a4c
No known key found for this signature in database
GPG Key ID: 1C919A403CAE1405
4 changed files with 20 additions and 29 deletions

View File

@ -5,11 +5,13 @@ PKG_LICENSE=GPLv2
include $(RIOTBASE)/pkg/pkg.mk
all: # Nothing to do here when building
.PHONY: wolfcrypt%
prepare:
cp Makefile.wolfssl $(PKG_BUILDDIR)/src/Makefile
cp Makefile.wolfcrypt $(PKG_BUILDDIR)/wolfcrypt/src/Makefile
touch $(PKG_BUILDDIR)/wolfssl.a
cp Makefile.wolfcrypt-test $(PKG_BUILDDIR)/wolfcrypt/test/Makefile
cp Makefile.wolfcrypt-benchmark $(PKG_BUILDDIR)/wolfcrypt/benchmark/Makefile
all: $(filter wolfcrypt wolfcrypt-test wolfcrypt-benchmark,$(USEMODULE))
"$(MAKE)" -C $(PKG_BUILDDIR)/src -f $(CURDIR)/Makefile.wolfssl
wolfcrypt:
"$(MAKE)" -C $(PKG_BUILDDIR)/wolfcrypt/src -f $(CURDIR)/Makefile.wolfcrypt
wolfcrypt-%:
"$(MAKE)" -C $(PKG_BUILDDIR)/wolfcrypt/$* -f $(CURDIR)/Makefile.wolfcrypt-$*

View File

@ -1,32 +1,11 @@
CFLAGS += -Wno-unused-parameter -Wno-unused
CFLAGS += -DWOLFSSL_USER_SETTINGS=1
CFLAGS += -DWOLFSSL_RIOT_OS=1
INCLUDES += -I$(PKGDIRBASE)/../../../
INCLUDES += -I$(PKGDIRBASE)/wolfssl
INCLUDES += -I$(RIOTBASE)/pkg/wolfssl/sock_tls
INCLUDES += -I$(RIOTBASE)/pkg/wolfssl/include
# One current limitation is that it is not possible to build `wolfcrypt` without
# including `wolfssl`.
# It would require some changes:
# * Use a different name for the `wolfssl` implementation to differenciate from
# the package directory
# * Declare `wolfssl` a PSEUDOMODULES
# * Remove the archive in Makefile.include for packages as they could be
# PSEUDOMODULES
# `$(USEPKG:%=$(BINDIR)/%.a):`
ifneq (,$(filter wolfcrypt,$(USEMODULE)))
DIRS += $(PKGDIRBASE)/wolfssl/wolfcrypt/src
endif
ifneq (,$(filter wolfcrypt-test,$(USEMODULE)))
DIRS += $(PKGDIRBASE)/wolfssl/wolfcrypt/test
endif
ifneq (,$(filter wolfcrypt-benchmark,$(USEMODULE)))
DIRS += $(PKGDIRBASE)/wolfssl/wolfcrypt/benchmark
endif
ifneq (,$(filter wolfssl,$(USEPKG)))
DIRS += $(PKGDIRBASE)/wolfssl/src
endif
ifneq (,$(filter sock_tls,$(USEMODULE)))
DIRS += $(RIOTBASE)/pkg/wolfssl/sock_tls
endif

View File

@ -1,5 +1,11 @@
MODULE = wolfcrypt
CFLAGS += -Wno-unused
ifeq (llvm,$(TOOLCHAIN))
CFLAGS += -Wno-unused-parameter
endif
SUBMODULES += 1
NO_AUTO_SRC = 1

View File

@ -3,4 +3,8 @@ MODULE = wolfssl
NO_AUTO_SRC = 1
SUBMODULES += 1
ifeq (llvm,$(TOOLCHAIN))
CFLAGS += -Wno-unused-parameter
endif
include $(RIOTBASE)/Makefile.base