calculator/Makefile

16 lines
299 B
Makefile

CC=riscv64-unknown-elf-gcc
AS=riscv64-unknown-elf-as
ASFLAGS=-g -mabi=ilp32e -march=rv32ec
CFLAGS=$(ASFLAGS)
LD=riscv64-unknown-elf-ld
all: calc.elf
hello.elf: hello.o
$(LD) -m elf32lriscv $^ -o $@
calc.elf: calc.o
$(LD) -m elf32lriscv -T link.ld $^ -o $@
%.o : %.s
$(AS) $(ASFLAGS) $< -o $@