From b88d1887c8317b8cccc20671ec156298fb573e4e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ga=C3=ABtan=20Harter?= Date: Fri, 17 May 2019 13:52:34 +0200 Subject: [PATCH] boards/tools: remove exporting RESET/RESET_FLAGS RESET and RESET_FLAGS are evaluated by the main Makefile.include or by file included by it. Their value does not need to be exported. This will also prevent evaluating 'PORT' for RESET_FLAGS when not needed. Testing ------- `git diff --word-diff` only reports `export` being removed. `git show --stat` reports `24 insertions(+), 24 deletions(-)` Which is the same amount as lines that where matching `export[[:blank::]]\+VARIABLE`. --- boards/cc2538dk/Makefile.include | 4 ++-- boards/common/esp32/Makefile.include | 2 +- boards/common/esp8266/Makefile.include | 2 +- boards/common/remote/Makefile.include | 6 +++--- boards/common/stm32f103c8/Makefile.include | 2 +- boards/nz32-sc151/Makefile.include | 2 +- boards/openmote-b/Makefile.include | 4 ++-- boards/spark-core/Makefile.include | 2 +- makefiles/tools/jlink.inc.mk | 4 ++-- makefiles/tools/openocd.inc.mk | 4 ++-- makefiles/tools/pyocd.inc.mk | 4 ++-- makefiles/tools/uniflash.inc.mk | 8 ++++---- makefiles/vars.inc.mk | 4 ++-- 13 files changed, 24 insertions(+), 24 deletions(-) diff --git a/boards/cc2538dk/Makefile.include b/boards/cc2538dk/Makefile.include index f0df568dbd..7006ad5d2b 100644 --- a/boards/cc2538dk/Makefile.include +++ b/boards/cc2538dk/Makefile.include @@ -17,7 +17,7 @@ include $(RIOTMAKE)/tools/renode.inc.mk # debugger config export DEBUGGER = $(RIOTBOARD)/$(BOARD)/dist/debug.sh export DEBUGSERVER = JLinkGDBServer -device CC2538SF53 -export RESET = $(RIOTBOARD)/$(BOARD)/dist/reset.sh +RESET = $(RIOTBOARD)/$(BOARD)/dist/reset.sh # Define the flash-tool and default port: export PROGRAMMER ?= cc2538-bsl @@ -33,6 +33,6 @@ endif OFLAGS = --gap-fill 0xff FLASHFILE ?= $(BINFILE) export DEBUGGER_FLAGS = $(BINDIR) $(ELFFILE) -export RESET_FLAGS = $(BINDIR) +RESET_FLAGS = $(BINDIR) export OBJDUMPFLAGS += --disassemble --source --disassembler-options=force-thumb diff --git a/boards/common/esp32/Makefile.include b/boards/common/esp32/Makefile.include index 2ce4a3dbea..0fb3fb3c25 100644 --- a/boards/common/esp32/Makefile.include +++ b/boards/common/esp32/Makefile.include @@ -8,4 +8,4 @@ PORT_DARWIN ?= $(firstword $(sort $(wildcard /dev/tty.SLAB_USBtoUART*))) include $(RIOTMAKE)/tools/serial.inc.mk # reset tool configuration -export RESET = esptool.py --before default_reset run +RESET = esptool.py --before default_reset run diff --git a/boards/common/esp8266/Makefile.include b/boards/common/esp8266/Makefile.include index 5460a7fd32..4c60974b9a 100644 --- a/boards/common/esp8266/Makefile.include +++ b/boards/common/esp8266/Makefile.include @@ -8,4 +8,4 @@ PORT_DARWIN ?= $(firstword $(sort $(wildcard /dev/tty.SLAB_USBtoUART*))) include $(RIOTMAKE)/tools/serial.inc.mk # reset tool configuration -export RESET = esptool.py --before default_reset run +RESET = esptool.py --before default_reset run diff --git a/boards/common/remote/Makefile.include b/boards/common/remote/Makefile.include index 36f226285d..fc96393fa5 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 RESET = $(RIOTTOOLS)/cc2538-bsl/cc2538-bsl.py -p "$(PORT_BSL)" + RESET = $(RIOTTOOLS)/cc2538-bsl/cc2538-bsl.py -p "$(PORT_BSL)" FLASHER = $(RIOTTOOLS)/cc2538-bsl/cc2538-bsl.py FFLAGS = -p "$(PORT_BSL)" -e -w -v -b 115200 $(FLASHFILE) else ifeq ($(PROGRAMMER),jlink) @@ -20,8 +20,8 @@ else ifeq ($(PROGRAMMER),jlink) FFLAGS = $(BINDIR) $(FLASHFILE) export DEBUGGER = $(RIOTBOARD)/common/remote/dist/debug.sh export DEBUGSERVER = JLinkGDBServer -device CC2538SF53 - export RESET = $(RIOTBOARD)/common/remote/dist/reset.sh - export RESET_FLAGS = $(BINDIR) + RESET = $(RIOTBOARD)/common/remote/dist/reset.sh + RESET_FLAGS = $(BINDIR) endif OFLAGS = --gap-fill 0xff diff --git a/boards/common/stm32f103c8/Makefile.include b/boards/common/stm32f103c8/Makefile.include index 682b144dc9..701a761753 100644 --- a/boards/common/stm32f103c8/Makefile.include +++ b/boards/common/stm32f103c8/Makefile.include @@ -25,7 +25,7 @@ ifeq ($(PROGRAMMER),dfu-util) export ROM_OFFSET ?= 0x2000 # Skip the space needed by the embedded bootloader FLASHER = dfu-util export DEBUGGER = # no debugger - export RESET = # dfu-util has no support for resetting the device + RESET = # dfu-util has no support for resetting the device HEXFILE = $(BINFILE) FFLAGS = -d 1eaf:0003 -a 2 -D "$(HEXFILE)" diff --git a/boards/nz32-sc151/Makefile.include b/boards/nz32-sc151/Makefile.include index d2844aa46b..3ca9bbb74c 100644 --- a/boards/nz32-sc151/Makefile.include +++ b/boards/nz32-sc151/Makefile.include @@ -11,7 +11,7 @@ export ID ?= 0483:df11 FLASHER = dfu-util export DEBUGGER = # dfu-util has no debugger -export RESET = # dfu-util has no support for resetting the device +RESET = # dfu-util has no support for resetting the device HEXFILE = $(BINFILE) FFLAGS = -d $(ID) -a 0 -s 0x08000000:leave -D "$(HEXFILE)" diff --git a/boards/openmote-b/Makefile.include b/boards/openmote-b/Makefile.include index 46f0c2bd08..0a01ef0f5f 100644 --- a/boards/openmote-b/Makefile.include +++ b/boards/openmote-b/Makefile.include @@ -23,12 +23,12 @@ else ifeq ($(PROGRAMMER),jlink) FFLAGS = $(BINDIR) $(FLASHFILE) export DEBUGGER = $(RIOTBOARD)/$(BOARD)/dist/debug.sh export DEBUGSERVER = JLinkGDBServer -device CC2538SF53 - export RESET = $(RIOTBOARD)/$(BOARD)/dist/reset.sh + RESET = $(RIOTBOARD)/$(BOARD)/dist/reset.sh endif FLASHFILE ?= $(BINFILE) export DEBUGGER_FLAGS = $(BINDIR) $(ELFFILE) -export RESET_FLAGS = $(BINDIR) +RESET_FLAGS = $(BINDIR) export OBJDUMPFLAGS += --disassemble --source --disassembler-options=force-thumb # setup serial terminal diff --git a/boards/spark-core/Makefile.include b/boards/spark-core/Makefile.include index f7fd5f65c8..eac6a0fd74 100644 --- a/boards/spark-core/Makefile.include +++ b/boards/spark-core/Makefile.include @@ -9,7 +9,7 @@ include $(RIOTMAKE)/tools/serial.inc.mk FLASHER = dfu-util export DEBUGGER = # spark core has no debugger -export RESET = # dfu-util has no support for resetting the device +RESET = # dfu-util has no support for resetting the device HEXFILE = $(BINFILE) FFLAGS = -d 1d50:607f -a 0 -s 0x08005000:leave -D "$(HEXFILE)" diff --git a/makefiles/tools/jlink.inc.mk b/makefiles/tools/jlink.inc.mk index ed65bc4610..7e330e851d 100644 --- a/makefiles/tools/jlink.inc.mk +++ b/makefiles/tools/jlink.inc.mk @@ -1,11 +1,11 @@ FLASHER = $(RIOTTOOLS)/jlink/jlink.sh export DEBUGGER = $(RIOTTOOLS)/jlink/jlink.sh export DEBUGSERVER = $(RIOTTOOLS)/jlink/jlink.sh -export RESET = $(RIOTTOOLS)/jlink/jlink.sh +RESET = $(RIOTTOOLS)/jlink/jlink.sh FLASHFILE ?= $(BINFILE) FFLAGS ?= flash $(FLASHFILE) export DEBUGGER_FLAGS ?= debug $(ELFFILE) export DEBUGSERVER_FLAGS ?= debug-server -export RESET_FLAGS ?= reset +RESET_FLAGS ?= reset diff --git a/makefiles/tools/openocd.inc.mk b/makefiles/tools/openocd.inc.mk index 7d2187961c..25b8b9a2f6 100644 --- a/makefiles/tools/openocd.inc.mk +++ b/makefiles/tools/openocd.inc.mk @@ -1,13 +1,13 @@ FLASHER ?= $(RIOTTOOLS)/openocd/openocd.sh export DEBUGGER = $(RIOTTOOLS)/openocd/openocd.sh export DEBUGSERVER = $(RIOTTOOLS)/openocd/openocd.sh -export RESET ?= $(RIOTTOOLS)/openocd/openocd.sh +RESET ?= $(RIOTTOOLS)/openocd/openocd.sh FLASHFILE ?= $(ELFFILE) FFLAGS ?= flash $(FLASHFILE) export DEBUGGER_FLAGS ?= debug $(ELFFILE) export DEBUGSERVER_FLAGS ?= debug-server -export RESET_FLAGS ?= reset +RESET_FLAGS ?= reset ifneq (,$(DEBUG_ADAPTER)) include $(RIOTMAKE)/tools/openocd-adapters/$(DEBUG_ADAPTER).inc.mk diff --git a/makefiles/tools/pyocd.inc.mk b/makefiles/tools/pyocd.inc.mk index 4b66b5d9d2..8496354bb0 100644 --- a/makefiles/tools/pyocd.inc.mk +++ b/makefiles/tools/pyocd.inc.mk @@ -1,10 +1,10 @@ FLASHER ?= $(RIOTBASE)/dist/tools/pyocd/pyocd.sh export DEBUGGER = $(RIOTBASE)/dist/tools/pyocd/pyocd.sh export DEBUGSERVER = $(RIOTBASE)/dist/tools/pyocd/pyocd.sh -export RESET ?= $(RIOTBASE)/dist/tools/pyocd/pyocd.sh +RESET ?= $(RIOTBASE)/dist/tools/pyocd/pyocd.sh export OFLAGS ?= -O ihex FFLAGS ?= flash $(HEXFILE) export DEBUGGER_FLAGS ?= debug $(ELFFILE) export DEBUGSERVER_FLAGS ?= debug-server -export RESET_FLAGS ?= reset +RESET_FLAGS ?= reset diff --git a/makefiles/tools/uniflash.inc.mk b/makefiles/tools/uniflash.inc.mk index 70ae9617d8..10be610b32 100644 --- a/makefiles/tools/uniflash.inc.mk +++ b/makefiles/tools/uniflash.inc.mk @@ -12,14 +12,14 @@ ifneq ("$(wildcard $(UNIFLASH_PATH)/dslite.sh)","") _XDS110RESET_4_0_4_3 ?= $(UNIFLASH_PATH)/simplelink/gen2/bin/xds110reset _XDS110RESET ?= $(UNIFLASH_PATH)/simplelink/imagecreator/bin/xds110reset XDS110RESET ?= $(firstword $(wildcard $(_XDS110RESET) $(_XDS110RESET_4_0_4_3)) xds110reset) - export RESET = $(XDS110RESET) - export RESET_FLAGS + RESET = $(XDS110RESET) + RESET_FLAGS else FLASHER = $(UNIFLASH_PATH)/uniflash.sh FFLAGS = -ccxml $(RIOTBOARD)/$(BOARD)/dist/$(CPU_MODEL)_$(XDEBUGGER).ccxml -program $(FLASHFILE) # configure uniflash for resetting target - export RESET = $(UNIFLASH_PATH)/uniflash.sh - export RESET_FLAGS = -ccxml $(RIOTBOARD)/$(BOARD)/dist/$(CPU_MODEL)_$(XDEBUGGER).ccxml -reset + RESET = $(UNIFLASH_PATH)/uniflash.sh + RESET_FLAGS = -ccxml $(RIOTBOARD)/$(BOARD)/dist/$(CPU_MODEL)_$(XDEBUGGER).ccxml -reset endif # configure the debug server export DEBUGSERVER = $(UNIFLASH_PATH)/ccs_base/common/uscif/gdb_agent_console diff --git a/makefiles/vars.inc.mk b/makefiles/vars.inc.mk index 9bc64995de..45a057f96b 100644 --- a/makefiles/vars.inc.mk +++ b/makefiles/vars.inc.mk @@ -82,8 +82,8 @@ export DEBUGGER # The command to call on "make debug", usually a sc export DEBUGGER_FLAGS # The parameters to supply to DEBUGGER. export DEBUGSERVER # The command to call on "make debug-server", usually a script starting the GDB server. export DEBUGSERVER_FLAGS # The parameters to supply to DEBUGSERVER. -export RESET # The command to call on "make reset", this command resets/reboots the target. -export RESET_FLAGS # The parameters to supply to RESET. +# RESET # The command to call on "make reset", this command resets/reboots the target. +# RESET_FLAGS # The parameters to supply to RESET. export CCACHE_BASEDIR # ccache basedir, allows multiple riot build # directories to share a ccache directory