From 7a912d1b668ab86ffe088eca3ac7e6f78a04a0c5 Mon Sep 17 00:00:00 2001 From: Tyler Murphy <=> Date: Mon, 17 Jul 2023 19:34:52 -0400 Subject: refactoring --- kernel/Makefile | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'kernel/Makefile') diff --git a/kernel/Makefile b/kernel/Makefile index d4cbdf4..2e7954e 100644 --- a/kernel/Makefile +++ b/kernel/Makefile @@ -1,9 +1,11 @@ include ../.env -C_SRC = $(shell find src -type f -name "*.c") +C_SRC = $(shell find src -type f -name "*.c" -not -path "src/arch/*") +C_SRC += $(shell find src/arch/$(ARCH) -type f -name "*.c") C_OBJ = $(patsubst %.c,bin/%.o, $(C_SRC)) -ASM_SRC = $(shell find src -type f -name "*.asm") +ASM_SRC = $(shell find src -type f -name "*.asm" -not -path "src/arch/*") +ASM_SRC += $(shell find src/arch/$(ARCH) -type f -name "*.asm") ASM_OBJ = $(patsubst %.asm,bin/%.asm.o, $(ASM_SRC)) CFLAGS += -Iinclude -Isrc -I../libk/include -std=gnu17 @@ -22,7 +24,7 @@ $(ASM_OBJ): bin/%.asm.o : %.asm bin/kernel.bin: $(C_OBJ) $(ASM_OBJ) @mkdir -p $(@D) - $(LD) -o bin/kernel.bin -T linker.ld $(C_OBJ) $(ASM_OBJ) ../libk/bin/libk.a $(LDFLAGS) + $(LD) -o bin/kernel.bin -T arch/$(ARCH)/linker.ld $(C_OBJ) $(ASM_OBJ) ../libk/bin/libk.a $(LDFLAGS) clean: rm -fr bin -- cgit v1.2.3-freya