+.PHONY: stopflash_$(1)
+stopflash_$(1):
+ $L "$(1): Stopping target flashing"
+ $Q if [ ! -f $$($(1)_STOPFLASH_SCRIPT) ] ; then \
+ printf "CLDLG: No stopflash script found.\n" ; \
+ exit 1 ; \
+ fi
+ $Q $$($(1)_STOPFLASH_SCRIPT) ;
+
+
+# Debug target
+.PHONY: debug_$(1)
+debug_$(1): $(OUTDIR)/$(1).elf
+ $L "$(1): Debugging target"
+ $Q if [ ! -f $$($(1)_DEBUG_SCRIPT) ] ; then \
+ printf "CLDLG: No debug script found.\n" ; \
+ exit 1 ; \
+ fi
+ $Q if [ ! "$$($(1)_PROGRAMMER_TYPE)" == "none" ] ; then \
+ PROGRAMMER_CPU=$$($(1)_PROGRAMMER_CPU) PROGRAMMER_TYPE=$$($(1)_PROGRAMMER_TYPE) \
+ PROGRAMMER_PORT=$$($(1)_PROGRAMMER_PORT) GDB_PORT=3333 \
+ ELF_FILE=$$< \
+ $$($(1)_DEBUG_SCRIPT) ; \
+ else \
+ printf "CLDLG: No programmer interface configured, see http://dev.bertos.org/wiki/ProgrammerInterface\n" ; \
+ exit 1 ; \
+ fi
+
+.PHONY: stopdebug_$(1)
+stopdebug_$(1):
+ $L "$(1): Stopping debugger"
+ $Q if [ ! -f $$($(1)_STOPDEBUG_SCRIPT) ] ; then \
+ printf "CLDLG: No stopdebug script found.\n" ; \
+ exit 1 ; \
+ fi
+ $Q $$($(1)_STOPDEBUG_SCRIPT) ;
+