Merge pull request #12183 from cladmi/pr/boardsdir
Makefile.include: introduce 'BOARDSDIR' for boards directory
This commit is contained in:
commit
c839bb809a
@ -6,7 +6,7 @@ OLD_USEPKG := $(sort $(USEPKG))
|
|||||||
-include $(APPDIR)/Makefile.board.dep
|
-include $(APPDIR)/Makefile.board.dep
|
||||||
|
|
||||||
# include board dependencies
|
# include board dependencies
|
||||||
-include $(RIOTBOARD)/$(BOARD)/Makefile.dep
|
-include $(BOARDSDIR)/$(BOARD)/Makefile.dep
|
||||||
|
|
||||||
# include cpu dependencies
|
# include cpu dependencies
|
||||||
-include $(RIOTCPU)/$(CPU)/Makefile.dep
|
-include $(RIOTCPU)/$(CPU)/Makefile.dep
|
||||||
|
|||||||
@ -5,7 +5,11 @@
|
|||||||
# This makes them available when setting features based on CPU_MODEL in the cpu
|
# This makes them available when setting features based on CPU_MODEL in the cpu
|
||||||
# Makefile.features and also during dependency resolution.
|
# Makefile.features and also during dependency resolution.
|
||||||
|
|
||||||
include $(RIOTBOARD)/$(BOARD)/Makefile.features
|
# Transition:
|
||||||
|
# Moving 'CPU/CPU_MODEL' to Makefile.features is an ongoing work and may not
|
||||||
|
# reflect the state of all boards for the moment.
|
||||||
|
|
||||||
|
include $(BOARDSDIR)/$(BOARD)/Makefile.features
|
||||||
|
|
||||||
# Sanity check
|
# Sanity check
|
||||||
ifeq (,$(CPU))
|
ifeq (,$(CPU))
|
||||||
|
|||||||
@ -24,7 +24,9 @@ include $(RIOT_MAKEFILES_GLOBAL_PRE)
|
|||||||
# set undefined variables
|
# set undefined variables
|
||||||
RIOTBASE ?= $(_riotbase)
|
RIOTBASE ?= $(_riotbase)
|
||||||
RIOTCPU ?= $(RIOTBASE)/cpu
|
RIOTCPU ?= $(RIOTBASE)/cpu
|
||||||
|
# Deprecated to set RIOTBOARD, use BOARDSDIR
|
||||||
RIOTBOARD ?= $(RIOTBASE)/boards
|
RIOTBOARD ?= $(RIOTBASE)/boards
|
||||||
|
BOARDSDIR ?= $(RIOTBOARD)
|
||||||
RIOTMAKE ?= $(RIOTBASE)/makefiles
|
RIOTMAKE ?= $(RIOTBASE)/makefiles
|
||||||
RIOTPKG ?= $(RIOTBASE)/pkg
|
RIOTPKG ?= $(RIOTBASE)/pkg
|
||||||
RIOTTOOLS ?= $(RIOTBASE)/dist/tools
|
RIOTTOOLS ?= $(RIOTBASE)/dist/tools
|
||||||
@ -45,7 +47,6 @@ DLCACHE_DIR ?= $(RIOTBASE)/.dlcache
|
|||||||
__DIRECTORY_VARIABLES := \
|
__DIRECTORY_VARIABLES := \
|
||||||
RIOTBASE \
|
RIOTBASE \
|
||||||
RIOTCPU \
|
RIOTCPU \
|
||||||
RIOTBOARD \
|
|
||||||
RIOTMAKE \
|
RIOTMAKE \
|
||||||
RIOTPKG \
|
RIOTPKG \
|
||||||
RIOTTOOLS \
|
RIOTTOOLS \
|
||||||
@ -59,10 +60,22 @@ __DIRECTORY_VARIABLES := \
|
|||||||
DLCACHE_DIR \
|
DLCACHE_DIR \
|
||||||
#
|
#
|
||||||
|
|
||||||
|
# In GNU make command line is supposed to override the value set in makefile
|
||||||
|
# These variables can be overridden even when set from command line
|
||||||
|
__OVERRIDE_DIRECTORY_VARIABLES := $(__DIRECTORY_VARIABLES)
|
||||||
|
# Use absolute paths in recursive "make" even if overridden on command line.
|
||||||
|
MAKEOVERRIDES += $(foreach v,$(__OVERRIDE_DIRECTORY_VARIABLES),$(v)=$($(v)))
|
||||||
|
|
||||||
|
# Deprecation of configuring 'RIOTBOARD'
|
||||||
|
ifneq ($(abspath $(RIOTBASE)/boards),$(abspath $(RIOTBOARD)))
|
||||||
|
$(warning overriding RIOTBOARD for external boards is deprecated, please use an absolute BOARDSDIR)
|
||||||
|
override RIOTBOARD := $(abspath $(RIOTBOARD))
|
||||||
|
__DIRECTORY_VARIABLES += RIOTBOARD
|
||||||
|
endif
|
||||||
|
|
||||||
# Make all paths absolute.
|
# Make all paths absolute.
|
||||||
override RIOTBASE := $(abspath $(RIOTBASE))
|
override RIOTBASE := $(abspath $(RIOTBASE))
|
||||||
override RIOTCPU := $(abspath $(RIOTCPU))
|
override RIOTCPU := $(abspath $(RIOTCPU))
|
||||||
override RIOTBOARD := $(abspath $(RIOTBOARD))
|
|
||||||
override RIOTMAKE := $(abspath $(RIOTMAKE))
|
override RIOTMAKE := $(abspath $(RIOTMAKE))
|
||||||
override RIOTPKG := $(abspath $(RIOTPKG))
|
override RIOTPKG := $(abspath $(RIOTPKG))
|
||||||
override RIOTTOOLS := $(abspath $(RIOTTOOLS))
|
override RIOTTOOLS := $(abspath $(RIOTTOOLS))
|
||||||
@ -75,6 +88,13 @@ override BINDIR := $(abspath $(BINDIR))
|
|||||||
override PKGDIRBASE := $(abspath $(PKGDIRBASE))
|
override PKGDIRBASE := $(abspath $(PKGDIRBASE))
|
||||||
override DLCACHE_DIR := $(abspath $(DLCACHE_DIR))
|
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.
|
# Ensure that all directories are set and don't contain spaces.
|
||||||
ifneq (, $(filter-out 1, $(foreach v,$(__DIRECTORY_VARIABLES),$(words $($(v))))))
|
ifneq (, $(filter-out 1, $(foreach v,$(__DIRECTORY_VARIABLES),$(words $($(v))))))
|
||||||
$(info Aborting compilation for your safety.)
|
$(info Aborting compilation for your safety.)
|
||||||
@ -82,9 +102,6 @@ ifneq (, $(filter-out 1, $(foreach v,$(__DIRECTORY_VARIABLES),$(words $($(v)))))
|
|||||||
$(error Make sure no path override is empty or contains spaces!)
|
$(error Make sure no path override is empty or contains spaces!)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# Use absolute paths in recusive "make" even if overriden on command line.
|
|
||||||
MAKEOVERRIDES += $(foreach v,$(__DIRECTORY_VARIABLES),$(v)=$($(v)))
|
|
||||||
|
|
||||||
# Path to the current directory relative to RIOTPROJECT
|
# Path to the current directory relative to RIOTPROJECT
|
||||||
# trailing '/' is important when RIOTPROJECT == CURDIR
|
# trailing '/' is important when RIOTPROJECT == CURDIR
|
||||||
BUILDRELPATH ?= $(patsubst $(RIOTPROJECT)/%,%,$(CURDIR)/)
|
BUILDRELPATH ?= $(patsubst $(RIOTPROJECT)/%,%,$(CURDIR)/)
|
||||||
@ -248,7 +265,7 @@ LAZYSPONGE_FLAGS ?= $(if $(filter 1,$(QUIET)),,--verbose)
|
|||||||
ifeq (, $(APPLICATION))
|
ifeq (, $(APPLICATION))
|
||||||
$(error An application name must be specified as APPLICATION.)
|
$(error An application name must be specified as APPLICATION.)
|
||||||
endif
|
endif
|
||||||
ifneq (0,$(shell test -d $(RIOTBOARD)/$(BOARD); echo $$?))
|
ifneq (0,$(shell test -d $(BOARDSDIR)/$(BOARD); echo $$?))
|
||||||
$(error The specified board $(BOARD) does not exist.)
|
$(error The specified board $(BOARD) does not exist.)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
@ -306,8 +323,8 @@ include $(RIOTMAKE)/pseudomodules.inc.mk
|
|||||||
include $(RIOTMAKE)/defaultmodules.inc.mk
|
include $(RIOTMAKE)/defaultmodules.inc.mk
|
||||||
|
|
||||||
# Include Board and CPU configuration
|
# Include Board and CPU configuration
|
||||||
INCLUDES += $(addprefix -I,$(wildcard $(RIOTBOARD)/$(BOARD)/include))
|
INCLUDES += $(addprefix -I,$(wildcard $(BOARDSDIR)/$(BOARD)/include))
|
||||||
include $(RIOTBOARD)/$(BOARD)/Makefile.include
|
include $(BOARDSDIR)/$(BOARD)/Makefile.include
|
||||||
INCLUDES += -I$(RIOTCPU)/$(CPU)/include
|
INCLUDES += -I$(RIOTCPU)/$(CPU)/include
|
||||||
include $(RIOTCPU)/$(CPU)/Makefile.include
|
include $(RIOTCPU)/$(CPU)/Makefile.include
|
||||||
|
|
||||||
|
|||||||
2
dist/gdbinit-docker
vendored
2
dist/gdbinit-docker
vendored
@ -18,7 +18,7 @@ except KeyError:
|
|||||||
else:
|
else:
|
||||||
gdb.execute('set substitute-path /data/riotbuild/riotcpu ' + path)
|
gdb.execute('set substitute-path /data/riotbuild/riotcpu ' + path)
|
||||||
try:
|
try:
|
||||||
path = os.environ['RIOTBOARD']
|
path = os.environ['BOARDSDIR']
|
||||||
except KeyError:
|
except KeyError:
|
||||||
# Environment variable wasn't set.
|
# Environment variable wasn't set.
|
||||||
pass
|
pass
|
||||||
|
|||||||
1
dist/tools/buildsystem_sanity_check/check.sh
vendored
1
dist/tools/buildsystem_sanity_check/check.sh
vendored
@ -196,6 +196,7 @@ checks_tests_application_not_defined_in_makefile() {
|
|||||||
patterns+=(-e '^[[:space:]]*APPLICATION[[:space:]:+]=')
|
patterns+=(-e '^[[:space:]]*APPLICATION[[:space:]:+]=')
|
||||||
|
|
||||||
pathspec+=('tests/**/Makefile')
|
pathspec+=('tests/**/Makefile')
|
||||||
|
pathspec+=(':!tests/external_board_native/Makefile')
|
||||||
|
|
||||||
git -C "${RIOTBASE}" grep "${patterns[@]}" -- "${pathspec[@]}" \
|
git -C "${RIOTBASE}" grep "${patterns[@]}" -- "${pathspec[@]}" \
|
||||||
| error_with_message "Don't define APPLICATION in test Makefile"
|
| error_with_message "Don't define APPLICATION in test Makefile"
|
||||||
|
|||||||
4
dist/tools/openocd/openocd.sh
vendored
4
dist/tools/openocd/openocd.sh
vendored
@ -13,7 +13,7 @@
|
|||||||
# Global environment variables used:
|
# Global environment variables used:
|
||||||
# OPENOCD: OpenOCD command name, default: "openocd"
|
# OPENOCD: OpenOCD command name, default: "openocd"
|
||||||
# OPENOCD_CONFIG: OpenOCD configuration file name,
|
# OPENOCD_CONFIG: OpenOCD configuration file name,
|
||||||
# default: "${RIOTBOARD}/${BOARD}/dist/openocd.cfg"
|
# default: "${BOARDSDIR}/${BOARD}/dist/openocd.cfg"
|
||||||
#
|
#
|
||||||
# The script supports the following actions:
|
# The script supports the following actions:
|
||||||
#
|
#
|
||||||
@ -66,7 +66,7 @@
|
|||||||
# Default TCL port, set to 0 to disable
|
# Default TCL port, set to 0 to disable
|
||||||
: ${TCL_PORT:=6333}
|
: ${TCL_PORT:=6333}
|
||||||
# Default path to OpenOCD configuration file
|
# Default path to OpenOCD configuration file
|
||||||
: ${OPENOCD_CONFIG:=${RIOTBOARD}/${BOARD}/dist/openocd.cfg}
|
: ${OPENOCD_CONFIG:=${BOARDSDIR}/${BOARD}/dist/openocd.cfg}
|
||||||
# Default OpenOCD command
|
# Default OpenOCD command
|
||||||
: ${OPENOCD:=openocd}
|
: ${OPENOCD:=openocd}
|
||||||
# Extra board initialization commands to pass to OpenOCD
|
# Extra board initialization commands to pass to OpenOCD
|
||||||
|
|||||||
4
dist/tools/renode/run-renode.sh
vendored
4
dist/tools/renode/run-renode.sh
vendored
@ -13,14 +13,14 @@
|
|||||||
# Global environment variables used:
|
# Global environment variables used:
|
||||||
# RENODE: Renode command name, default: "renode"
|
# RENODE: Renode command name, default: "renode"
|
||||||
# RENODE_CONFIG: Renode configuration file name,
|
# RENODE_CONFIG: Renode configuration file name,
|
||||||
# default: "${RIOTBOARD}/${BOARD}/dist/board.resc"
|
# default: "${BOARDSDIR}/${BOARD}/dist/board.resc"
|
||||||
# RENODE_BIN_CONFIG: Renode intermediate configuration file name,
|
# RENODE_BIN_CONFIG: Renode intermediate configuration file name,
|
||||||
# default: "${BINDIR}/board.resc"
|
# default: "${BINDIR}/board.resc"
|
||||||
#
|
#
|
||||||
# @author Bas Stottelaar <basstottelaar@gmail.com>
|
# @author Bas Stottelaar <basstottelaar@gmail.com>
|
||||||
|
|
||||||
# Default path to Renode configuration file
|
# Default path to Renode configuration file
|
||||||
: ${RENODE_CONFIG:=${RIOTBOARD}/${BOARD}/dist/board.resc}
|
: ${RENODE_CONFIG:=${BOARDSDIR}/${BOARD}/dist/board.resc}
|
||||||
# Default path to Renode intermediate configuration file
|
# Default path to Renode intermediate configuration file
|
||||||
: ${RENODE_BIN_CONFIG:=${BINDIR}/board.resc}
|
: ${RENODE_BIN_CONFIG:=${BINDIR}/board.resc}
|
||||||
# Default Renode command
|
# Default Renode command
|
||||||
|
|||||||
@ -10,7 +10,7 @@ RIOTBASE ?= $(CURDIR)/../..
|
|||||||
# Uncomment these lines if you want to use platform support from external
|
# Uncomment these lines if you want to use platform support from external
|
||||||
# repositories:
|
# repositories:
|
||||||
#RIOTCPU ?= $(CURDIR)/../../RIOT/thirdparty_cpu
|
#RIOTCPU ?= $(CURDIR)/../../RIOT/thirdparty_cpu
|
||||||
#RIOTBOARD ?= $(CURDIR)/../../RIOT/thirdparty_boards
|
#BOARDSDIR ?= $(CURDIR)/../../RIOT/thirdparty_boards
|
||||||
|
|
||||||
# Uncomment this to enable scheduler statistics for ps:
|
# Uncomment this to enable scheduler statistics for ps:
|
||||||
#USEMODULE += schedstatistics
|
#USEMODULE += schedstatistics
|
||||||
|
|||||||
@ -10,7 +10,7 @@ RIOTBASE ?= $(CURDIR)/../..
|
|||||||
# Uncomment these lines if you want to use platform support from external
|
# Uncomment these lines if you want to use platform support from external
|
||||||
# repositories:
|
# repositories:
|
||||||
#RIOTCPU ?= $(CURDIR)/../../../thirdparty_cpu
|
#RIOTCPU ?= $(CURDIR)/../../../thirdparty_cpu
|
||||||
#RIOTBOARD ?= $(CURDIR)/../../../thirdparty_boards
|
#BOARDSDIR ?= $(CURDIR)/../../../thirdparty_boards
|
||||||
|
|
||||||
# Uncomment this to enable scheduler statistics for ps:
|
# Uncomment this to enable scheduler statistics for ps:
|
||||||
#CFLAGS += -DSCHEDSTATISTICS
|
#CFLAGS += -DSCHEDSTATISTICS
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
MODULE = $(APPLICATION_MODULE)
|
MODULE = $(APPLICATION_MODULE)
|
||||||
|
|
||||||
DIRS += $(RIOTCPU)/$(CPU) $(RIOTBOARD)/$(BOARD)
|
DIRS += $(RIOTCPU)/$(CPU) $(BOARDSDIR)/$(BOARD)
|
||||||
DIRS += $(RIOTBASE)/core $(RIOTBASE)/drivers $(RIOTBASE)/sys
|
DIRS += $(RIOTBASE)/core $(RIOTBASE)/drivers $(RIOTBASE)/sys
|
||||||
|
|
||||||
# For regular modules, adding files to BLOBS to their Makefile is sufficient to
|
# For regular modules, adding files to BLOBS to their Makefile is sufficient to
|
||||||
|
|||||||
@ -1,10 +1,10 @@
|
|||||||
# Default when RIOTBASE is not set and is executed from the RIOT directory
|
# Default when RIOTBASE is not set and is executed from the RIOT directory
|
||||||
RIOTBOARD ?= $(or $(RIOTBASE),$(CURDIR))/boards
|
BOARDSDIR ?= $(or $(RIOTBASE),$(CURDIR))/boards
|
||||||
|
|
||||||
# List all boards.
|
# List all boards.
|
||||||
# By default, all directories in RIOTBOARD except 'common'
|
# By default, all directories in BOARDSDIR except 'common'
|
||||||
# use 'wildcard */.' to only list directories
|
# use 'wildcard */.' to only list directories
|
||||||
ALLBOARDS ?= $(sort $(filter-out common,$(patsubst $(RIOTBOARD)/%/.,%,$(wildcard $(RIOTBOARD)/*/.))))
|
ALLBOARDS ?= $(sort $(filter-out common,$(patsubst $(BOARDSDIR)/%/.,%,$(wildcard $(BOARDSDIR)/*/.))))
|
||||||
|
|
||||||
# Set the default value from `BOARDS`
|
# Set the default value from `BOARDS`
|
||||||
BOARDS ?= $(ALLBOARDS)
|
BOARDS ?= $(ALLBOARDS)
|
||||||
|
|||||||
@ -251,6 +251,12 @@ DOCKER_VOLUMES_AND_ENV += $(if $(wildcard $(GIT_CACHE_DIR)),-e 'GIT_CACHE_DIR=$(
|
|||||||
DOCKER_VOLUMES_AND_ENV += $(call docker_volumes_mapping,$(EXTERNAL_MODULE_DIRS),$(DOCKER_BUILD_ROOT)/external,)
|
DOCKER_VOLUMES_AND_ENV += $(call docker_volumes_mapping,$(EXTERNAL_MODULE_DIRS),$(DOCKER_BUILD_ROOT)/external,)
|
||||||
DOCKER_OVERRIDE_CMDLINE += $(call docker_cmdline_mapping,EXTERNAL_MODULE_DIRS,$(DOCKER_BUILD_ROOT)/external,)
|
DOCKER_OVERRIDE_CMDLINE += $(call docker_cmdline_mapping,EXTERNAL_MODULE_DIRS,$(DOCKER_BUILD_ROOT)/external,)
|
||||||
|
|
||||||
|
# Remap 'BOARDSDIR' if it is external
|
||||||
|
DOCKER_VOLUMES_AND_ENV += $(call docker_volumes_mapping,$(BOARDSDIR),,boards)
|
||||||
|
# Value is overridden from command line if it is not the default value
|
||||||
|
# This allows handling even if the value is set in the 'Makefile'.
|
||||||
|
DOCKER_OVERRIDE_CMDLINE += $(if $(findstring $(RIOTBOARD),$(BOARDSDIR)),,$(call docker_cmdline_mapping,BOARDSDIR,,boards))
|
||||||
|
|
||||||
# External module directories sanity check:
|
# External module directories sanity check:
|
||||||
#
|
#
|
||||||
# Detect if there are remapped directories with the same name as it is not handled.
|
# Detect if there are remapped directories with the same name as it is not handled.
|
||||||
|
|||||||
@ -35,7 +35,7 @@ info-build:
|
|||||||
@echo 'MCU: $(MCU)'
|
@echo 'MCU: $(MCU)'
|
||||||
@echo ''
|
@echo ''
|
||||||
@echo 'RIOTBASE: $(RIOTBASE)'
|
@echo 'RIOTBASE: $(RIOTBASE)'
|
||||||
@echo 'RIOTBOARD: $(RIOTBOARD)'
|
@echo 'BOARDSDIR: $(BOARDSDIR)'
|
||||||
@echo 'RIOTCPU: $(RIOTCPU)'
|
@echo 'RIOTCPU: $(RIOTCPU)'
|
||||||
@echo 'RIOTPKG: $(RIOTPKG)'
|
@echo 'RIOTPKG: $(RIOTPKG)'
|
||||||
@echo ''
|
@echo ''
|
||||||
|
|||||||
@ -7,6 +7,7 @@ SCANBUILD_ENV_VARS := \
|
|||||||
BINDIR \
|
BINDIR \
|
||||||
BINDIRBASE \
|
BINDIRBASE \
|
||||||
BOARD \
|
BOARD \
|
||||||
|
BOARDSDIR \
|
||||||
BUILD_DIR \
|
BUILD_DIR \
|
||||||
BUILDRELPATH \
|
BUILDRELPATH \
|
||||||
CC \
|
CC \
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
FLASHER = avrdude
|
FLASHER = avrdude
|
||||||
DIST_PATH = $(RIOTBOARD)/$(BOARD)/dist
|
DIST_PATH = $(BOARDSDIR)/$(BOARD)/dist
|
||||||
DEBUGSERVER_PORT = 4242
|
DEBUGSERVER_PORT = 4242
|
||||||
DEBUGSERVER = $(DIST_PATH)/debug_srv.sh
|
DEBUGSERVER = $(DIST_PATH)/debug_srv.sh
|
||||||
DEBUGSERVER_INTERFACE ?=
|
DEBUGSERVER_INTERFACE ?=
|
||||||
|
|||||||
@ -18,7 +18,7 @@ export OPENOCD_ADAPTER_INIT
|
|||||||
ifeq (,$(OPENOCD_CONFIG))
|
ifeq (,$(OPENOCD_CONFIG))
|
||||||
# if no openocd default configuration is provided by the board,
|
# if no openocd default configuration is provided by the board,
|
||||||
# use the STM32 common one
|
# use the STM32 common one
|
||||||
ifeq (0,$(words $(wildcard $(RIOTBOARD)/$(BOARD)/dist/openocd.cfg)))
|
ifeq (0,$(words $(wildcard $(BOARDSDIR)/$(BOARD)/dist/openocd.cfg)))
|
||||||
export OPENOCD_CONFIG := $(RIOTBASE)/boards/common/stm32/dist/$(CPU).cfg
|
export OPENOCD_CONFIG := $(RIOTBASE)/boards/common/stm32/dist/$(CPU).cfg
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|||||||
@ -1,9 +1,9 @@
|
|||||||
# http://www.ti.com/tool/uniflash
|
# http://www.ti.com/tool/uniflash
|
||||||
FLASHFILE ?= $(ELFFILE)
|
FLASHFILE ?= $(ELFFILE)
|
||||||
|
|
||||||
UNIFLASH_CONFIG_CCXML ?= $(RIOTBOARD)/$(BOARD)/dist/$(CPU_MODEL)_$(XDEBUGGER).ccxml
|
UNIFLASH_CONFIG_CCXML ?= $(BOARDSDIR)/$(BOARD)/dist/$(CPU_MODEL)_$(XDEBUGGER).ccxml
|
||||||
UNIFLASH_CONFIG_DAT ?= $(RIOTBOARD)/$(BOARD)/dist/$(CPU_MODEL)_$(XDEBUGGER).dat
|
UNIFLASH_CONFIG_DAT ?= $(BOARDSDIR)/$(BOARD)/dist/$(CPU_MODEL)_$(XDEBUGGER).dat
|
||||||
UNIFLASH_CONFIG_GDB ?= $(RIOTBOARD)/$(BOARD)/dist/$(CPU_MODEL)_gdb.conf
|
UNIFLASH_CONFIG_GDB ?= $(BOARDSDIR)/$(BOARD)/dist/$(CPU_MODEL)_gdb.conf
|
||||||
|
|
||||||
export UNIFLASH_PATH ?= "UNIFLASH_PATH unconfigured"
|
export UNIFLASH_PATH ?= "UNIFLASH_PATH unconfigured"
|
||||||
# check which uniflash version is available, either 4.x or 3.x
|
# check which uniflash version is available, either 4.x or 3.x
|
||||||
|
|||||||
@ -25,7 +25,8 @@ 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 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 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 RIOTBOARD # This folder is the base of the riot boards.
|
||||||
|
export BOARDSDIR # For third party BOARDs this folder is the base of the BOARDs.
|
||||||
export RIOTPKG # For overriding RIOT's pkg directory
|
export RIOTPKG # For overriding RIOT's pkg directory
|
||||||
export RIOTTOOLS # Location of host machine tools
|
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
|
export RIOTPROJECT # Top level git root of the project being built, or PWD if not a git repository
|
||||||
|
|||||||
15
tests/external_board_native/Makefile
Normal file
15
tests/external_board_native/Makefile
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
APPLICATION = external_board
|
||||||
|
RIOTBASE ?= $(CURDIR)/../../
|
||||||
|
|
||||||
|
# Only support this board
|
||||||
|
# No need for a `WHITELIST` as there is only one board in `external_boards`.
|
||||||
|
#
|
||||||
|
# HACK I named the external board as 'native' to be in murdock test path for
|
||||||
|
# 'native'
|
||||||
|
# In practice it should be something else
|
||||||
|
BOARD ?= native
|
||||||
|
|
||||||
|
# Set without '?=' to also verify the docker integration when set with =
|
||||||
|
BOARDSDIR = $(CURDIR)/external_boards
|
||||||
|
|
||||||
|
include $(RIOTBASE)/Makefile.include
|
||||||
14
tests/external_board_native/README.md
Normal file
14
tests/external_board_native/README.md
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
Example with an external board
|
||||||
|
==============================
|
||||||
|
|
||||||
|
This tests an external board implementation.
|
||||||
|
The goal is to show using an external board that still needs to use the
|
||||||
|
'RIOT/boards' directory.
|
||||||
|
|
||||||
|
To allow automated testing by `murdock` this board is named 'native'.
|
||||||
|
|
||||||
|
As it wants to extend native, which is not a common board, some hacks must be
|
||||||
|
done as the 'board' module is implemented directly by the 'RIOT/boards/native'.
|
||||||
|
|
||||||
|
If you are running an 'ubuntu-bionic' you could even compile the example in
|
||||||
|
docker and run the test.
|
||||||
@ -0,0 +1,6 @@
|
|||||||
|
# This must be a different name than 'board' as it is implemented by 'native'
|
||||||
|
MODULE = board_external_native
|
||||||
|
|
||||||
|
DIRS += $(RIOTBOARD)/native
|
||||||
|
|
||||||
|
include $(RIOTBASE)/Makefile.base
|
||||||
@ -0,0 +1,4 @@
|
|||||||
|
# This must be a different name than 'board' as it is implemented by 'native'
|
||||||
|
USEMODULE += board_external_native
|
||||||
|
|
||||||
|
include $(RIOTBOARD)/native/Makefile.dep
|
||||||
@ -0,0 +1 @@
|
|||||||
|
include $(RIOTBOARD)/native/Makefile.features
|
||||||
@ -0,0 +1,7 @@
|
|||||||
|
CFLAGS += -DTHIS_BOARD_IS='"external_native"'
|
||||||
|
|
||||||
|
# We must duplicate the include done by $(RIOTBASE)/Makefile.include
|
||||||
|
# to also include the main board header
|
||||||
|
INCLUDES += $(addprefix -I,$(wildcard $(RIOTBOARD)/native/include))
|
||||||
|
|
||||||
|
include $(RIOTBOARD)/native/Makefile.include
|
||||||
@ -0,0 +1,3 @@
|
|||||||
|
#include "external_native.h"
|
||||||
|
|
||||||
|
char* external_native_board_description = "An external extended native";
|
||||||
@ -0,0 +1,36 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2019 Freie Universität Berlin
|
||||||
|
*
|
||||||
|
* This file is subject to the terms and conditions of the GNU Lesser
|
||||||
|
* General Public License v2.1. See the file LICENSE in the top level
|
||||||
|
* directory for more details.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @ingroup boards_external_native
|
||||||
|
* @{
|
||||||
|
*
|
||||||
|
* @file
|
||||||
|
* @brief A header for an external native
|
||||||
|
*
|
||||||
|
* @author Gaëtan Harter <gaetan.harter@fu-berlin.de>
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef EXTERNAL_NATIVE_H
|
||||||
|
#define EXTERNAL_NATIVE_H
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief A variable defined in the external header
|
||||||
|
*/
|
||||||
|
extern char* external_native_board_description;
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif /* EXTERNAL_NATIVE_H */
|
||||||
|
/** @} */
|
||||||
34
tests/external_board_native/main.c
Normal file
34
tests/external_board_native/main.c
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2019 Freie Universität Berlin
|
||||||
|
*
|
||||||
|
* This file is subject to the terms and conditions of the GNU Lesser
|
||||||
|
* General Public License v2.1. See the file LICENSE in the top level
|
||||||
|
* directory for more details.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @ingroup tests
|
||||||
|
* @{
|
||||||
|
*
|
||||||
|
* @file
|
||||||
|
* @brief External Native application
|
||||||
|
*
|
||||||
|
* @author Gaëtan Harter <gaetan.harter@fu-berlin.de>
|
||||||
|
*
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <stdio.h>
|
||||||
|
#include "external_native.h"
|
||||||
|
|
||||||
|
int main(void)
|
||||||
|
{
|
||||||
|
puts("Hello World!");
|
||||||
|
|
||||||
|
printf("You are running RIOT on a(n) %s board.\n", RIOT_BOARD);
|
||||||
|
printf("THIS_BOARD_IS %s\n", THIS_BOARD_IS);
|
||||||
|
printf("This board is '%s'\n", external_native_board_description);
|
||||||
|
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
22
tests/external_board_native/tests/01-run.py
Executable file
22
tests/external_board_native/tests/01-run.py
Executable file
@ -0,0 +1,22 @@
|
|||||||
|
#!/usr/bin/env python3
|
||||||
|
|
||||||
|
# Copyright (C) 2019 Freie Universität Berlin
|
||||||
|
#
|
||||||
|
# This file is subject to the terms and conditions of the GNU Lesser
|
||||||
|
# General Public License v2.1. See the file LICENSE in the top level
|
||||||
|
# directory for more details.
|
||||||
|
|
||||||
|
import sys
|
||||||
|
from testrunner import run
|
||||||
|
|
||||||
|
|
||||||
|
def testfunc(child):
|
||||||
|
child.expect_exact("Hello World!")
|
||||||
|
child.expect_exact("You are running RIOT on a(n) native board.")
|
||||||
|
child.expect_exact("THIS_BOARD_IS external_native")
|
||||||
|
child.expect_exact("This board is 'An external extended native")
|
||||||
|
print("Test successful!!")
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
sys.exit(run(testfunc))
|
||||||
Loading…
x
Reference in New Issue
Block a user