summaryrefslogtreecommitdiff
path: root/c/phb/Makefile
diff options
context:
space:
mode:
authorcheapie <cheapiephp@gmail.com>2026-07-22 20:37:26 -0500
committercheapie <cheapiephp@gmail.com>2026-07-22 20:37:26 -0500
commitf4ca429185eef4083a4ea3c013cd148a74aaee75 (patch)
tree15f4a307ea029a06b92a319be999358dec646e00 /c/phb/Makefile
parent54d001287239a4b57f88bb56a5aacf6e23565f22 (diff)
downloadrvcontroller-f4ca429185eef4083a4ea3c013cd148a74aaee75.tar
rvcontroller-f4ca429185eef4083a4ea3c013cd148a74aaee75.tar.gz
rvcontroller-f4ca429185eef4083a4ea3c013cd148a74aaee75.tar.bz2
rvcontroller-f4ca429185eef4083a4ea3c013cd148a74aaee75.tar.xz
rvcontroller-f4ca429185eef4083a4ea3c013cd148a74aaee75.zip
Add pedestrian hybrid beaconHEADmain
Diffstat (limited to 'c/phb/Makefile')
-rw-r--r--c/phb/Makefile31
1 files changed, 31 insertions, 0 deletions
diff --git a/c/phb/Makefile b/c/phb/Makefile
new file mode 100644
index 0000000..dd42b2d
--- /dev/null
+++ b/c/phb/Makefile
@@ -0,0 +1,31 @@
+CC ?= clang
+CFLAGS_MARCH ?= -march=rv32imacb_zicntr_zicond_zicsr_zifencei_zihintpause_zilsd_zclsd_zabha_zacas_zbkb_zbkx_zcb_zcmp_zcmt
+CFLAGS_OPT ?= -O3
+CFLAGS ?= ${CFLAGS_MARCH} ${CFLAGS_OPT}
+
+ifeq (${CC}, clang)
+ CC := ${CC} -target riscv32-none-elf
+endif
+
+.PHONY: all dump load clean
+
+all: phb.hex
+
+phb.o: phb.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 -DRRXING_DE -o phb.o phb.c
+
+phb.elf: ../rvcontroller-libraries/rvcontroller-init.o ../rvcontroller-libraries/rvcontroller-ecalls.o phb.o
+ clang -target riscv32-none-elf -T rvcontroller.ld -nostdlib -nostartfiles -Xlinker --no-warn-rwx-segments -o phb.elf ../rvcontroller-libraries/rvcontroller-init.o phb.o ../rvcontroller-libraries/rvcontroller-ecalls.o
+
+dump: phb.elf
+ riscv32-none-elf-objdump -d phb.elf
+
+phb.hex: phb.elf
+ riscv32-none-elf-objcopy -O ihex phb.elf phb.hex
+
+load: phb.hex
+ bash -c "wl-copy < phb.hex"
+
+clean:
+ rm -f phb.hex phb.elf phb.o init.o
+