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)
|
2023-05-06 02:28:23 +00:00
|
|
|
$(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
|
2023-04-24 18:41:46 +00:00
|
|
|
|
|
|
|
$(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)
|