2019-05-27 20:56:47 +02:00
|
|
|
# Default when RIOTBASE is not set and is executed from the RIOT directory
|
2020-01-24 14:45:24 +01:00
|
|
|
RIOTBOARD ?= $(or $(RIOTBASE),$(CURDIR))/boards
|
2020-04-14 15:23:23 +02:00
|
|
|
BOARDSDIRS ?= $(EXTERNAL_BOARD_DIRS) $(RIOTBOARD)
|
2019-05-27 20:56:47 +02:00
|
|
|
|
2019-12-15 10:40:54 +01:00
|
|
|
# List all boards in a directory
|
2020-04-14 15:23:23 +02:00
|
|
|
# By default, all directories in board directory except 'common'
|
2019-05-27 20:56:47 +02:00
|
|
|
# use 'wildcard */.' to only list directories
|
2019-12-15 10:40:54 +01:00
|
|
|
_get_boards_in_directory = $(filter-out common,$(patsubst $1/%/.,%,$(wildcard $1/*/.)))
|
|
|
|
|
2020-04-14 15:23:23 +02:00
|
|
|
# Use `:=` so that it is evaluated before BOARDSDIRS gets eventually changed
|
|
|
|
ALLBOARDS := $(sort \
|
|
|
|
$(foreach dir,\
|
|
|
|
$(BOARDSDIRS),\
|
|
|
|
$(call _get_boards_in_directory,$(dir))))
|
2019-05-27 20:56:47 +02:00
|
|
|
|
|
|
|
# Set the default value from `BOARDS`
|
|
|
|
BOARDS ?= $(ALLBOARDS)
|
|
|
|
|
2021-10-12 10:39:57 +02:00
|
|
|
.PHONY: info-boards info-emulated-boards
|
2019-05-27 20:56:47 +02:00
|
|
|
info-boards:
|
|
|
|
@echo $(BOARDS)
|
2021-10-12 10:39:57 +02:00
|
|
|
|
|
|
|
EMULATED_BOARDS_RENODE := $(wildcard $(BOARDSDIRS)/*/dist/board.resc)
|
|
|
|
EMULATED_BOARDS_QEMU := microbit
|
|
|
|
EMULATED_BOARDS := \
|
|
|
|
$(EMULATED_BOARDS_QEMU) \
|
|
|
|
$(foreach board_path,$(EMULATED_BOARDS_RENODE),$(subst $(strip $(BOARDSDIRS)/),,$(subst /dist/board.resc,,$(board_path))))
|
|
|
|
#
|
|
|
|
|
|
|
|
info-emulated-boards:
|
|
|
|
@echo $(sort $(EMULATED_BOARDS))
|