Began rewrite

This commit is contained in:
2025-02-16 16:27:46 +01:00
parent 295e3d9c18
commit 7d41cf45ed
82 changed files with 99 additions and 3028 deletions
+10 -13
View File
@@ -1,30 +1,27 @@
include ../defaults.mk
INC = ./include
SRC = ./src
BIN = ./bin
SRCS_C = $(shell find $(SRC) -name '*.c')
SRCS_S = $(shell find $(SRC) -name '*.s')
OBJS = $(patsubst $(SRC)/%.c, $(BIN)/%.o, $(SRCS_C)) \
$(patsubst $(SRC)/%.s, $(BIN)/%.s.o, $(SRCS_S))
INC = ./include
SRCS_C = $(wildcard $(SRC)/*.c)
SRCS_S = $(wildcard $(SRC)/*.s)
OBJS_C = $(patsubst $(SRC)/%.c, $(BIN)/%.o, $(SRCS_C))
OBJS_S = $(patsubst $(SRC)/%.s, $(BIN)/%.o, $(SRCS_S))
OUT = ./kernel.elf
LINKER = ./linker.ld
OUT = ./kern.bin
.PHONY: all clean
all: $(OUT)
$(OUT): $(OBJS)
$(OUT): $(OBJS_C) $(OBJS_S)
$(LD) $(LDFLAGS) -T$(LINKER) -o $@ $^
$(BIN)/%.o: $(SRC)/%.c
@mkdir -p $(dir $@)
$(CC) $(CFLAGS) -I$(INC) -c -o $@ $<
$(CC) $(CCFLAGS) -I$(INC) -c -o $@ $^
$(BIN)/%.s.o: $(SRC)/%.s
$(BIN)/%.o: $(SRC)/%.s
@mkdir -p $(dir $@)
$(AS) $(ASFLAGS) -felf32 -o $@ $<
$(AS) $(ASFLAGS) -felf32 -o $@ $^
clean:
rm -fr $(BIN) $(OUT)