Files
exkernel/Makefile
Fabio Scotto di Santolo 3a102f1e61 Added libc functions
2025-11-30 18:37:12 +01:00

27 lines
571 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 common.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)