From cb991cd47d5f5f792d69d4eb3f850c080bac5585 Mon Sep 17 00:00:00 2001
From: Alexandre Abadie <alexandre.abadie@inria.fr>
Date: Tue, 15 May 2018 11:23:44 +0200
Subject: [PATCH] boards: use RIOTTOOLS variable

---
 boards/cc2538dk/Makefile.include        | 4 ++--
 boards/common/remote/Makefile.include   | 2 +-
 boards/mulle/Makefile.include           | 4 ++--
 boards/openmote-cc2538/Makefile.include | 2 +-
 boards/pba-d-01-kw2x/Makefile.include   | 2 +-
 boards/ruuvitag/Makefile.include        | 2 +-
 boards/teensy31/Makefile.include        | 4 ++--
 boards/telosb/Makefile.include          | 2 +-
 boards/thingy52/Makefile.include        | 2 +-
 boards/z1/Makefile.include              | 2 +-
 10 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/boards/cc2538dk/Makefile.include b/boards/cc2538dk/Makefile.include
index 0d9f575185..5f2115f230 100644
--- a/boards/cc2538dk/Makefile.include
+++ b/boards/cc2538dk/Makefile.include
@@ -7,7 +7,7 @@ export PROGRAMMER_SERIAL ?= 06EB
 
 # setup serial terminal
 # the debug UART is always the second tty with the matching serial number:
-PORT_LINUX ?= $(word 2,$(shell $(RIOTBASE)/dist/tools/usb-serial/find-tty.sh '^$(PROGRAMMER_SERIAL)'))
+PORT_LINUX ?= $(word 2,$(shell $(RIOTTOOLS)/usb-serial/find-tty.sh '^$(PROGRAMMER_SERIAL)'))
 PORT_DARWIN ?= $(firstword $(sort $(wildcard /dev/tty.usbserial*)))
 include $(RIOTMAKE)/tools/serial.inc.mk
 
@@ -23,7 +23,7 @@ export RESET = $(RIOTBOARD)/$(BOARD)/dist/reset.sh
 export PROGRAMMER ?= cc2538-bsl
 
 ifeq ($(PROGRAMMER),cc2538-bsl)
-  export FLASHER = $(RIOTBASE)/dist/tools/cc2538-bsl/cc2538-bsl.py
+  export FLASHER = $(RIOTTOOLS)/cc2538-bsl/cc2538-bsl.py
   export FFLAGS  = -p "$(PORT)" -e -w -v $(HEXFILE)
 else ifeq ($(PROGRAMMER),jlink)
   export FLASHER = $(RIOTBOARD)/$(BOARD)/dist/flash.sh
diff --git a/boards/common/remote/Makefile.include b/boards/common/remote/Makefile.include
index fd79d46aba..1d0a85d11b 100644
--- a/boards/common/remote/Makefile.include
+++ b/boards/common/remote/Makefile.include
@@ -12,7 +12,7 @@ ifeq ($(PROGRAMMER),cc2538-bsl)
   else ifeq ($(OS),Darwin)
     PORT_BSL ?= $(PORT_DARWIN)
   endif
-  export FLASHER = $(RIOTBASE)/dist/tools/cc2538-bsl/cc2538-bsl.py
+  export FLASHER = $(RIOTTOOLS)/cc2538-bsl/cc2538-bsl.py
   export FFLAGS  = -p "$(PORT_BSL)" -e -w -v -b 115200 $(HEXFILE)
 else ifeq ($(PROGRAMMER),jlink)
   export FLASHER = $(RIOTBOARD)/$(BOARD)/dist/flash.sh
diff --git a/boards/mulle/Makefile.include b/boards/mulle/Makefile.include
index 9a7c74a7be..6d8b0ea77b 100644
--- a/boards/mulle/Makefile.include
+++ b/boards/mulle/Makefile.include
@@ -31,10 +31,10 @@ ifeq ($(PORT),)
   # try to find tty name by serial number, only works on Linux currently.
   ifeq ($(OS),Linux)
     ifneq ($(DEBUG_ADAPTER_ID),)
-      PORT := $(firstword $(shell $(RIOTBASE)/dist/tools/usb-serial/find-tty.sh '^$(DEBUG_ADAPTER_ID)$$'))
+      PORT := $(firstword $(shell $(RIOTTOOLS)/usb-serial/find-tty.sh '^$(DEBUG_ADAPTER_ID)$$'))
     else
       # find-tty.sh will return the first USB tty if no serial is given.
-      PORT := $(firstword $(shell $(RIOTBASE)/dist/tools/usb-serial/find-tty.sh))
+      PORT := $(firstword $(shell $(RIOTTOOLS)/usb-serial/find-tty.sh))
   endif
   else ifeq ($(OS),Darwin)
     ifneq ($(DEBUG_ADAPTER_ID),)
diff --git a/boards/openmote-cc2538/Makefile.include b/boards/openmote-cc2538/Makefile.include
index 160c38624c..bb8b52bf3e 100644
--- a/boards/openmote-cc2538/Makefile.include
+++ b/boards/openmote-cc2538/Makefile.include
@@ -18,7 +18,7 @@ ifeq ($(PROGRAMMER),jlink)
   include $(RIOTMAKE)/tools/jlink.inc.mk
 else
   HEXFILE = $(BINFILE)
