aboutsummaryrefslogtreecommitdiff
path: root/debug_rom/Makefile
diff options
context:
space:
mode:
authorTim Newsome <tim@sifive.com>2016-04-22 15:08:35 -0700
committerTim Newsome <tim@sifive.com>2016-05-23 12:12:10 -0700
commitae566cba20a70f92c6cb778068e6e523602a2756 (patch)
tree750384bd5cd1cc05b01f03500c1092550f2cbf91 /debug_rom/Makefile
parent576d311ad629914a7ef7cd0c6c22105329e3bb46 (diff)
downloadspike-ae566cba20a70f92c6cb778068e6e523602a2756.zip
spike-ae566cba20a70f92c6cb778068e6e523602a2756.tar.gz
spike-ae566cba20a70f92c6cb778068e6e523602a2756.tar.bz2
Add debug rom code.
Diffstat (limited to 'debug_rom/Makefile')
-rw-r--r--debug_rom/Makefile17
1 files changed, 17 insertions, 0 deletions
diff --git a/debug_rom/Makefile b/debug_rom/Makefile
new file mode 100644
index 0000000..a6da5a8
--- /dev/null
+++ b/debug_rom/Makefile
@@ -0,0 +1,17 @@
+# Recursive make is bad, but in this case we're cross compiling which is a
+# pretty unusual use case.
+
+CC = $(RISCV)/bin/riscv64-unknown-elf-gcc
+OBJCOPY = $(RISCV)/bin/riscv64-unknown-elf-objcopy
+
+%.o: %.S
+ $(CC) -c $<
+
+debug_rom: debug_rom.o
+ $(CC) -nostdlib -nostartfiles -Tlink.ld -o $@ $^
+
+debug_rom.raw: debug_rom
+ $(OBJCOPY) -O binary --only-section .text debug_rom debug_rom.raw
+
+clean:
+ rm -f debug_rom debug_rom.o debug_rom.raw