summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authormwachs5 <megan@sifive.com>2016-08-01 11:41:50 -0700
committerGitHub <noreply@github.com>2016-08-01 11:41:50 -0700
commit7d1de2c3d4a2cfa238540d073f9cd9dcb7f38e1d (patch)
treeb30c60f84368c8319a7f4beeb6834c84b776285f /Makefile
parent51bca217eabfcc90d21924241250eca63b860a91 (diff)
parentb80083544c12351a969a1ce7be83c88707db73e4 (diff)
Merge pull request #2 from sifive/new_riscv_tests
Bump Tool versions
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile52
1 files changed, 27 insertions, 25 deletions
diff --git a/Makefile b/Makefile
index ac1f9b6..a9f9122 100644
--- a/Makefile
+++ b/Makefile
@@ -17,20 +17,26 @@ help :
@echo " tools:"
@echo " Install compilation & debugging tools"
@echo ""
- @echo " fpga [BOOTROM=demo]:"
- @echo " Rebuild the image (including Boot SW) to"
- @echo " reprogram the FPGA. "
- @echo ""
- @echo " software [PROGRAM=demo_gpio]:"
+ @echo " software [PROGRAM=demo_gpio PLATFORM=freedom-e300]:"
@echo " Build a software program to load with the"
@echo " debugger."
@echo ""
- @echo " run_debug [PROGRAM=demo_gpio]:"
- @echo " Launch the debugging tools to load or"
- @echo " debug running programs."
+ @echo " run_debug [PROGRAM=demo_gpio PLATFORM=freedom-e300]:"
+ @echo " Launch OpenOCD & GDB to load or debug "
+ @echo " running programs."
+ @echo ""
+ @echo " run_openocd [PLATFORM=freedom-e300]:"
+ @echo " run_gdb [PROGRAM=demo_gpio PLATFORM=freedom-e300]:"
+ @echo " Launch OpenOCD & GDB seperately"
@echo ""
+ @echo " fpga [BOOTROM=demo]:"
+ @echo " Rebuild the image (including Boot SW) to"
+ @echo " reprogram the FPGA image for Arty Board. "
+ @echo ""
+
@echo " For more information, visit dev.sifive.com"
+
#############################################################
# This section is for tool installation
#############################################################
@@ -40,10 +46,6 @@ toolchain32_wrkdir := $(wrkdir)/riscv32-gnu-toolchain
toolchain64_wrkdir := $(wrkdir)/riscv64-gnu-toolchain
toolchain_dest := $(CURDIR)/toolchain
-gdb_srcdir := $(srcdir)/riscv-binutils-gdb
-gdb_wrkdir := $(wrkdir)/riscv-binutils-gdb
-gdb_dest := $(CURDIR)/toolchain
-
openocd_srcdir := $(srcdir)/openocd
openocd_wrkdir := $(wrkdir)/openocd
openocd_dest := $(CURDIR)/toolchain
@@ -56,13 +58,12 @@ target32 := riscv32-unknown-linux-gnu
all: tools
@echo All done.
-tools: tools64 tools32 openocd gdb
+tools: tools64 tools32 openocd
@echo All Tools Installed
tools64: $(toolchain_dest)/bin/$(target64)-gcc
tools32: $(toolchain_dest)/bin/$(target32)-gcc
openocd: $(openocd_dest)/bin/openocd
-gdb: $(gdb_dest)/bin/$(target64)-gdb
$(toolchain_dest)/bin/$(target64)-gcc: $(toolchain_srcdir)
mkdir -p $(toolchain64_wrkdir)
@@ -83,13 +84,6 @@ $(openocd_dest)/bin/openocd: $(openocd_srcdir)
$(MAKE) -C $(openocd_wrkdir)
$(MAKE) -C $(openocd_wrkdir) install
-$(gdb_dest)/bin/$(target64)-gdb : $(gdb_srcdir)
- mkdir -p $(gdb_wrkdir)
- cd $(gdb_wrkdir); $(gdb_srcdir)/configure --prefix=$(gdb_dest) --target=riscv64-unknown-elf
- $(MAKE) -C $(gdb_wrkdir)
- $(MAKE) -C $(gdb_wrkdir) install
-
-
.PHONY: uninstall
uninstall:
rm -rf -- $(toolchain_dest)
@@ -129,15 +123,23 @@ software_clean:
#############################################################
# This Section is for launching the debugger
#############################################################
-OPENOCD = $(toolchain_dest)/bin/openocd
-OPENOCDARGS += -f $(srcdir)/riscv-tests/debug/targets/m2gl_m2s/openocd.cfg
+OPENOCD = $(toolchain_dest)/bin/openocd
+PLATFORM ?= freedom-e300
+OPENOCDARGS += -f $(srcdir)/riscv-tests/debug/targets/$(PLATFORM)/openocd.cfg
GDB = $(toolchain_dest)/bin/riscv64-unknown-elf-gdb
-GDBARGS += -ex "target extended-remote localhost:3333"
+GDBCMDS += -ex "target extended-remote localhost:3333"
+GDBARGS =
+
+run_openocd:
+ $(OPENOCD) $(OPENOCDARGS)
+
+run_gdb:
+ $(GDB) $(PROGRAM_DIR)/$(PROGRAM) $(GDBARGS)
run_debug:
$(OPENOCD) $(OPENOCDARGS) &
- $(GDB) $(PROGRAM_DIR)/$(PROGRAM) $(GDBARGS)
+ $(GDB) $(PROGRAM_DIR)/$(PROGRAM) $(GDBARGS) $(GDBCMDS)
.PHONY: clean
clean: