Skip to content

Commit 3ee4e21

Browse files
committed
build system and resolved the symbol conflicts
1 parent b08acf4 commit 3ee4e21

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

Makefile

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
1-
CC := i686-elf-gcc
1+
CC := i686-linux-gnu-gcc
22
AS := nasm
3-
LD := i686-elf-ld
4-
OBJCOPY := i686-elf-objcopy
3+
LD := i686-linux-gnu-gcc
4+
OBJCOPY := i686-linux-gnu-objcopy
55

66
CFLAGS := -ffreestanding -O2 -Wall -Wextra -m32 -fno-pie -fno-stack-protector -nostdlib -nostdinc -Iinclude -msse -msse2
77
ASFLAGS := -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

1010
SRC_DIR := src
1111
BUILD_DIR := build
1212
MODEL_BLOB := $(firstword $(wildcard assets/smollm-135m.gguf) $(wildcard assets/SmolLM2-135M-Instruct-Q4_K_M.gguf))
1313
MODEL_OBJ := $(BUILD_DIR)/model.o
1414

1515
ASM_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

1818
ASM_OBJS := $(patsubst $(SRC_DIR)/%.s,$(BUILD_DIR)/%.o,$(ASM_SRCS))
1919
C_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

4242
kernel.bin: $(OBJS) linker.ld
43-
$(LD) $(LDFLAGS) -o $@ $(OBJS)
43+
$(LD) $(LDFLAGS) $(OBJS)
4444

4545
$(MODEL_OBJ): $(MODEL_BLOB)
4646
mkdir -p $(dir $@)

0 commit comments

Comments
 (0)