Fixes: #69548 Support extending an existing board with new board variants. This commit introduces the following changes to allow a board to be extended out-of-tree. The board yaml schema is extended to support an extend field which will be used to identify the board to be extended. A board 'plank' can be extended like this: > board: > extend: plank > variants: > - name: ext > qualifier: soc1 For the rest of the build system this means that there is no longer a single board directory. The existing CMake variable BOARD_DIR is kept and reference the directory which defines the board. A new CMake variable BOARD_DIRECTORIES provides a list of all directories which defines board targets for the board. This means the directory which defines the board as well as all directories that extends the board. Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
28 lines
804 B
Text
28 lines
804 B
Text
# Copyright (c) 2022-2024 Nordic Semiconductor ASA
|
|
|
|
# SPDX-License-Identifier: Apache-2.0
|
|
|
|
BOARD_STRING := $(normalize_upper,$(BOARD))
|
|
BOARD_TARGET_STRING := $(normalize_upper,$(BOARD)$(BOARD_QUALIFIERS))
|
|
BOARD_QUALIFIERS_NO_SEPARATOR := $(substring,$(BOARD_QUALIFIERS),1)
|
|
|
|
config BOARD_$(BOARD_STRING)
|
|
def_bool y
|
|
help
|
|
Kconfig symbol identifying the board.
|
|
|
|
config BOARD_$(BOARD_TARGET_STRING)
|
|
def_bool y
|
|
help
|
|
Kconfig symbol identifying the board target.
|
|
|
|
config BOARD_QUALIFIERS
|
|
string
|
|
default "$(BOARD_QUALIFIERS_NO_SEPARATOR)"
|
|
help
|
|
Contains the qualifiers of the board being used without the name of the board itself.
|
|
|
|
For example, if building for ``nrf5340dk/nrf5340/cpuapp`` then this will contain the
|
|
value ``nrf5340/cpuapp``.
|
|
|
|
osource "$(KCONFIG_BOARD_DIR)/Kconfig.$(BOARD)"
|