tlang-c/libtlang/Makefile

18 lines
467 B
Makefile
Raw Normal View History

2023-04-24 18:41:46 +00:00
CC :=gcc
AR := ar
CFLAGS := -Wall -g -c
target := libtlang.a
tlang_c_source_files := $(shell find src/ -name *.c)
tlang_c_object_files := $(patsubst src/%.c, build/%.o, $(tlang_c_source_files))
$(target): $(tlang_c_object_files)
$(AR) -rcs $(target) $(tlang_c_object_files)
$(tlang_c_object_files): build/%.o : src/%.c
mkdir -p $(dir $@) && \
$(CC) $(CFLAGS) -I include $(patsubst build/%.o, src/%.c, $@) -o $@
.PHONY: clean
clean:
rm -rf build; rm $(target)