~technomancy/tremendous-quest-iv

tremendous-quest-iv/makefile -rw-r--r-- 2.4 KiB
a3c24536Phil Hagelberg Bump to Fennel 0.9.1; fix some bugs. 5 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
VERSION=0.1.0
NAME=tremendous-quest-iv
ITCH_ACCOUNT=technomancy
URL=https://technomancy.itch.io/tremendous-quest-iv
AUTHOR="Phil Hagelberg"
DESCRIPTION="Tremendous Quest IV is a megahit MMORPG! But you don't have time to play; you work in the QA department."

LIBS := $(shell find lib/ -type f) $(wildcard polywell/lib/*.lua) polywell/lib/fennelview.fnl
LUA := $(wildcard *.lua) polywell/old.lua polywell/frontend/love.lua polywell/frontend/init.lua
GAME := $(wildcard *.fnl) $(wildcard sandbox/*.fnl)
SRC := $(GAME) $(wildcard polywell/*fnl) $(wildcard polywell/lib/*fnl)
OUT := $(patsubst %.fnl,%.lua,$(SRC)) lib/stdio.lua

run: ; love .

count: ; cloc $(GAME)
clean: ; rm -rf releases/* $(OUT)
cleansrc: ; rm -rf $(OUT)

%.lua: %.fnl; lua polywell/lib/fennel --compile --metadata --correlate $< > $@

LOVEFILE=releases/$(NAME)-$(VERSION).love

$(LOVEFILE): $(SRC) $(LUA) $(OUT) $(LIBS) assets
	mkdir -p releases/
	find $^ -type f | LC_ALL=C sort | env TZ=UTC zip -r -q -9 -X $@ -@

love: $(LOVEFILE)

# platform-specific distributables

REL=$(PWD)/love-release.sh # https://p.hagelb.org/love-release.sh
FLAGS=-a "$(AUTHOR)" --description $(DESCRIPTION) \
	--love 11.2 --url $(URL) --version $(VERSION) --lovefile $(LOVEFILE)

releases/$(NAME)-$(VERSION)-x86_64.AppImage: $(LOVEFILE)
	cd appimage && ./build.sh 11.2 $(PWD)/$(LOVEFILE)
	mv appimage/game-x86_64.AppImage $@

LONGNAME="Tremendous-Quest-IV"

releases/$(NAME)-$(VERSION)-macos.zip: $(LOVEFILE)
	$(REL) $(FLAGS) -M
	mv "releases/$(LONGNAME)-macos.zip" $@

releases/$(NAME)-$(VERSION)-win.zip: $(LOVEFILE)
	$(REL) $(FLAGS) -W32
	mv "releases/$(LONGNAME)-win32.zip" $@

linux: releases/$(NAME)-$(VERSION)-x86_64.AppImage
mac: releases/$(NAME)-$(VERSION)-macos.zip
windows: releases/$(NAME)-$(VERSION)-win.zip

# If you release on itch.io, you should install butler:
# https://itch.io/docs/butler/installing.html

uploadlinux: releases/$(NAME)-$(VERSION)-x86_64.AppImage
	butler push $^ $(ITCH_ACCOUNT)/$(NAME):linux --userversion $(VERSION)
uploadmac: releases/$(NAME)-$(VERSION)-macos.zip
	butler push $^ $(ITCH_ACCOUNT)/$(NAME):mac --userversion $(VERSION)
uploadwindows: releases/$(NAME)-$(VERSION)-win.zip
	butler push $^ $(ITCH_ACCOUNT)/$(NAME):windows --userversion $(VERSION)

upload: uploadlinux uploadmac uploadwindows

release: linux mac windows upload cleansrc

gif: ; byzanz-record -w 640 -h 400 -d 3 out.gif

.PHONY: run count clean cleansrc love linux mac windows \
	uploadlinux uploadmac uploadwindows upload release gif