summaryrefslogtreecommitdiff
path: root/c/elevator/Makefile
blob: 875cd3bb6082d8666100b5056aa30976e8c8f79f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
all: elevator.hex

elevator.o: elevator.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 elevator.o elevator.c

elevator.elf: ../rvcontroller-libraries/rvcontroller-init.o ../rvcontroller-libraries/rvcontroller-ecalls.o elevator.o
	riscv32-none-elf-ld -T rvcontroller.ld --no-warn-rwx-segments -o elevator.elf ../rvcontroller-libraries/rvcontroller-init.o elevator.o ../rvcontroller-libraries/rvcontroller-ecalls.o

dump: elevator.elf
	riscv32-none-elf-objdump -d elevator.elf

elevator.hex: elevator.elf
	riscv32-none-elf-objcopy -O ihex elevator.elf elevator.hex

load: elevator.hex
	bash -c "wl-copy < elevator.hex"

clean:
	rm -f elevator.bin elevator.elf elevator.o init.o