18 lines
440 B
Makefile
18 lines
440 B
Makefile
PREFIX := riscv64-unknown-elf-
|
|
CC := $(PREFIX)gcc
|
|
OBJCOPY := $(PREFIX)objcopy
|
|
|
|
ARGS := -mabi=ilp32 -march=rv32im -ffreestanding -nostdlib -Wl,-Bstatic,-T,memory.ld,--strip-debug
|
|
|
|
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
|