23 lines
736 B
Makefile
23 lines
736 B
Makefile
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 -lmbedtls -lmbedx509 -lmbedcrypto -lpng -ljpeg -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)
|