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
|
.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)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user