Skip to content

Commit

Permalink
Makefile.include: RIOTBOARD as BOARDSDIR fallback
Browse files Browse the repository at this point in the history
  • Loading branch information
fjmolinas committed Dec 15, 2019
1 parent 598045d commit c895b44
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions Makefile.include
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,20 @@ __DIRECTORY_VARIABLES += \

BOARDSDIR := $(abspath $(BOARDSDIR))

# Include Board and CPU configuration, if BOARD is not found in BOARDSDIR
# e.g. when set by the environment fallback to searching in RIOTBOARD
ifeq (,$(wildcard $(BOARDSDIR)/$(BOARD)))
ifneq ($(RIOTBOARD),$(BOARDSDIR))
$(warning The specified board $(BOARD) was not found in $(BOARDSDIR) fallback to RIOTBOARD)
BOARDSDIR = $(RIOTBOARD)
endif
ifeq ($(RIOTBOARD),$(BOARDSDIR))
ifeq (,$(wildcard $(BOARDSDIR)/$(BOARD)))
$(error The specified board $(BOARD) does not exist.)
endif
endif
endif

# Ensure that all directories are set and don't contain spaces.
ifneq (, $(filter-out 1, $(foreach v,$(__DIRECTORY_VARIABLES),$(words $($(v))))))
$(info Aborting compilation for your safety.)
Expand Down Expand Up @@ -259,9 +273,6 @@ LAZYSPONGE_FLAGS ?= $(if $(filter 1,$(QUIET)),,--verbose)
ifeq (, $(APPLICATION))
$(error An application name must be specified as APPLICATION.)
endif
ifneq (0,$(shell test -d $(BOARDSDIR)/$(BOARD); echo $$?))
$(error The specified board $(BOARD) does not exist.)
endif

# Use TOOLCHAIN environment variable to select the toolchain to use.
# Default for macOS: llvm; for other OS: gnu
Expand Down

0 comments on commit c895b44

Please sign in to comment.