thrive/01_text_adventure/Makefile

23 lines
447 B
Makefile

CC=gcc
CFLAGS=-Wall -lraylib -lGL -lm -lpthread -ldl -lrt -lX11
.PHONY: clean run
game: data/actions.c data/rooms.c data/room_ins.c data/words.c data/flags.c *.c
$(CC) *.c $(CFLAGS) -o game
data/%.c: data/%.txt
echo "char *data_$*_txt = " > data/$*.c
cat data/$*.txt | \
perl -pe 's/ *\| */|/g' | \
perl -pe 's/^/"/' | \
perl -pe 's/$$/\\n"/' >> data/$*.c
echo ";" >> data/$*.c
run: game
./game
clean:
rm -f ./game
rm -f ./data/*.c