diff options
author | Clyne Sullivan <clyne@bitgloo.com> | 2024-09-27 06:02:49 -0400 |
---|---|---|
committer | Clyne Sullivan <clyne@bitgloo.com> | 2024-09-27 06:02:49 -0400 |
commit | d43d7caf15a01dd9c2ef1d9e975df3ef7c4e9204 (patch) | |
tree | aaf1f0f3a18b6f7b3fc25022e06941a9fb4fa612 /Makefile |
wip: initial commit
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..17adbac --- /dev/null +++ b/Makefile @@ -0,0 +1,45 @@ +ASFLAGS := --32 +CXXFLAGS := -m32 -ggdb -g3 -O0 -fno-pic -ffreestanding -fno-rtti -fno-exceptions -std=c++23 +LDFLAGS := -m32 -static -T link.ld -ffreestanding -nostdlib + +ASFILES := boot.s +CXXFILES := gdt.cpp \ + idt.cpp \ + memory.cpp \ + multiboot.cpp \ + pic.cpp \ + pit.cpp \ + tasking.cpp \ + vgaterminal.cpp \ + kernel.cpp + +OBJS := $(subst .s,.o,$(ASFILES)) \ + $(subst .cpp,.o,$(CXXFILES)) + +all: myos.iso + +myos.iso: myos.bin iso/boot/grub/grub.cfg + @echo " ISO " $@ + @cp myos.bin iso/boot/ + @grub-mkrescue -o myos.iso iso/ + +myos.bin: $(OBJS) link.ld + @echo " LD " $@ + @g++ $(LDFLAGS) -o $@ $(OBJS) + +%.o: %.s + @echo " AS " $< + @as $(ASFLAGS) -c $< -o $@ + +%.o: %.cpp + @echo " CXX " $< + @g++ $(CXXFLAGS) -c $< -o $@ + +clean: + @echo " CLEAN" + @rm -f $(OBJS) myos.bin myos.iso + +run: myos.iso + @echo " QEMU" + @qemu-system-i386 -cdrom $< -monitor stdio -no-reboot -s -S #-d int + |