Move PHONY tags and fix clean

Move the PHONY tags to make them clearer to read.
Fix the clean rule so it deletes the build directory.
This commit is contained in:
2026-03-15 18:01:35 +01:00
parent 803ac0879b
commit 32f3889565

View File

@@ -11,8 +11,6 @@ CC_PROBLEMATIC_FLAGS=-Wno-unused-parameter -Wno-unused-variable
LD := x86_64-elf-ld
.PHONY: build build-iso debug debug2 run clean
$(ELFFILE): $(BUILDDIR) $(OBJFILES)
nasm -f elf64 src/idt/idt.S -o $(BUILDDIR)/idt_stub.o
$(LD) -o $(ELFFILE) -T linker.ld $(OBJFILES) $(BUILDDIR)/idt_stub.o
@@ -50,16 +48,20 @@ build-iso: limine/limine build
iso_root -o pepper.iso
./limine/limine bios-install pepper.iso
.PHONY: debug
debug:
/usr/bin/qemu-system-x86_64 -drive file=pepper.iso -s -S -d int -D qemu.log -no-reboot -no-shutdown &
gdb $(ELFFILE) --command=debug.gdb
.PHONY: debug2
debug2:
/usr/bin/qemu-system-x86_64 -drive file=pepper.iso -s -S -d int -no-reboot -no-shutdown &
pwndbg $(ELFFILE) --command=debug.gdb
.PHONY: run
run: build-iso
/usr/bin/qemu-system-x86_64 -cdrom pepper.iso -serial stdio
.PHONY: clean
clean:
rm -rf *.o symbols.map symbols.S $(ELFFILE) iso_root pepper.iso limine $(BUILDDIR)/*.o
rm -rf $(BUILDDIR) symbols.map symbols.S $(ELFFILE) iso_root pepper.iso limine