20 lines
311 B
Makefile
20 lines
311 B
Makefile
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
|