summaryrefslogtreecommitdiff
path: root/assembly/trap-test/Makefile
diff options
context:
space:
mode:
authorcheapie <cheapiephp@gmail.com>2026-06-19 10:23:26 -0500
committercheapie <cheapiephp@gmail.com>2026-06-19 10:23:26 -0500
commit9ae1b986e8461eabe43291fec51abbd4153f8e30 (patch)
tree0959fb1daecc531a04f8fe80c2ba3f2272feed59 /assembly/trap-test/Makefile
parenteeb1c32240ace33f843ef708ef027569ab401e7a (diff)
downloadrvcontroller-9ae1b986e8461eabe43291fec51abbd4153f8e30.tar
rvcontroller-9ae1b986e8461eabe43291fec51abbd4153f8e30.tar.gz
rvcontroller-9ae1b986e8461eabe43291fec51abbd4153f8e30.tar.bz2
rvcontroller-9ae1b986e8461eabe43291fec51abbd4153f8e30.tar.xz
rvcontroller-9ae1b986e8461eabe43291fec51abbd4153f8e30.zip
Add trap handling support
Diffstat (limited to 'assembly/trap-test/Makefile')
-rw-r--r--assembly/trap-test/Makefile24
1 files changed, 24 insertions, 0 deletions
diff --git a/assembly/trap-test/Makefile b/assembly/trap-test/Makefile
new file mode 100644
index 0000000..8833502
--- /dev/null
+++ b/assembly/trap-test/Makefile
@@ -0,0 +1,24 @@
+MARCH ?= rv32imacbzicntr_zicond_zicsr_zifencei_zihintpause_zilsd_zclsd_zabha_zacas_zbkb_zbkx_zcb_zcmp_zcmt
+
+.PHONY: all dump load clean
+
+all: trap-test.hex
+
+trap-test.o: trap-test.S
+ riscv32-none-elf-as -I../rvcontroller-libraries -march=${MARCH} -o trap-test.o trap-test.S
+
+trap-test.elf: trap-test.o
+ riscv32-none-elf-ld -T rvcontroller.ld --no-warn-rwx-segments -o trap-test.elf trap-test.o
+
+dump: trap-test.elf
+ riscv32-none-elf-objdump -d trap-test.elf
+
+trap-test.hex: trap-test.elf
+ riscv32-none-elf-objcopy -O ihex trap-test.elf trap-test.hex
+
+load: trap-test.hex
+ bash -c "wl-copy < trap-test.hex"
+
+clean:
+ rm -f trap-test.hex trap-test.elf trap-test.o
+