diff --git a/pkg/wolfssl/Makefile b/pkg/wolfssl/Makefile index f292591c6c..86000a4dd9 100644 --- a/pkg/wolfssl/Makefile +++ b/pkg/wolfssl/Makefile @@ -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-$* diff --git a/pkg/wolfssl/Makefile.include b/pkg/wolfssl/Makefile.include index 7348d473cd..cbf77e23b8 100644 --- a/pkg/wolfssl/Makefile.include +++ b/pkg/wolfssl/Makefile.include @@ -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 diff --git a/pkg/wolfssl/Makefile.wolfcrypt b/pkg/wolfssl/Makefile.wolfcrypt index 3c990d9152..27c4350cce 100644 --- a/pkg/wolfssl/Makefile.wolfcrypt +++ b/pkg/wolfssl/Makefile.wolfcrypt @@ -1,5 +1,11 @@ MODULE = wolfcrypt +CFLAGS += -Wno-unused + +ifeq (llvm,$(TOOLCHAIN)) + CFLAGS += -Wno-unused-parameter +endif + SUBMODULES += 1 NO_AUTO_SRC = 1 diff --git a/pkg/wolfssl/Makefile.wolfssl b/pkg/wolfssl/Makefile.wolfssl index 72af91a1ef..f4503bd6b7 100644 --- a/pkg/wolfssl/Makefile.wolfssl +++ b/pkg/wolfssl/Makefile.wolfssl @@ -3,4 +3,8 @@ MODULE = wolfssl NO_AUTO_SRC = 1 SUBMODULES += 1 +ifeq (llvm,$(TOOLCHAIN)) + CFLAGS += -Wno-unused-parameter +endif + include $(RIOTBASE)/Makefile.base