all: Remove query-variants make target.

This is difficult to implement on cmake-based ports, and having the list
of variants in mpconfigboard.{cmake,mk} duplicates information that's
already in board.json.

This removes the existing query-variants make target from stm32 & rp2
and the definition of BOARD_VARIANTS from the various board files.

Also renames the cmake variable to MICROPY_BOARD_VARIANT to match other
variables such as MICROPY_BOARD. The make variable stays as
BOARD_VARIANT.

This work was funded through GitHub Sponsors.

Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
This commit is contained in:
Jim Mussared 2023-07-31 17:32:27 +10:00
parent ad123ed013
commit 9573d31071
9 changed files with 9 additions and 32 deletions

View File

@ -62,7 +62,7 @@ if(MICROPY_PY_BTREE)
set(MICROPY_LIB_BERKELEY_DIR "${MICROPY_DIR}/lib/berkeley-db-1.xx") set(MICROPY_LIB_BERKELEY_DIR "${MICROPY_DIR}/lib/berkeley-db-1.xx")
string(CONCAT GIT_SUBMODULES "${GIT_SUBMODULES} " lib/berkeley-db-1.xx) string(CONCAT GIT_SUBMODULES "${GIT_SUBMODULES} " lib/berkeley-db-1.xx)
if(ECHO_SUBMODULES OR ECHO_QUERY_VARIANTS) if(ECHO_SUBMODULES)
# No-op, we're just doing submodule/variant discovery. # No-op, we're just doing submodule/variant discovery.
# Cannot run the add_library/target_include_directories rules (even though # Cannot run the add_library/target_include_directories rules (even though
# the build won't run) because IDF will attempt verify the files exist. # the build won't run) because IDF will attempt verify the files exist.

View File

@ -36,7 +36,7 @@ CMAKE_ARGS += -DCMAKE_BUILD_TYPE=Debug
endif endif
ifdef BOARD_VARIANT ifdef BOARD_VARIANT
CMAKE_ARGS += -DBOARD_VARIANT=${BOARD_VARIANT} CMAKE_ARGS += -DMICROPY_BOARD_VARIANT=$(BOARD_VARIANT)
endif endif
HELP_BUILD_ERROR ?= "See \033[1;31mhttps://github.com/micropython/micropython/wiki/Build-Troubleshooting\033[0m" HELP_BUILD_ERROR ?= "See \033[1;31mhttps://github.com/micropython/micropython/wiki/Build-Troubleshooting\033[0m"
@ -60,8 +60,3 @@ submodules:
@GIT_SUBMODULES=$$(cmake -B $(BUILD)/submodules -DECHO_SUBMODULES=1 ${CMAKE_ARGS} -S . 2>&1 | \ @GIT_SUBMODULES=$$(cmake -B $(BUILD)/submodules -DECHO_SUBMODULES=1 ${CMAKE_ARGS} -S . 2>&1 | \
grep '^GIT_SUBMODULES=' | cut -d= -f2); \ grep '^GIT_SUBMODULES=' | cut -d= -f2); \
$(MAKE) -f ../../py/mkrules.mk GIT_SUBMODULES="$${GIT_SUBMODULES}" submodules $(MAKE) -f ../../py/mkrules.mk GIT_SUBMODULES="$${GIT_SUBMODULES}" submodules
query-variants:
@BOARD_VARIANTS=$$(cmake -B $(BUILD)/variants -DECHO_BOARD_VARIANTS=1 ${CMAKE_ARGS} -S . 2>&1 | \
grep '^BOARD_VARIANTS=' | cut -d= -f2); \
echo "VARIANTS: $${BOARD_VARIANTS}"

View File

@ -7,20 +7,18 @@ list(APPEND PICO_BOARD_HEADER_DIRS ${MICROPY_BOARD_DIR})
# Freeze board.py # Freeze board.py
set(MICROPY_FROZEN_MANIFEST ${MICROPY_BOARD_DIR}/manifest.py) set(MICROPY_FROZEN_MANIFEST ${MICROPY_BOARD_DIR}/manifest.py)
# Provide different variants for the downloads page
set(BOARD_VARIANTS "flash_2mb flash_4mb flash_8mb flash_16mb")
# Select the 16MB variant as the default # Select the 16MB variant as the default
set(PICO_BOARD "weactstudio_16mb") set(PICO_BOARD "weactstudio_16mb")
if("${BOARD_VARIANT}" STREQUAL "flash_2mb") # Provide different variants for the downloads page
if(MICROPY_BOARD_VARIANT STREQUAL "flash_2mb")
set(PICO_BOARD "weactstudio_2mb") set(PICO_BOARD "weactstudio_2mb")
endif() endif()
if("${BOARD_VARIANT}" STREQUAL "flash_4mb") if(MICROPY_BOARD_VARIANT STREQUAL "flash_4mb")
set(PICO_BOARD "weactstudio_4mb") set(PICO_BOARD "weactstudio_4mb")
endif() endif()
if("${BOARD_VARIANT}" STREQUAL "flash_8mb") if(MICROPY_BOARD_VARIANT STREQUAL "flash_8mb")
set(PICO_BOARD "weactstudio_8mb") set(PICO_BOARD "weactstudio_8mb")
endif() endif()

