Browse Source

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>
pull/12088/head
Jim Mussared 1 year ago
parent
commit
9573d31071
  1. 2
      extmod/extmod.cmake
  2. 7
      ports/rp2/Makefile
  3. 14
      ports/rp2/boards/WEACTSTUDIO/mpconfigboard.cmake
  4. 1
      ports/samd/boards/ADAFRUIT_METRO_M4_EXPRESS/mpconfigboard.mk
  5. 3
      ports/stm32/Makefile
  6. 2
      ports/stm32/boards/PYBLITEV10/mpconfigboard.mk
  7. 2
      ports/stm32/boards/PYBV10/mpconfigboard.mk
  8. 2
      ports/stm32/boards/PYBV11/mpconfigboard.mk
  9. 8
      py/mkrules.cmake

2
extmod/extmod.cmake

@ -62,7 +62,7 @@ if(MICROPY_PY_BTREE)
set(MICROPY_LIB_BERKELEY_DIR "${MICROPY_DIR}/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.
# Cannot run the add_library/target_include_directories rules (even though
# the build won't run) because IDF will attempt verify the files exist.

7
ports/rp2/Makefile

@ -36,7 +36,7 @@ CMAKE_ARGS += -DCMAKE_BUILD_TYPE=Debug
endif
ifdef BOARD_VARIANT
CMAKE_ARGS += -DBOARD_VARIANT=${BOARD_VARIANT}
CMAKE_ARGS += -DMICROPY_BOARD_VARIANT=$(BOARD_VARIANT)
endif
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 | \
grep '^GIT_SUBMODULES=' | cut -d= -f2); \
$(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}"

14
ports/rp2/boards/WEACTSTUDIO/mpconfigboard.cmake

@ -7,20 +7,18 @@ list(APPEND PICO_BOARD_HEADER_DIRS ${MICROPY_BOARD_DIR})
# Freeze board.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
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")
endif()
if("${BOARD_VARIANT}" STREQUAL "flash_4mb")
set(PICO_BOARD "weactstudio_4mb")
if(MICROPY_BOARD_VARIANT STREQUAL "flash_4mb")
set(PICO_BOARD "weactstudio_4mb")
endif()
if("${BOARD_VARIANT}" STREQUAL "flash_8mb")
set(PICO_BOARD "weactstudio_8mb")
if(MICROPY_BOARD_VARIANT STREQUAL "flash_8mb")
set(PICO_BOARD "weactstudio_8mb")
endif()

1
ports/samd/boards/ADAFRUIT_METRO_M4_EXPRESS/mpconfigboard.mk

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

3
ports/stm32/Makefile

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

2
ports/stm32/boards/PYBLITEV10/mpconfigboard.mk

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

2
ports/stm32/boards/PYBV10/mpconfigboard.mk

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

2
ports/stm32/boards/PYBV11/mpconfigboard.mk

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

8
py/mkrules.cmake

@ -178,7 +178,7 @@ if(MICROPY_FROZEN_MANIFEST)
set(MICROPY_LIB_DIR ${MICROPY_DIR}/lib/micropython-lib)
endif()
if(ECHO_SUBMODULES OR ECHO_QUERY_VARIANTS)
if(ECHO_SUBMODULES)
# No-op, we're just doing submodule/variant discovery.
# 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
@ -223,9 +223,3 @@ if(ECHO_SUBMODULES)
execute_process(COMMAND ${CMAKE_COMMAND} -E echo "GIT_SUBMODULES=${GIT_SUBMODULES}")
message(FATAL_ERROR "Done")
endif()
# Display BOARD_VARIANTS
if(ECHO_BOARD_VARIANTS)
execute_process(COMMAND ${CMAKE_COMMAND} -E echo "BOARD_VARIANTS=${BOARD_VARIANTS}")
message(FATAL_ERROR "Done")
endif()

Loading…
Cancel
Save