summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarl Palsson <karlp@tweak.net.au>2017-04-04 21:03:19 +0000
committerKarl Palsson <karlp@tweak.net.au>2017-04-04 21:03:19 +0000
commitc802ef055cdce6d3b36387421e8c53062d19433c (patch)
tree9944b63a6a10587aed8b3da258c179a3429fb671
parent667ce879effef44d2615fb7f280fbb0802fb6141 (diff)
downloadolsndot-c802ef055cdce6d3b36387421e8c53062d19433c.tar.gz
olsndot-c802ef055cdce6d3b36387421e8c53062d19433c.tar.bz2
olsndot-c802ef055cdce6d3b36387421e8c53062d19433c.zip
rules.mk: make sure flashing works from other directories
Provide full path when communicating with openocd. This means you can run a permanent openocd session from the ./openocd directory, and still have things working with just "make flash" from whatever test directory you are in.
-rw-r--r--rules.mk4
1 files changed, 2 insertions, 2 deletions
diff --git a/rules.mk b/rules.mk
index 08a648e..2cb7248 100644
--- a/rules.mk
+++ b/rules.mk
@@ -150,13 +150,13 @@ $(PROJECT).elf: $(OBJS) $(LDSCRIPT)
%.flash: %.elf
@printf " FLASH\t$<\n"
ifeq (,$(OOCD_FILE))
- $(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 \
-f target/$(OOCD_TARGET).cfg \
-c "program $(*).elf verify reset exit" \
$(NULL)
else
- $(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) \
-c "program $(*).elf verify reset exit" \
$(NULL)