Skip to content

Commit 2bdf9b1

Browse files
Merge pull request #14274 from aabadie/pr/pkg/wolfssl_make_enh
pkg/wolfssl: improve build system integration
2 parents b05bceb + 86f9190 commit 2bdf9b1

4 files changed

Lines changed: 21 additions & 30 deletions

File tree

pkg/wolfssl/Makefile

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,13 @@ PKG_LICENSE=GPLv2
55

66
include $(RIOTBASE)/pkg/pkg.mk
77

8-
all: # Nothing to do here when building
9-
10-
prepare:
11-
cp Makefile.wolfssl $(PKG_BUILDDIR)/src/Makefile
12-
cp Makefile.wolfcrypt $(PKG_BUILDDIR)/wolfcrypt/src/Makefile
13-
touch $(PKG_BUILDDIR)/wolfssl.a
14-
cp Makefile.wolfcrypt-test $(PKG_BUILDDIR)/wolfcrypt/test/Makefile
15-
cp Makefile.wolfcrypt-benchmark $(PKG_BUILDDIR)/wolfcrypt/benchmark/Makefile
8+
.PHONY: wolfcrypt%
9+
10+
all: $(filter wolfcrypt wolfcrypt-test wolfcrypt-benchmark,$(USEMODULE))
11+
"$(MAKE)" -C $(PKG_BUILDDIR)/src -f $(CURDIR)/Makefile.wolfssl
12+
13+
wolfcrypt:
14+
"$(MAKE)" -C $(PKG_BUILDDIR)/wolfcrypt/src -f $(CURDIR)/Makefile.wolfcrypt
15+
16+
wolfcrypt-%:
17+
"$(MAKE)" -C $(PKG_BUILDDIR)/wolfcrypt/$* -f $(CURDIR)/Makefile.wolfcrypt-$*

pkg/wolfssl/Makefile.include

Lines changed: 1 addition & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,11 @@
1-
CFLAGS += -Wno-unused-parameter -Wno-unused
21
CFLAGS += -DWOLFSSL_USER_SETTINGS=1
32
CFLAGS += -DWOLFSSL_RIOT_OS=1
3+
44
INCLUDES += -I$(PKGDIRBASE)/../../../
55
INCLUDES += -I$(PKGDIRBASE)/wolfssl
66
INCLUDES += -I$(RIOTBASE)/pkg/wolfssl/sock_tls
77
INCLUDES += -I$(RIOTBASE)/pkg/wolfssl/include
88

9-
# One current limitation is that it is not possible to build `wolfcrypt` without
10-
# including `wolfssl`.
11-
# It would require some changes:
12-
# * Use a different name for the `wolfssl` implementation to differenciate from
13-
# the package directory
14-
# * Declare `wolfssl` a PSEUDOMODULES
15-
# * Remove the archive in Makefile.include for packages as they could be
16-
# PSEUDOMODULES
17-
# `$(USEPKG:%=$(BINDIR)/%.a):`
18-
ifneq (,$(filter wolfcrypt,$(USEMODULE)))
19-
DIRS += $(PKGDIRBASE)/wolfssl/wolfcrypt/src
20-
endif
21-
ifneq (,$(filter wolfcrypt-test,$(USEMODULE)))
22-
DIRS += $(PKGDIRBASE)/wolfssl/wolfcrypt/test
23-
endif
24-
ifneq (,$(filter wolfcrypt-benchmark,$(USEMODULE)))
25-
DIRS += $(PKGDIRBASE)/wolfssl/wolfcrypt/benchmark
26-
endif
27-
ifneq (,$(filter wolfssl,$(USEPKG)))
28-
DIRS += $(PKGDIRBASE)/wolfssl/src
29-
endif
309
ifneq (,$(filter sock_tls,$(USEMODULE)))
3110
DIRS += $(RIOTBASE)/pkg/wolfssl/sock_tls
3211
endif

pkg/wolfssl/Makefile.wolfcrypt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
MODULE = wolfcrypt
22

3+
CFLAGS += -Wno-unused
4+
5+
ifeq (llvm,$(TOOLCHAIN))
6+
CFLAGS += -Wno-unused-parameter
7+
endif
8+
39
SUBMODULES += 1
410

511
NO_AUTO_SRC = 1

pkg/wolfssl/Makefile.wolfssl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,8 @@ MODULE = wolfssl
33
NO_AUTO_SRC = 1
44
SUBMODULES += 1
55

6+
ifeq (llvm,$(TOOLCHAIN))
7+
CFLAGS += -Wno-unused-parameter
8+
endif
9+
610
include $(RIOTBASE)/Makefile.base

0 commit comments

Comments
 (0)