Browse Source

rp2/Makefile: Add support for BOARD_VARIANTS.

Following stm32.  This allows a single board definition to define variants
of its configuration.
pull/8505/head
Matt Trentini 2 years ago
committed by Damien George
parent
commit
0bc1d10557
  1. 9
      ports/rp2/Makefile
  2. 6
      py/mkrules.cmake

9
ports/rp2/Makefile

@ -22,6 +22,10 @@ ifeq ($(DEBUG),1)
CMAKE_ARGS += -DCMAKE_BUILD_TYPE=Debug CMAKE_ARGS += -DCMAKE_BUILD_TYPE=Debug
endif endif
ifdef BOARD_VARIANT
CMAKE_ARGS += -DBOARD_VARIANT=${BOARD_VARIANT}
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"
all: all:
@ -38,3 +42,8 @@ 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}"

6
py/mkrules.cmake

@ -223,3 +223,9 @@ 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()

Loading…
Cancel
Save