From 704dc72c040f2e768aa8e426dc18459dcea42ed5 Mon Sep 17 00:00:00 2001 From: batt Date: Thu, 27 Aug 2009 14:55:24 +0000 Subject: [PATCH] Add makefile target rule for debugging. git-svn-id: https://src.develer.com/svnoss/bertos/trunk@2803 38d2e660-2303-0410-9eaa-f027e97ec537 --- bertos/rules.mk | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/bertos/rules.mk b/bertos/rules.mk index a6dae1df..f3171792 100644 --- a/bertos/rules.mk +++ b/bertos/rules.mk @@ -242,7 +242,6 @@ $$(OUTDIR)/$(1)_whole.elf: bumprev $$($(1)_SRC) $$($(1)_LDSCRIPT) $Q $$($(1)_CC) $$($(1)_SRC) $$(CFLAGS) $$($(1)_CFLAGS) $$(LIB) $$(LDFLAGS) $$($(1)_LDFLAGS) -o $$@ # Flash target -# NOTE: we retry in case of failure because the STK500 programmer is crappy .PHONY: flash_$(1) flash_$(1): $(OUTDIR)/$(1).hex flash_$(1)_local $L "$(1): Flashing target" @@ -258,6 +257,20 @@ flash_$(1): $(OUTDIR)/$(1).hex flash_$(1)_local .PHONY: flash_$(1)_local flash_$(1)_local: +# Debug target +.PHONY: debug_$(1) +debug_$(1): $(OUTDIR)/$(1).elf + $L "$(1): Debugging target" + $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 "No programmer interface configured, see http://dev.bertos.org/wiki/ProgrammerInterface\n" ; \ + exit 1 ; \ + fi + .PHONY: fuses_$(!) fuses_$(1): if [ ! -z "$$($(1)_efuse)" ] ; then \ -- 2.25.1