summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile7
1 files changed, 4 insertions, 3 deletions
diff --git a/Makefile b/Makefile
index 0c36f36..eedb007 100644
--- a/Makefile
+++ b/Makefile
@@ -14,6 +14,7 @@ endif
# Default target
BOARD ?= freedom-e300-hifive1
PROGRAM ?= demo_gpio
+GDB_PORT ?= 3333
# Variables the user probably shouldn't override.
builddir := work/build
@@ -190,7 +191,7 @@ PROGRAM_ELF = software/$(PROGRAM)/$(PROGRAM)
.PHONY: software_clean
software_clean:
- $(MAKE) -C $(PROGRAM_DIR) clean
+ $(MAKE) -C $(PROGRAM_DIR) BSP_BASE=$(abspath bsp) BOARD=$(BOARD) clean
.PHONY: software
software: software_clean
@@ -208,7 +209,7 @@ OPENOCDARGS += -f $(OPENOCDCFG)
GDB_UPLOAD_ARGS ?= --batch
GDB_UPLOAD_CMDS += -ex "set remotetimeout 240"
-GDB_UPLOAD_CMDS += -ex "target extended-remote localhost:3333"
+GDB_UPLOAD_CMDS += -ex "target extended-remote localhost:$(GDB_PORT)"
GDB_UPLOAD_CMDS += -ex "monitor reset halt"
GDB_UPLOAD_CMDS += -ex "monitor flash protect 0 64 last off"
GDB_UPLOAD_CMDS += -ex "load"
@@ -229,7 +230,7 @@ run_openocd:
$(RISCV_OPENOCD) $(OPENOCDARGS)
GDBCMDS += -ex "set remotetimeout 240"
-GDBCMDS += -ex "target extended-remote localhost:3333"
+GDBCMDS += -ex "target extended-remote localhost:$(GDB_PORT)"
run_gdb:
$(RISCV_GDB) $(PROGRAM_DIR)/$(PROGRAM) $(GDBARGS) $(GDBCMDS)