From f76a2d201eea6ce1ab12552ae62c64870de2ee35 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ga=C3=ABtan=20Harter?= Date: Mon, 9 Sep 2019 16:55:55 +0200 Subject: [PATCH] Makefile.include: introduce 'BOARDSDIR' for boards directory Introduce a new variable 'BOARDSDIR' to use when referencing the base boards directory. This is a transition to allow defining external boards while still using the `RIOT/boards` directory for like `boards/common` for example through 'RIOTBOARD'. --- Makefile.include | 8 ++++++++ makefiles/vars.inc.mk | 1 + 2 files changed, 9 insertions(+) diff --git a/Makefile.include b/Makefile.include index 12206d33bb..2467c29f97 100644 --- a/Makefile.include +++ b/Makefile.include @@ -25,6 +25,7 @@ include $(RIOT_MAKEFILES_GLOBAL_PRE) RIOTBASE ?= $(_riotbase) RIOTCPU ?= $(RIOTBASE)/cpu RIOTBOARD ?= $(RIOTBASE)/boards +BOARDSDIR ?= $(RIOTBOARD) RIOTMAKE ?= $(RIOTBASE)/makefiles RIOTPKG ?= $(RIOTBASE)/pkg RIOTTOOLS ?= $(RIOTBASE)/dist/tools @@ -81,6 +82,13 @@ override BINDIR := $(abspath $(BINDIR)) override PKGDIRBASE := $(abspath $(PKGDIRBASE)) override DLCACHE_DIR := $(abspath $(DLCACHE_DIR)) +# Keep standard make behavior for new variables +__DIRECTORY_VARIABLES += \ + BOARDSDIR \ + # + +BOARDSDIR := $(abspath $(BOARDSDIR)) + # 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.) diff --git a/makefiles/vars.inc.mk b/makefiles/vars.inc.mk index bc2732b496..4fcb7489e7 100644 --- a/makefiles/vars.inc.mk +++ b/makefiles/vars.inc.mk @@ -26,6 +26,7 @@ export APPDEPS # Files / Makefile targets that need to be created export RIOTBASE # The root folder of RIOT. The folder where this very file lives in. export RIOTCPU # For third party CPUs this folder is the base of the CPUs. export RIOTBOARD # For third party BOARDs this folder is the base of the BOARDs. +export BOARDSDIR # For third party BOARDs this folder is the base of the BOARDs. (Migration in progress) export RIOTPKG # For overriding RIOT's pkg directory export RIOTTOOLS # Location of host machine tools export RIOTPROJECT # Top level git root of the project being built, or PWD if not a git repository