-  export FLASHER = $(RIOTBASE)/dist/tools/cc2538-bsl/cc2538-bsl.py
+  export FLASHER = $(RIOTTOOLS)/cc2538-bsl/cc2538-bsl.py
   export FFLAGS  = -p "$(PORT)" -e -w -v -b 460800 $(HEXFILE)
 endif
 
diff --git a/boards/pba-d-01-kw2x/Makefile.include b/boards/pba-d-01-kw2x/Makefile.include
index b1cf0565b3..eb53b2ba84 100644
--- a/boards/pba-d-01-kw2x/Makefile.include
+++ b/boards/pba-d-01-kw2x/Makefile.include
@@ -32,7 +32,7 @@ export DEBUG_ADAPTER ?= dap
 #   Usage: SERIAL="0200..." BOARD="pba-d-01-kw2x" make flash
 ifneq (,$(SERIAL))
   export OPENOCD_EXTRA_INIT += "-c cmsis_dap_serial $(SERIAL)"
-  SERIAL_TTY = $(firstword $(shell $(RIOTBASE)/dist/tools/usb-serial/find-tty.sh $(SERIAL)))
+  SERIAL_TTY = $(firstword $(shell $(RIOTTOOLS)/usb-serial/find-tty.sh $(SERIAL)))
   ifeq (,$(SERIAL_TTY))
     $(error Did not find a device with serial $(SERIAL))
   endif
diff --git a/boards/ruuvitag/Makefile.include b/boards/ruuvitag/Makefile.include
index 2f4830fefa..e2df4570f6 100644
--- a/boards/ruuvitag/Makefile.include
+++ b/boards/ruuvitag/Makefile.include
@@ -3,7 +3,7 @@ CPU_MODEL = nrf52832xxaa
 
 # for this board, we are using Segger's RTT as default terminal interface
 USEMODULE += rtt_stdio
-TERMPROG = $(RIOTBASE)/dist/tools/jlink/jlink.sh
+TERMPROG = $(RIOTTOOLS)/jlink/jlink.sh
 TERMFLAGS = term_rtt
 
 # use shared Makefile.include
diff --git a/boards/teensy31/Makefile.include b/boards/teensy31/Makefile.include
index f0a58921e0..b057311460 100644
--- a/boards/teensy31/Makefile.include
+++ b/boards/teensy31/Makefile.include
@@ -3,7 +3,7 @@ CPU = kinetis
 CPU_MODEL = mk20dx256vlh7
 
 # custom flasher to use with the bootloader
-TEENSY_LOADER = $(RIOTBASE)/dist/tools/teensy-loader-cli/teensy_loader
+TEENSY_LOADER = $(RIOTTOOLS)/teensy-loader-cli/teensy_loader
 FLASHER = $(TEENSY_LOADER)
 
 FFLAGS ?= --mcu=mk20dx256 $(HEXFILE)
@@ -18,7 +18,7 @@ PORT_DARWIN ?= $(firstword $(sort $(wildcard /dev/tty.usbserial-*)))
 
 $(TEENSY_LOADER):
 	@echo "[INFO] teensy_loader binary not found - building it from source now"
-	CC= CFLAGS= make -C $(RIOTBASE)/dist/tools/teensy-loader-cli
+	CC= CFLAGS= make -C $(RIOTTOOLS)/teensy-loader-cli
 	@echo "[INFO] teensy_loader binary successfully build!"
 
 # setup serial terminal
diff --git a/boards/telosb/Makefile.include b/boards/telosb/Makefile.include
index 62632f85e2..1133e7fd73 100644
--- a/boards/telosb/Makefile.include
+++ b/boards/telosb/Makefile.include
@@ -10,5 +10,5 @@ export BAUD ?= 9600
 include $(RIOTMAKE)/tools/serial.inc.mk
 
 # flash tool configuration
-export FLASHER = $(RIOTBASE)/dist/tools/goodfet/goodfet.bsl
+export FLASHER = $(RIOTTOOLS)/goodfet/goodfet.bsl
 export FFLAGS = --telosb -c $(PORT) -r -e -I -p $(HEXFILE)
diff --git a/boards/thingy52/Makefile.include b/boards/thingy52/Makefile.include
index 44f5685687..96fda10616 100644
--- a/boards/thingy52/Makefile.include
+++ b/boards/thingy52/Makefile.include
@@ -3,7 +3,7 @@ CPU_MODEL = nrf52832xxaa
 
 # for this board, we are using Segger's RTT as default terminal interface
 USEMODULE += rtt_stdio
-TERMPROG = $(RIOTBASE)/dist/tools/jlink/jlink.sh
+TERMPROG = $(RIOTTOOLS)/jlink/jlink.sh
 TERMFLAGS = term_rtt
 
 # use shared Makefile.include
diff --git a/boards/z1/Makefile.include b/boards/z1/Makefile.include
index 2e5e35b212..2f64e0af73 100644
--- a/boards/z1/Makefile.include
+++ b/boards/z1/Makefile.include
@@ -9,5 +9,5 @@ PORT_DARWIN ?= $(firstword $(sort $(wildcard /dev/tty.SLAB_USBtoUART*)))
 include $(RIOTMAKE)/tools/serial.inc.mk
 
 # setup flash tool
-export FLASHER = $(RIOTBASE)/dist/tools/goodfet/goodfet.bsl
+export FLASHER = $(RIOTTOOLS)/goodfet/goodfet.bsl
 export FFLAGS = --z1 -I -c $(PORT) -r -e -p $(HEXFILE)
-- 
GitLab