Change a variable to a target so that it works on windows command prompt

echo command of windows command prompt can't handle line breaks in a variable.
This commit is contained in:
kkitayam 2023-07-18 22:55:55 +09:00
parent 973c7d47eb
commit efa8b4a9b8
1 changed files with 8 additions and 11 deletions

View File

@ -99,19 +99,16 @@ endif
JLINK_IF ?= swd
# Jlink script
define jlink_script
halt
loadfile $^
r
go
exit
endef
export jlink_script
$(BUILD)/$(BOARD).jlink: $(BUILD)/$(PROJECT).hex
@echo halt > $@
@echo loadfile $^ >> $@
@echo r >> $@
@echo go >> $@
@echo exit >> $@
# Flash using jlink
flash-jlink: $(BUILD)/$(PROJECT).hex
@echo "$$jlink_script" > $(BUILD)/$(BOARD).jlink
$(JLINKEXE) -device $(JLINK_DEVICE) -if $(JLINK_IF) -JTAGConf -1,-1 -speed auto -CommandFile $(BUILD)/$(BOARD).jlink
flash-jlink: $(BUILD)/$(BOARD).jlink
$(JLINKEXE) -device $(JLINK_DEVICE) -if $(JLINK_IF) -JTAGConf -1,-1 -speed auto -CommandFile $<
# Flash STM32 MCU using stlink with STM32 Cube Programmer CLI
flash-stlink: $(BUILD)/$(PROJECT).elf