new-sonar/firmware/hello_world_c/Makefile
David Lenfesty 1cfa5a47de firmware: made some rust firmware to test
Had some issues due to lack of startup code (stack pointer was unset,
leading to underflow in address space), so decided to just get the rust
FW started instead of finding some startup code to use.
2023-01-22 15:20:27 -07:00

18 lines
429 B
Makefile

PREFIX := riscv64-unknown-elf-
CC := $(PREFIX)gcc
OBJCOPY := $(PREFIX)objcopy
ARGS := -mabi=ilp32 -march=rv32im -ffreestanding -nostdlib -Wl,-Bstatic,-T,memory.ld -g
SOURCES := main.c
INCLUDES := uart.h
hello_world.bin: hello_world.elf
$(OBJCOPY) -S -O binary hello_world.elf hello_world.bin
hello_world.elf: $(SOURCES) $(INCLUDES)
$(CC) $(ARGS) $(SOURCES) -o hello_world.elf
clean:
rm -f hello_world.elf hello_world.bin