Single Makefile driving the whole build: assemble .asm files with NASM, compile .c files with the cross-compiler in freestanding mode, link everything against linker.ld, produce kernel.elf (and a bootable image if not using Multiboot2 direct boot). Add a clean target and a run target that calls scripts/run-qemu.sh.
Resources:
- OSDev wiki: Bare Bones — Makefile section has a working reference Makefile for exactly this setup
- GNU Make manual, pattern rules section, useful for the
.asm → .o and .c → .o rules without repeating yourself per file
Single Makefile driving the whole build: assemble
.asmfiles with NASM, compile.cfiles with the cross-compiler in freestanding mode, link everything againstlinker.ld, producekernel.elf(and a bootable image if not using Multiboot2 direct boot). Add acleantarget and aruntarget that callsscripts/run-qemu.sh.Resources:
.asm → .oand.c → .orules without repeating yourself per file