1
0
Fork 0
This repository has been archived on 2022-12-02. You can view files and clone it, but cannot push or open issues or pull requests.
riscv-opensbi-hello/Makefile
2021-07-25 15:09:53 -04:00

13 lines
455 B
Makefile

CODE=src/
CC=riscv64-unknown-elf-gcc
CFLAGS=-march=rv64gc -mabi=lp64d -static -mcmodel=medany -fvisibility=hidden -nostdlib -nostartfiles -Tkernel.ld -g -Wall -Wextra
EMU=qemu-system-riscv64
EFLAGS=-machine virt -cpu rv64 -bios opensbi-riscv64-generic-fw_dynamic.bin -m 256m -nographic -global virtio-mmio.force-legacy=false -s #-S
.PHONY: all clean run
all: $(CODE)*.s $(CODE)*.c
$(CC) $(CFLAGS) $? -o kernel
run:
$(EMU) $(EFLAGS) -kernel kernel