thrive/01_text_adventure/Makefile

23 lines
560 B
Makefile

CC=gcc
CFLAGS=-Wall -lraylib -lm -lpthread -ldl -lX11
.PHONY: clean run
fatal_text_adventure_linux: data/actions.c data/rooms.c data/room_ins.c data/words.c data/flags.c data/items.c *.c
$(CC) *.c $(CFLAGS) -o fatal_text_adventure_linux
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: fatal_text_adventure_linux
./fatal_text_adventure_linux
clean:
rm -f ./fatal_text_adventure_linux
rm -f ./data/*.c