Skip to content

Commit 87011f6

Browse files
jimmodpgeorge
authored andcommitted
extmod/extmod.mk: Make extmod.mk handle GIT_SUBMODULES.
This applies to nimble, btstack, axtls, mbedtls, lwip. Rather than having the ports individually manage GIT_SUBMODULES for these components, make extmod.mk append them when the relevant feature is enabled. Signed-off-by: Jim Mussared <[email protected]>
1 parent 065af04 commit 87011f6

File tree

7 files changed

+13
-11
lines changed

7 files changed

+13
-11
lines changed

extmod/btstack/btstack.mk

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
ifeq ($(MICROPY_BLUETOOTH_BTSTACK),1)
44

5+
GIT_SUBMODULES += lib/btstack
56
MICROPY_BLUETOOTH_BTSTACK_USB ?= 0
67

78
BTSTACK_EXTMOD_DIR = extmod/btstack

extmod/extmod.mk

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ CFLAGS_MOD += -DMICROPY_PY_USSL=1
100100
ifeq ($(MICROPY_SSL_AXTLS),1)
101101
CFLAGS_MOD += -DMICROPY_SSL_AXTLS=1 -I$(TOP)/lib/axtls/ssl -I$(TOP)/lib/axtls/crypto -I$(TOP)/extmod/axtls-include
102102
AXTLS_DIR = lib/axtls
103+
GIT_SUBMODULES += $(AXTLS_DIR)
103104
$(BUILD)/$(AXTLS_DIR)/%.o: CFLAGS += -Wno-all -Wno-unused-parameter -Wno-uninitialized -Wno-sign-compare -Wno-old-style-definition -Dmp_stream_errno=errno $(AXTLS_DEFS_EXTRA)
104105
SRC_MOD += $(addprefix $(AXTLS_DIR)/,\
105106
ssl/asn1.c \
@@ -118,7 +119,7 @@ SRC_MOD += $(addprefix $(AXTLS_DIR)/,\
118119
)
119120
else ifeq ($(MICROPY_SSL_MBEDTLS),1)
120121
MBEDTLS_DIR = lib/mbedtls
121-
CFLAGS_MOD += -DMICROPY_SSL_MBEDTLS=1 -I$(TOP)/$(MBEDTLS_DIR)/include
122+
GIT_SUBMODULES += $(MBEDTLS_DIR)
122123
SRC_MOD += lib/mbedtls_errors/mp_mbedtls_errors.c
123124
SRC_MOD += $(addprefix $(MBEDTLS_DIR)/library/,\
124125
aes.c \
@@ -199,6 +200,7 @@ endif
199200
# lwip
200201

201202
ifeq ($(MICROPY_PY_LWIP),1)
203+
GIT_SUBMODULES += lib/lwip
202204
# A port should add an include path where lwipopts.h can be found (eg extmod/lwip-include)
203205
LWIP_DIR = lib/lwip/src
204206
INC += -I$(TOP)/$(LWIP_DIR)/include

extmod/nimble/nimble.mk

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ CFLAGS_MOD += -DMICROPY_BLUETOOTH_NIMBLE_BINDINGS_ONLY=$(MICROPY_BLUETOOTH_NIMBL
1717

1818
ifeq ($(MICROPY_BLUETOOTH_NIMBLE_BINDINGS_ONLY),0)
1919

20+
GIT_SUBMODULES += lib/mynewt-nimble
21+
2022
# On all ports where we provide the full implementation (i.e. not just
2123
# bindings like on ESP32), then we don't need to use the ringbuffer. In this
2224
# case, all NimBLE events are run by the MicroPython scheduler. On Unix, the

ports/mimxrt/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ BOARD_DIR ?= boards/$(BOARD)
77
BUILD ?= build-$(BOARD)
88
PORT ?= /dev/ttyACM0
99
CROSS_COMPILE ?= arm-none-eabi-
10-
GIT_SUBMODULES += lib/tinyusb lib/nxp_driver lib/lwip lib/mbedtls
10+
GIT_SUBMODULES += lib/tinyusb lib/nxp_driver
1111

1212
# MicroPython feature configurations
1313
FROZEN_MANIFEST ?= boards/manifest.py

ports/stm32/Makefile

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ MBOOT_TEXT0_ADDR ?= 0x08000000
3535
include $(TOP)/py/py.mk
3636
include $(TOP)/extmod/extmod.mk
3737

38-
GIT_SUBMODULES += lib/libhydrogen lib/lwip lib/mbedtls lib/stm32lib
38+
GIT_SUBMODULES += lib/libhydrogen lib/stm32lib
3939

4040
query-variants:
4141
$(ECHO) "VARIANTS:" $(BOARD_VARIANTS)
@@ -531,14 +531,12 @@ endif
531531
endif
532532

533533
ifeq ($(MICROPY_BLUETOOTH_NIMBLE),1)
534-
GIT_SUBMODULES += lib/mynewt-nimble
535534
CFLAGS_MOD += -DMICROPY_PY_BLUETOOTH_ENABLE_L2CAP_CHANNELS=1
536535
include $(TOP)/extmod/nimble/nimble.mk
537536
SRC_C += mpnimbleport.c
538537
endif
539538

540539
ifeq ($(MICROPY_BLUETOOTH_BTSTACK),1)
541-
GIT_SUBMODULES += lib/btstack
542540
MICROPY_BLUETOOTH_BTSTACK_H4 ?= 1
543541
include $(TOP)/extmod/btstack/btstack.mk
544542
SRC_C += mpbtstackport.c

ports/unix/Makefile

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -133,10 +133,9 @@ endif
133133

134134
ifeq ($(MICROPY_PY_USSL),1)
135135
ifeq ($(MICROPY_SSL_AXTLS),1)
136-
GIT_SUBMODULES += lib/axtls
136+
137137
endif
138138
ifeq ($(MICROPY_SSL_MBEDTLS),1)
139-
GIT_SUBMODULES += lib/mbedtls
140139
CFLAGS += -DMBEDTLS_CONFIG_FILE='"mbedtls/mbedtls_config.h"'
141140
endif
142141
endif
@@ -182,14 +181,12 @@ endif
182181
endif
183182

184183
# BTstack is enabled.
185-
GIT_SUBMODULES += lib/btstack
186184
include $(TOP)/extmod/btstack/btstack.mk
187185
SRC_BTSTACK += lib/btstack/platform/embedded/btstack_run_loop_embedded.c
188186

189187
else
190188

191189
# NimBLE is enabled.
192-
GIT_SUBMODULES += lib/mynewt-nimble
193190
CFLAGS += -DMICROPY_PY_BLUETOOTH_ENABLE_L2CAP_CHANNELS=1
194191
include $(TOP)/extmod/nimble/nimble.mk
195192

tools/ci.sh

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -198,8 +198,9 @@ function ci_mimxrt_setup {
198198

199199
function ci_mimxrt_build {
200200
make ${MAKEOPTS} -C mpy-cross
201-
make ${MAKEOPTS} -C ports/mimxrt submodules
201+
make ${MAKEOPTS} -C ports/mimxrt BOARD=MIMXRT1020_EVK submodules
202202
make ${MAKEOPTS} -C ports/mimxrt BOARD=MIMXRT1020_EVK
203+
make ${MAKEOPTS} -C ports/mimxrt BOARD=TEENSY40 submodules
203204
make ${MAKEOPTS} -C ports/mimxrt BOARD=TEENSY40
204205
}
205206

@@ -310,6 +311,7 @@ function ci_stm32_setup {
310311
function ci_stm32_pyb_build {
311312
make ${MAKEOPTS} -C mpy-cross
312313
make ${MAKEOPTS} -C ports/stm32 MICROPY_PY_NETWORK_WIZNET5K=5200 submodules
314+
make ${MAKEOPTS} -C ports/stm32 BOARD=PYBD_SF2 submodules
313315
git submodule update --init lib/btstack
314316
git submodule update --init lib/mynewt-nimble
315317
make ${MAKEOPTS} -C ports/stm32 BOARD=PYBV11 MICROPY_PY_NETWORK_WIZNET5K=5200 USER_C_MODULES=../../examples/usercmodule
@@ -326,7 +328,7 @@ function ci_stm32_pyb_build {
326328

327329
function ci_stm32_nucleo_build {
328330
make ${MAKEOPTS} -C mpy-cross
329-
make ${MAKEOPTS} -C ports/stm32 submodules
331+
make ${MAKEOPTS} -C ports/stm32 BOARD=NUCLEO_H743ZI submodules
330332
git submodule update --init lib/mynewt-nimble
331333

332334
# Test building various MCU families, some with additional options.

0 commit comments

Comments
 (0)