From ace65b453151845bc361f21f3e5b651c35f9f126 Mon Sep 17 00:00:00 2001
From: Jon Santmyer <jon@jonsantmyer.com>
Date: Wed, 22 May 2024 13:00:41 -0400
Subject: massive refactor for mp and organization

---
 Makefile | 19 +++++++------------
 1 file changed, 7 insertions(+), 12 deletions(-)

(limited to 'Makefile')

diff --git a/Makefile b/Makefile
index 6697fc6..84244de 100644
--- a/Makefile
+++ b/Makefile
@@ -1,24 +1,19 @@
 include config.mk
 
+CDIRS := boot device initrd klib memory task syscall
+CDIRS += memory/alloc
+CDIRS += boot/$(TARGET_BOOTLOADER)
+CDIRS += arch/$(TARGET_MACHINE)
+
 CFILES := $(wildcard *.c)
-CFILES += $(wildcard */*.c)
-CFILES += $(wildcard boot/$(TARGET_BOOTLOADER)/*.c)
-CFILES += $(wildcard arch/$(TARGET_MACHINE)/*.c)
-CFILES += $(wildcard arch/$(TARGET_MACHINE)/*/*.c)
+CFILES += $(foreach dir, $(CDIRS), $(wildcard $(dir)/*.c))
 
 SFILES := $(wildcard *.S)
-SFILES += $(wildcard */*.S)
-SFILES += $(wildcard arch/$(TARGET_MACHINE)/*.S)
-SFILES += $(wildcard arch/$(TARGET_MACHINE)/*/*.S)
+SFILES += $(foreach dir, $(CDIRS), $(wildcard $(dir)/*.S))
 
 OBJFILES := $(patsubst %.c,%.o,$(CFILES))
 OBJFILES += $(patsubst %.S,%.o,$(SFILES))
 
-DFILES := $(wildcard *.d)
-DFILES += $(wildcard */*.d)
-DFILES += $(wildcard arch/$(TARGET_MACHINE)/*.d)
-DFILES += $(wildcard arch/$(TARGET_MACHINE)/*/*.d)
-
 BIN := jove.elf
 
 all: $(BIN)
-- 
cgit v1.2.1