SOURCES = \
  storage/bd/memory.cpp storage/fs/tarfs.cpp application.asm application.cpp \
  framebuffer.cpp interrupts.asm interrupts.cpp allocator.cpp storage.cpp \
  syscall.cpp utility.cpp paging.asm paging.cpp entry.cpp input.cpp panic.cpp \
  vfile.cpp

build/%.asm.o: source/%.asm
	@mkdir -p $(@D)
	$(HILBERT_NASM) $^ -o $@

build/%.cpp.o: source/%.cpp
	@mkdir -p $(@D)
	$(HILBERT_CC) -c -ffreestanding -mcmodel=kernel -I ${LIMINE_DIR} $^ -o $@

build/kernel.elf: $(SOURCES:%=build/%.o)
	$(HILBERT_LD) -T link.ld $^ -o $@

clean:
	rm -rf build
