1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00
RIOT/makefiles/boards.inc.mk
2020-01-24 14:45:24 +01:00

24 lines
776 B
Makefile

# Default when RIOTBASE is not set and is executed from the RIOT directory
RIOTBOARD ?= $(or $(RIOTBASE),$(CURDIR))/boards
BOARDSDIR ?= $(RIOTBOARD)
# List all boards in a directory
# By default, all directories in BOARDSDIR except 'common'
# use 'wildcard */.' to only list directories
_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
# Get all boards
ALLBOARDS ?= $(sort $(call _get_boards_in_directory,$(BOARDSDIR)) $(ALLBOARDS_RIOTBOARD))
# Set the default value from `BOARDS`
BOARDS ?= $(ALLBOARDS)
.PHONY: info-boards
info-boards:
@echo $(BOARDS)