finix/libk/Makefile

21 lines
311 B
Makefile
Raw Permalink Normal View History

2023-07-16 06:54:32 +00:00
include ../.env
SRC = $(shell find src -type f -name "*.c")
OBJ = $(patsubst %.c,bin/%.o, $(SRC))
CFLAGS += -Iinclude -Isrc -std=c99
.PHONY: all
all: bin/libk.a
$(OBJ): bin/%.o : %.c
@mkdir -p $(@D)
$(CC) -c $(CFLAGS) -o $@ $<
bin/libk.a: $(OBJ)
@mkdir -p $(@D)
$(AR) rcs $@ $(OBJ)
clean:
rm -fr bin