aboutsummaryrefslogtreecommitdiffstats
path: root/dhrystone/Makefile
diff options
context:
space:
mode:
authorClifford Wolf <clifford@clifford.at>2015-06-06 14:01:37 +0200
committerClifford Wolf <clifford@clifford.at>2015-06-06 14:14:32 +0200
commit77ba5a18973bd02b461ab96047acfcc3fb62cf7b (patch)
tree573afedb6a3a14c91224e16724fa21ba3a939de2 /dhrystone/Makefile
downloadpicorv32-77ba5a18973bd02b461ab96047acfcc3fb62cf7b.tar.gz
picorv32-77ba5a18973bd02b461ab96047acfcc3fb62cf7b.zip
Initial import
Diffstat (limited to 'dhrystone/Makefile')
-rw-r--r--dhrystone/Makefile35
1 files changed, 35 insertions, 0 deletions
diff --git a/dhrystone/Makefile b/dhrystone/Makefile
new file mode 100644
index 0000000..81dea54
--- /dev/null
+++ b/dhrystone/Makefile
@@ -0,0 +1,35 @@
+
+OBJS = start.o dhry_1.o dhry_2.o stdlib.o
+CFLAGS = -MD -O3 -m32 -march=RV32I -ffreestanding -nostdlib -DTIME
+
+test: testbench.exe dhry.hex
+ vvp -N testbench.exe
+
+testbench.exe: testbench.v ../picorv32.v
+ iverilog -o testbench.exe testbench.v ../picorv32.v
+ chmod -x testbench.exe
+
+dhry.hex: dhry.bin ../firmware/makehex.py
+ python3 ../firmware/makehex.py $< > $@
+
+dhry.bin: dhry.elf
+ riscv64-unknown-elf-objcopy -O binary $< $@
+ chmod -x $@
+
+dhry.elf: $(OBJS) ../firmware/sections.lds
+ riscv64-unknown-elf-gcc $(CFLAGS) -Wl,-Bstatic,-T,../firmware/sections.lds,-Map,dhry.map,--strip-debug -o $@ $(OBJS) -lgcc
+ chmod -x $@
+
+%.o: %.c
+ riscv64-unknown-elf-gcc -c $(CFLAGS) $<
+
+%.o: %.S
+ riscv64-unknown-elf-gcc -c $(CFLAGS) $<
+
+clean:
+ rm -rf *.o *.d dhry.elf dhry.map dhry.bin dhry.hex testbench.exe testbench.vcd
+
+.PHONY: test clean
+
+-include *.d
+