summaryrefslogtreecommitdiff
path: root/kernel/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/Makefile')
-rw-r--r--kernel/Makefile8
1 files changed, 5 insertions, 3 deletions
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