diff options
author | Samuel Johnson <[email protected]> | 2025-07-01 10:33:05 -0400 |
---|---|---|
committer | Samuel Johnson <[email protected]> | 2025-07-01 10:33:05 -0400 |
commit | 571a656a6bd9b4b9d5c595c578d15ba79bb19ef7 (patch) | |
tree | 46f75b47f4edab4281de14ffa1c4a91a5a84f8f1 /Makefile | |
parent | 12fd3a91f138bf90520134682e38bf3b0341e660 (diff) |
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 32 |
1 files changed, 27 insertions, 5 deletions
@@ -22,9 +22,21 @@ KERNEL := bin/core K_OBJS := \ kernel/entry.o \ kernel/cxx/constructors.o \ - kernel/cxx/icxxabi.o + kernel/cxx/icxxabi.o \ + kernel/utils.o \ + kernel/io/logger/base.o \ + kernel/amd64/io/com1.o +K_SRCS := $(patsubst %.o,%.cxx,$(K_OBJS)) +K_ASM_OBJS := \ + kernel/amd64/io/ports.o K_LINKSCRIPT := kernel/ldscript +CPPSTDDIRS := \ + vendor/x86_64-elf/include/c++/14.2.0 \ + vendor/x86_64-elf/include/c++/14.2.0/x86_64-elf \ + vendor/x86_64-elf/include/c++/14.2.0/backward +CPPSTD := $(addprefix -I ,$(CPPSTDDIRS)) + BINARIES := \ $(KERNEL) @@ -35,10 +47,11 @@ OVMF_ROOT := /usr/share/qemu all: hinterOS.iso run: - qemu-system-x86_64 --bios $(OVMF_ROOT)/ovmf-x86_64.bin -cdrom hinterOS.iso + qemu-system-x86_64 --serial stdio --bios $(OVMF_ROOT)/ovmf-x86_64.bin -cdrom hinterOS.iso clean: - find kernel -type f -name '*.o' -exec rm {} + + - find kernel -type f -name '*.d' -exec rm {} + - rm hinterOS.iso - rm $(BINARIES) @@ -59,10 +72,19 @@ hinterOS.iso: $(BINARIES) iso -o $@ vendor/limine/limine bios-install $@ -$(KERNEL): $(K_OBJS) +$(KERNEL): $(K_OBJS) $(K_ASM_OBJS) rm -rf bin mkdir -p bin - $(LD) -o $@ -T$(K_LINKSCRIPT) $^ + $(LD) -o $@ -T $(K_LINKSCRIPT) $^ + +.SECONDEXPANSION: +$(K_OBJS): %.o: %.cxx %.d + $(CC) -c $(CFLAGS) -MT $@ -MMD -MP -MF $(basename $<).d -I kernel $(CPPSTD) $< -o $@ -$(K_OBJS): %.o: %.cxx +$(K_ASM_OBJS): %.o: %.S $(CC) -c $(CFLAGS) $^ -o $@ + +DEPFILES := $(K_SRCS:%.cxx=%.d) +$(DEPFILES): + +-include $(wildcard $(DEPFILES)) |