rp2/Makefile: Always use cmake to discover submodules.

Used to be special-cased for Pico, but now everything depends on
micropython-lib if it's using a frozen manifest.

Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
This commit is contained in:
Jim Mussared 2022-07-08 15:26:06 +10:00 committed by Damien George
parent be83c08f46
commit 9a7ac41be6
2 changed files with 13 additions and 13 deletions

View File

@ -54,6 +54,10 @@ if (MICROPY_PY_NETWORK_CYW43)
set(PICO_CYW43_DRIVER_PATH ${MICROPY_DIR}/lib/cyw43-driver)
endif()
# Necessary submodules for all boards.
string(CONCAT GIT_SUBMODULES "${GIT_SUBMODULES} " lib/mbedtls)
string(CONCAT GIT_SUBMODULES "${GIT_SUBMODULES} " lib/tinyusb)
# Include component cmake fragments
include(${MICROPY_DIR}/py/py.cmake)
include(${MICROPY_DIR}/extmod/extmod.cmake)
@ -278,6 +282,11 @@ if (MICROPY_PY_NETWORK_NINAW10)
endif()
if (MICROPY_PY_NETWORK_WIZNET5K)
string(CONCAT GIT_SUBMODULES "${GIT_SUBMODULES} " lib/wiznet5k)
if((NOT (${ECHO_SUBMODULES})) AND NOT EXISTS ${MICROPY_DIR}/lib/wiznet5k/README.md)
message(FATAL_ERROR " wiznet5k not initialized.\n Run 'make BOARD=${MICROPY_BOARD} submodules'")
endif()
target_compile_definitions(${MICROPY_TARGET} PRIVATE
MICROPY_PY_NETWORK_WIZNET5K=1
WIZCHIP_PREFIXED_EXPORTS=1
@ -312,8 +321,6 @@ if (MICROPY_PY_NETWORK_WIZNET5K)
list(APPEND MICROPY_SOURCE_EXTMOD
${MICROPY_DIR}/extmod/network_wiznet5k.c
)
string(CONCAT GIT_SUBMODULES "${GIT_SUBMODULES} " lib/wiznet5k)
endif()
# Add qstr sources for extmod and usermod, in case they are modified by components above.

View File

@ -29,17 +29,10 @@ all:
clean:
$(RM) -rf $(BUILD)
GIT_SUBMODULES += lib/mbedtls lib/tinyusb
# First ensure that pico-sdk is initialised, then use cmake to pick everything
# else (including board-specific dependencies).
submodules:
# lib/pico-sdk is required for the cmake build to function (as used for boards other than PICO below)
$(MAKE) -f ../../py/mkrules.mk GIT_SUBMODULES="lib/pico-sdk" submodules
ifeq ($(BOARD),PICO)
# Run the standard submodules target with minimum required submodules above
$(MAKE) -f ../../py/mkrules.mk GIT_SUBMODULES="$(GIT_SUBMODULES)" submodules
else
# Run submodules task through cmake interface to pick up any board specific dependencies.
GIT_SUBMODULES=$$(cmake -B $(BUILD)/submodules -DECHO_SUBMODULES=1 -DGIT_SUBMODULES="$(GIT_SUBMODULES)" ${CMAKE_ARGS} -S . 2>&1 | \
grep 'GIT_SUBMODULES=' | cut -d= -f2); \
GIT_SUBMODULES=$$(cmake -B $(BUILD)/submodules -DECHO_SUBMODULES=1 ${CMAKE_ARGS} -S . 2>&1 | \
grep '^GIT_SUBMODULES=' | cut -d= -f2); \
$(MAKE) -f ../../py/mkrules.mk GIT_SUBMODULES="$${GIT_SUBMODULES}" submodules
endif