thrive/01_text_adventure/Makefile

46 lines
1.2 KiB
Makefile
Raw Normal View History

2025-01-02 20:57:00 -05:00
CC=gcc
2025-01-21 19:58:04 -05:00
CFLAGS=-Wall -lraylib -lm -lpthread -ldl -lX11
2025-01-24 05:46:40 -05:00
WIN_CC=x86_64-w64-mingw32-gcc
WIN_LIB=-L../lib -I../include -Wall -lraylib -lopengl32 -lgdi32 -lwinmm -lcomdlg32 -lole32
WIN_CFLAGS=-Wall -lraylib -lm -lpthread
GAME=fatal_text_adventure
DATA_C=data/actions.c data/rooms.c data/room_ins.c data/words.c data/flags.c data/items.c
2025-01-23 21:01:08 -05:00
BUTLER=../butler/butler
2025-01-24 05:46:40 -05:00
ITCH_CHANNEL=01-text-adventure
ITCH_CHANNEL_LINUX=$(ITCH_CHANNEL)-linux-x64
ITCH_CHANNEL_WINDOWS=$(ITCH_CHANNEL)-windows-x64
2024-08-28 17:27:35 -04:00
2025-01-23 21:01:08 -05:00
.PHONY: clean run butler_upload
2025-01-02 20:57:00 -05:00
2025-01-24 05:46:40 -05:00
$(GAME)_linux: $(DATA_C) *.c
$(CC) *.c $(CFLAGS) -o $(GAME)_linux
$(GAME)_windows.exe: $(DATA_C) *.c
$(WIN_CC) *.c $(WIN_LIB) $(WIN_CFLAGS) -o $(GAME)_windows.exe
2025-01-02 20:57:00 -05:00
2025-01-12 19:50:11 -05:00
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
2025-01-24 05:46:40 -05:00
run: $(GAME)_linux
./$(GAME)_linux
run_win: $(GAME)_windows.exe
wine $(GAME)_windows.exe
2024-08-28 17:27:35 -04:00
clean:
2025-01-24 05:46:40 -05:00
rm -f ./$(GAME)_linux
rm -f ./$(GAME)_windows.exe
rm -f ./data/*.c
2025-01-23 21:01:08 -05:00
2025-01-24 05:46:40 -05:00
butler_upload: $(GAME)_linux $(GAME)_windows
$(BUTLER) push ./$(GAME)_linux bassguitarbill/fatal-distractions:$(ITCH_CHANNEL_LINUX)
$(BUTLER) push ./$(GAME)_windows.exe bassguitarbill/fatal-distractions:$(ITCH_CHANNEL_WINDOWS)