View File

@ -7,5 +7,4 @@ TEXT0 = 0x4000
MICROPY_PY_NETWORK ?= 1 MICROPY_PY_NETWORK ?= 1
MICROPY_PY_NETWORK_NINAW10 ?= 1 MICROPY_PY_NETWORK_NINAW10 ?= 1
BOARD_VARIANTS += "wlan"
MICROPY_HW_CODESIZE ?= 496K MICROPY_HW_CODESIZE ?= 496K

View File

@ -43,9 +43,6 @@ include $(TOP)/extmod/extmod.mk
GIT_SUBMODULES += lib/libhydrogen lib/stm32lib GIT_SUBMODULES += lib/libhydrogen lib/stm32lib
query-variants:
$(ECHO) "VARIANTS:" $(BOARD_VARIANTS)
LD_DIR=boards LD_DIR=boards
USBDEV_DIR=usbdev USBDEV_DIR=usbdev
#USBHOST_DIR=usbhost #USBHOST_DIR=usbhost

View File

@ -6,8 +6,6 @@ TEXT0_ADDR = 0x08000000
TEXT1_ADDR = 0x08020000 TEXT1_ADDR = 0x08020000
# Provide different variants for the downloads page. # Provide different variants for the downloads page.
BOARD_VARIANTS += "dp thread dp-thread network"
ifeq ($(BOARD_VARIANT),dp) ifeq ($(BOARD_VARIANT),dp)
MICROPY_FLOAT_IMPL=double MICROPY_FLOAT_IMPL=double
endif endif

View File

@ -16,8 +16,6 @@ endif
MICROPY_VFS_LFS2 = 1 MICROPY_VFS_LFS2 = 1
# Provide different variants for the downloads page. # Provide different variants for the downloads page.
BOARD_VARIANTS += "dp thread dp-thread network"
ifeq ($(BOARD_VARIANT),dp) ifeq ($(BOARD_VARIANT),dp)
MICROPY_FLOAT_IMPL=double MICROPY_FLOAT_IMPL=double
endif endif

View File

@ -16,8 +16,6 @@ endif
MICROPY_VFS_LFS2 = 1 MICROPY_VFS_LFS2 = 1
# Provide different variants for the downloads page. # Provide different variants for the downloads page.
BOARD_VARIANTS += "dp thread dp-thread network"
ifeq ($(BOARD_VARIANT),dp) ifeq ($(BOARD_VARIANT),dp)
MICROPY_FLOAT_IMPL=double MICROPY_FLOAT_IMPL=double
endif endif

View File

@ -178,7 +178,7 @@ if(MICROPY_FROZEN_MANIFEST)
set(MICROPY_LIB_DIR ${MICROPY_DIR}/lib/micropython-lib) set(MICROPY_LIB_DIR ${MICROPY_DIR}/lib/micropython-lib)
endif() endif()
if(ECHO_SUBMODULES OR ECHO_QUERY_VARIANTS) if(ECHO_SUBMODULES)
# No-op, we're just doing submodule/variant discovery. # No-op, we're just doing submodule/variant discovery.
# Note: All the following rules are safe to run in discovery mode even # Note: All the following rules are safe to run in discovery mode even
# though the submodule might not be available as they do not directly depend # though the submodule might not be available as they do not directly depend
@ -223,9 +223,3 @@ if(ECHO_SUBMODULES)
execute_process(COMMAND ${CMAKE_COMMAND} -E echo "GIT_SUBMODULES=${GIT_SUBMODULES}") execute_process(COMMAND ${CMAKE_COMMAND} -E echo "GIT_SUBMODULES=${GIT_SUBMODULES}")
message(FATAL_ERROR "Done") message(FATAL_ERROR "Done")
endif() endif()
# Display BOARD_VARIANTS
if(ECHO_BOARD_VARIANTS)
execute_process(COMMAND ${CMAKE_COMMAND} -E echo "BOARD_VARIANTS=${BOARD_VARIANTS}")
message(FATAL_ERROR "Done")
endif()