Files
exkernel/Makefile
Fabio Scotto di Santolo c59b4004e5 Implemented project structure
2025-11-29 18:43:07 +01:00

27 lines
562 B
Makefile

CC = ./xpack-riscv-none-elf-gcc-13.4.0-1/bin/riscv-none-elf-gcc
CFLAGS = -nostdlib -O2 -g3 -Wall -Wextra -fno-stack-protector -ffreestanding
LD_SCRIPT = kernel.ld
LDFLAGS = -T$(LD_SCRIPT) -Wl,-Map=kernel.map
SRC = kernel.c
OUT = kernel.elf
.PHONY: all clean run
all: $(OUT)
$(OUT): $(SRC) $(LD_SCRIPT)
$(CC) $(LDFLAGS) $(CFLAGS) $(SRC) -o $@
clean:
rm -f $(OUT) kernel.map
run: $(OUT)
distrobox enter archlinux -- qemu-system-riscv32 \
-machine virt \
-bios default \
-nographic \
-serial mon:stdio \
-no-reboot \
-kernel $(OUT)