File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- CC := i686-elf -gcc
1+ CC := i686-linux-gnu -gcc
22AS := nasm
3- LD := i686-elf-ld
4- OBJCOPY := i686-elf -objcopy
3+ LD := i686-linux-gnu-gcc
4+ OBJCOPY := i686-linux-gnu -objcopy
55
66CFLAGS := -ffreestanding -O2 -Wall -Wextra -m32 -fno-pie -fno-stack-protector -nostdlib -nostdinc -Iinclude -msse -msse2
77ASFLAGS := -f elf32
8- LDFLAGS := -T linker.ld --build-id=none -m elf_i386
8+ LDFLAGS := -T linker.ld -o kernel.bin -nostdlib -lgcc -m32
99
1010SRC_DIR := src
1111BUILD_DIR := build
1212MODEL_BLOB := $(firstword $(wildcard assets/smollm-135m.gguf) $(wildcard assets/SmolLM2-135M-Instruct-Q4_K_M.gguf) )
1313MODEL_OBJ := $(BUILD_DIR ) /model.o
1414
1515ASM_SRCS := $(wildcard $(SRC_DIR ) /* .s $(SRC_DIR ) /* /* .s $(SRC_DIR ) /* /* /* .s)
16- C_SRCS := $(wildcard $(SRC_DIR ) /* .c $(SRC_DIR ) /* /* .c $(SRC_DIR ) /* /* /* .c)
16+ C_SRCS := $(filter-out $( SRC_DIR ) /drivers/vga.c, $( wildcard $(SRC_DIR ) /* .c $(SRC_DIR ) /* /* .c $(SRC_DIR ) /* /* /* .c) )
1717
1818ASM_OBJS := $(patsubst $(SRC_DIR ) /% .s,$(BUILD_DIR ) /% .o,$(ASM_SRCS ) )
1919C_OBJS := $(patsubst $(SRC_DIR ) /% .c,$(BUILD_DIR ) /% .o,$(C_SRCS ) )
@@ -40,7 +40,7 @@ $(BUILD_DIR)/%.o: $(SRC_DIR)/%.c
4040 $(CC ) $(CFLAGS ) -c $< -o $@
4141
4242kernel.bin : $(OBJS ) linker.ld
43- $(LD ) $(LDFLAGS ) -o $@ $(OBJS )
43+ $(LD ) $(LDFLAGS ) $(OBJS )
4444
4545$(MODEL_OBJ ) : $(MODEL_BLOB )
4646 mkdir -p $(dir $@ )
You can’t perform that action at this time.
0 commit comments