1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-12-25 06:23:53 +01:00
Marian Buschsieweke ba7815163c
Makefile*: Allow multiple external board dirs
- 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
2020-04-29 18:32:39 +02:00

24 lines
886 B
Makefile

# ST-Link debug adapter
# Use st-link v2-1 by default
STLINK_VERSION ?= 2-1
# Use STLINK_VERSION to select which stlink version is used
OPENOCD_ADAPTER_INIT ?= \
-c 'source [find interface/stlink-v$(STLINK_VERSION).cfg]' \
-c 'transport select hla_swd'
# Add serial matching command, only if DEBUG_ADAPTER_ID was specified
ifneq (,$(DEBUG_ADAPTER_ID))
OPENOCD_ADAPTER_INIT += -c 'hla_serial $(DEBUG_ADAPTER_ID)'
endif
# if no openocd specific configuration file, check for default locations:
# 1. Using the default dist/openocd.cfg (automatically set by openocd.sh)
# 2. Using the common cpu specific config file
ifeq (,$(OPENOCD_CONFIG))
# if no openocd default configuration is provided by the board,
# use the STM32 common one
ifeq (0,$(words $(wildcard $(BOARDDIR)/dist/openocd.cfg)))
OPENOCD_CONFIG = $(RIOTBASE)/boards/common/stm32/dist/$(CPU).cfg
endif
endif