forked from PoliEcho-holding-org/kern
Rewrote libc makefile
This commit is contained in:
+17
-2
@@ -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
|
||||
|
||||
all:
|
||||
@echo "TODO: Write this makefile..."
|
||||
all: $(OUT)
|
||||
$(OUT): $(OBJS)
|
||||
$(AR) $(ARFLAGS) rcs $@ $^
|
||||
|
||||
$(BIN)/%.o: %.c
|
||||
@mkdir -p $(BIN)/$(dir $<)
|
||||
$(CC) $(CFLAGS) -I$(INC) -c -o $@ $<
|
||||
|
||||
clean:
|
||||
rm -fr $(BIN) $(OUT)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user