tlang-c/tlang/Makefile

23 lines
689 B
Makefile
Raw Normal View History

2023-04-24 18:41:46 +00:00
CC :=gcc
AR := ar
CFLAGS := -Wall -g
target := tlang
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)
$(CC) -o $(target) $(CFLAGS) -L../libtlang $(tlang_c_object_files) -ltlang -lpthread -lSDL2 -lSDL2_gfx -lSDL2_image -lSDL2_mixer -lSDL2_ttf -lm
$(tlang_c_object_files): build/%.o : src/%.c
mkdir -p $(dir $@) && \
$(CC) $(CFLAGS) -c -I../libtlang/include $(patsubst build/%.o, src/%.c, $@) -o $@
.PHONY: clean
.PHONY: install
install: $(target)
rm /usr/local/bin/tlang > /dev/null; true
cp $(target) /usr/local/bin/tlang
clean:
rm -rf build; rm $(target)