summaryrefslogtreecommitdiff
path: root/c/bfhello/Makefile
diff options
context:
space:
mode:
authorcheapie <no-email-for-you@example.com>2026-05-23 20:14:34 -0500
committercheapie <no-email-for-you@example.com>2026-05-23 20:14:34 -0500
commit85b5fde272be6ab543aa866baebabddc24566bdb (patch)
treeb4f2e3bb634effe51c2bdc5585ca4ea8b98d6dfa /c/bfhello/Makefile
downloadrvcontroller-85b5fde272be6ab543aa866baebabddc24566bdb.tar
rvcontroller-85b5fde272be6ab543aa866baebabddc24566bdb.tar.gz
rvcontroller-85b5fde272be6ab543aa866baebabddc24566bdb.tar.bz2
rvcontroller-85b5fde272be6ab543aa866baebabddc24566bdb.tar.xz
rvcontroller-85b5fde272be6ab543aa866baebabddc24566bdb.zip
Add initial content
Diffstat (limited to 'c/bfhello/Makefile')
-rw-r--r--c/bfhello/Makefile20
1 files changed, 20 insertions, 0 deletions
diff --git a/c/bfhello/Makefile b/c/bfhello/Makefile
new file mode 100644
index 0000000..fa163ed
--- /dev/null
+++ b/c/bfhello/Makefile
@@ -0,0 +1,20 @@
+all: bfhello.hex
+
+bfhello.o: bfhello.c
+ clang -target riscv32-none-elf -I../rvcontroller-libraries -march=rv32imacb_zicntr_zicond_zicsr_zifencei_zihintpause_zilsd_zclsd_zabha_zacas_zbkb_zbkx_zcb_zcmp_zcmt -ffreestanding -O3 -c -o bfhello.o bfhello.c
+
+bfhello.elf: ../rvcontroller-libraries/rvcontroller-init.o ../rvcontroller-libraries/rvcontroller-ecalls.o bfhello.o
+ riscv32-none-elf-ld -T rvcontroller.ld --no-warn-rwx-segments -o bfhello.elf ../rvcontroller-libraries/rvcontroller-init.o bfhello.o ../rvcontroller-libraries/rvcontroller-ecalls.o
+
+dump: bfhello.elf
+ riscv32-none-elf-objdump -d bfhello.elf
+
+bfhello.hex: bfhello.elf
+ riscv32-none-elf-objcopy -O ihex bfhello.elf bfhello.hex
+
+load: bfhello.hex
+ bash -c "wl-copy < bfhello.hex"
+
+clean:
+ rm -f bfhello.bin bfhello.elf bfhello.o init.o
+