summaryrefslogtreecommitdiff
path: root/c/bfhello/Makefile
blob: 583ffc10255b1f6476771efc34559fb7e8d11abe (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
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
	clang -target riscv32-none-elf -T rvcontroller.ld -nostdlib -nostartfiles -Xlinker --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