rules.mk: flash: send full path for existing openocd

When using netcat to send commands to an already existing openocd
session, you must path full paths to the file to flash.  There's no
guarantee that it is running from the same directory as the present
example
This commit is contained in:
Karl Palsson
2016-10-04 20:25:49 +00:00
parent eb54fbf285
commit 4dfa31f9f8

View File

@@ -228,7 +228,7 @@ ifeq ($(BMP_PORT),)
ifeq ($(OOCD_FILE),) ifeq ($(OOCD_FILE),)
%.flash: %.elf %.flash: %.elf
@printf " FLASH $<\n" @printf " FLASH $<\n"
$(Q)(echo "halt; program $(*).elf verify reset" | nc -4 localhost 4444 2>/dev/null) || \ $(Q)(echo "halt; program $(realpath $(*).elf) verify reset" | nc -4 localhost 4444 2>/dev/null) || \
$(OOCD) -f interface/$(OOCD_INTERFACE).cfg \ $(OOCD) -f interface/$(OOCD_INTERFACE).cfg \
-f target/$(OOCD_TARGET).cfg \ -f target/$(OOCD_TARGET).cfg \
-c "program $(*).elf verify reset exit" \ -c "program $(*).elf verify reset exit" \
@@ -236,7 +236,7 @@ ifeq ($(OOCD_FILE),)
else else
%.flash: %.elf %.flash: %.elf
@printf " FLASH $<\n" @printf " FLASH $<\n"
$(Q)(echo "halt; program $(*).elf verify reset" | nc -4 localhost 4444 2>/dev/null) || \ $(Q)(echo "halt; program $(realpath $(*).elf) verify reset" | nc -4 localhost 4444 2>/dev/null) || \
$(OOCD) -f $(OOCD_FILE) \ $(OOCD) -f $(OOCD_FILE) \
-c "program $(*).elf verify reset exit" \ -c "program $(*).elf verify reset exit" \
$(NULL) $(NULL)