starship/Makefile
2025-03-08 13:22:05 -05:00

72 lines
2.0 KiB
Makefile

CC=gcc
CFLAGS=-Wall -lraylib -lm -lpthread -ldl -lX11
WIN_CC=x86_64-w64-mingw32-gcc
WIN_LIB=-Llib -Iinclude -Wall -lraylib -lopengl32 -lgdi32 -lwinmm -lcomdlg32 -lole32
WIN_CFLAGS=-Wall -lraylib -lm -lpthread
TILED=~/app/tiled
GAME=starship_futuretime
BUTLER=../butler/butler
ITCH_CHANNEL=starship_futuretime
ITCH_CHANNEL_LINUX=linux-x64
ITCH_CHANNEL_WINDOWS=windows-x64
ITCH_CHANNEL_MAC=mac
.PHONY: clean run butler_upload build_levels
run: $(GAME)_linux build_levels
SKIP_INTRO=1 ./$(GAME)_linux
debug: $(GAME)_linux_dbg
SKIP_INTRO=1 gdb ./$(GAME)_linux
in_level_files := $(wildcard levels/*.tmx)
out_level_files := $(foreach a, $(in_level_files), $(basename $(a)).csv)
build_levels: $(in_level_files) $(out_level_files)
levels/%.csv: levels/%.tmx tilesets/*.tsx
$(TILED) --export-map $< $@
$(GAME)_linux: *.c
$(CC) *.c $(CFLAGS) -o $(GAME)_linux
$(GAME)_linux_dbg: *.c
$(CC) *.c -g $(CFLAGS) -o $(GAME)_linux
$(GAME)_windows.exe: *.c
$(WIN_CC) *.c $(WIN_LIB) $(WIN_CFLAGS) -o $(GAME)_windows.exe
$(GAME)_mac: *.c
$(CC) *.c $(CFLAGS) -o $(GAME)_mac
clean:
rm -f ./$(GAME)_linux
rm -f ./$(GAME)_linux.zip
rm -f ./$(GAME)_windows.exe
rm -f ./$(GAME)_windows.zip
rm -f ./$(GAME)_mac
rm -f ./$(GAME)_mac.zip
rm -f ./levels/*.csv
$(GAME)_linux.zip: $(GAME)_linux
rm -f ./$(GAME)_linux.zip
zip -r $(GAME)_linux.zip $(GAME)_linux COPYING img/*.png img/LICENSE
$(GAME)_windows.zip: $(GAME)_windows.exe
rm -f ./$(GAME)_windows.zip
zip -r $(GAME)_windows.zip $(GAME)_windows.exe COPYING img/*.png img/LICENSE
$(GAME)_mac.zip: $(GAME)_mac
rm -f ./$(GAME)_mac.zip
zip -r $(GAME)_mac.zip $(GAME)_mac COPYING img/*.png img/LICENSE
butler_upload: $(GAME)_linux.zip $(GAME)_windows.zip
$(BUTLER) push ./$(GAME)_linux.zip bassguitarbill/$(ITCH_CHANNEL):$(ITCH_CHANNEL_LINUX)
$(BUTLER) push ./$(GAME)_windows.zip bassguitarbill/$(ITCH_CHANNEL):$(ITCH_CHANNEL_WINDOWS)
butler_upload_mac: $(GAME)_mac.zip
$(BUTLER) push ./$(GAME)_mac.zip bassguitarbill/$(ITCH_CHANNEL):$(ITCH_CHANNEL_MAC)