CC=gcc ifeq ($(shell uname),Darwin) CFLAGS=-Wall -lraylib -lm -lpthread -ldl -lX11 else CFLAGS=-Wall -lraylib -lGL -lm -lpthread -ldl -lrt -lX11 endif .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