- Add the new EXTERNAL_BOARD_DIRS variable that can contain a space separated
list of folders containing external boards
- Introduce $(BOARDDIR) as shortcut for $(BOARDSDIR)/$(BOARD)
- Map the existing BOARDSDIR to the new approach
- If BOARDSDIR is provided by the user, it will be added to
EXTERNAL_BOARD_DIRS for backward compatibility. (And a warning is issued
to encourage users migrating to EXTRA_BOARDS.)
- BOARDSDIR is updated after the board is found to "$(BOARDDIR)/..".
- Useful for `include $(BOARDSDIR)/common/external_common/Makefile.dep`
- Provides backward compatibility
22 lines
775 B
Makefile
22 lines
775 B
Makefile
# Default when RIOTBASE is not set and is executed from the RIOT directory
|
|
RIOTBOARD ?= $(or $(RIOTBASE),$(CURDIR))/boards
|
|
BOARDSDIRS ?= $(EXTERNAL_BOARD_DIRS) $(RIOTBOARD)
|
|
|
|
# List all boards in a directory
|
|
# By default, all directories in board directory except 'common'
|
|
# use 'wildcard */.' to only list directories
|
|
_get_boards_in_directory = $(filter-out common,$(patsubst $1/%/.,%,$(wildcard $1/*/.)))
|
|
|
|
# Use `:=` so that it is evaluated before BOARDSDIRS gets eventually changed
|
|
ALLBOARDS := $(sort \
|
|
$(foreach dir,\
|
|
$(BOARDSDIRS),\
|
|
$(call _get_boards_in_directory,$(dir))))
|
|
|
|
# Set the default value from `BOARDS`
|
|
BOARDS ?= $(ALLBOARDS)
|
|
|
|
.PHONY: info-boards
|
|
info-boards:
|
|
@echo $(BOARDS)
|