diff --git a/makefiles/tools/openocd.inc.mk b/makefiles/tools/openocd.inc.mk index 18b62c12fc..62aae0817f 100644 --- a/makefiles/tools/openocd.inc.mk +++ b/makefiles/tools/openocd.inc.mk @@ -30,17 +30,19 @@ ifneq (,$(OPENOCD_CMD_RESET_RUN)) $(call target-export-variables,reset,OPENOCD_CMD_RESET_RUN) endif +OPENOCD_FLASH_TARGETS = flash flash-only + ifneq (,$(OPENOCD_PRE_VERIFY_CMDS)) # Export OPENOCD_PRE_VERIFY_CMDS only to the flash/flash-only target - $(call target-export-variables,flash%,OPENOCD_PRE_VERIFY_CMDS) + $(call target-export-variables,$(OPENOCD_FLASH_TARGETS),OPENOCD_PRE_VERIFY_CMDS) endif ifneq (,$(OPENOCD_PRE_FLASH_CMDS)) # Export OPENOCD_PRE_FLASH_CMDS only to the flash/flash-only targets - $(call target-export-variables,flash%,OPENOCD_PRE_FLASH_CMDS) + $(call target-export-variables,$(OPENOCD_FLASH_TARGETS),OPENOCD_PRE_FLASH_CMDS) endif ifneq (,$(PRE_FLASH_CHECK_SCRIPT)) # Export PRE_FLASH_CHECK_SCRIPT only to the flash/flash-only targets - $(call target-export-variables,flash%,PRE_FLASH_CHECK_SCRIPT) + $(call target-export-variables,$(OPENOCD_FLASH_TARGETS),PRE_FLASH_CHECK_SCRIPT) endif