qments/Makefile

24 lines
405 B
Makefile
Raw Normal View History

2023-06-15 01:44:02 +03:00
TARGET_LIB ?= libqments.a
BD ?= build
SRC_DIRS ?= src
INCLUDE_DIRS ?= include
SRC_FILES := $(shell find $(SRC_DIRS) -name *.c)
OBJ_FILES := $(patsubst %.c,$(BD)/%.o,$(SRC_FILES))
$(BD)/$(TARGET_LIB): $(OBJ_FILES)
mkdir -p $(@D)
ar rcs $@ $(OBJ_FILES)
$(BD)/%.o: %.c
mkdir -p $(@D)
$(CC) $(CFLAGS) -c $< -o $@ -I $(INCLUDE_DIRS)
all: $(BD)/$(TARGET_LIB)
clean:
rm -rfI $(BD)/
.PHONY: all clean