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
|
|
|
|
BOARDSDIR ?= $(RIOTBOARD)
|
2019-05-27 20:56:47 +02:00
|
|
|
|
2019-12-15 10:40:54 +01:00
|
|
|
# List all boards in a directory
|
2019-09-09 17:00:59 +02:00
|
|
|
# By default, all directories in BOARDSDIR 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/*/.)))
|
|
|
|
|
|
|
|
# If BOARDSDIR is not in RIOTBOARD also list BOARDS in RIOTBOARD
|
|
|
|
ifneq ($(RIOTBOARD),$(BOARDSDIR))
|
|
|
|
ALLBOARDS_RIOTBOARD ?= $(call _get_boards_in_directory,$(RIOTBOARD))
|
|
|
|
endif
|
|
|
|
|
2020-01-24 17:59:46 +01:00
|
|
|
# Use `:=` so that it is evaluated before BOARDSDIR gets eventually changed
|
|
|
|
ALLBOARDS := $(sort $(call _get_boards_in_directory,$(BOARDSDIR)) $(ALLBOARDS_RIOTBOARD))
|
2019-05-27 20:56:47 +02:00
|
|
|
|
|
|
|
# Set the default value from `BOARDS`
|
|
|
|
BOARDS ?= $(ALLBOARDS)
|
|
|
|
|
|
|
|
.PHONY: info-boards
|
|
|
|
info-boards:
|
|
|
|
@echo $(BOARDS)
|