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-container: $(OUT) distrobox enter archlinux -- qemu-system-riscv32 \ -machine virt \ -bios default \ -nographic \ -serial mon:stdio \ -no-reboot \ -kernel $(OUT) run: $(OUT) qemu-system-riscv32 \ -machine virt \ -bios default \ -nographic \ -serial mon:stdio \ -no-reboot \ -kernel $(OUT)