Rewrote libc makefile

This commit is contained in:
2024-12-30 14:34:39 +01:00
parent bfe67a791e
commit a2bc851f22
+17 -2
View File
@@ -1,7 +1,22 @@
include ../defaults.mk
INC = ./include
BIN = ./bin
SRCS = $(shell find . -name '*.c')
OBJS = $(patsubst %.c, $(BIN)/%.o, $(SRCS))
OUT = ./libc.o
.PHONY: all clean .PHONY: all clean
all: all: $(OUT)
@echo "TODO: Write this makefile..." $(OUT): $(OBJS)
$(AR) $(ARFLAGS) rcs $@ $^
$(BIN)/%.o: %.c
@mkdir -p $(BIN)/$(dir $<)
$(CC) $(CFLAGS) -I$(INC) -c -o $@ $<
clean: clean:
rm -fr $(BIN) $(OUT)