-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathMakefile
66 lines (48 loc) · 1.51 KB
/
Makefile
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
# Download and install `butler` first, and run `butler login` before you run this
#
# Add a Makefile at ${project}/Makefile, and define:
#
# name of the .p8 itself
# name = hello_world
#
# where to deploy the game
# itchio = user/game
# name of the folder containing the .p8
project = project
include ${project}/Makefile
# path to the pico8 executable
pico8 = PATH_TO_PICO_EXECUTABLE
fullname = ${project}/${name}
all: web bin
deploy: deploy_all
deploy_all: deploy_web deploy_os
deploy_web: web
butler push ${fullname}.zip ${itchio}:web
deploy_os: deploy_linux deploy_mac deploy_windows
deploy_linux: bin
butler push ${fullname}.bin/${name}_linux.zip ${itchio}:linux
deploy_mac: bin
butler push ${fullname}.bin/${name}_osx.zip ${itchio}:mac
deploy_windows: bin
butler push ${fullname}.bin/${name}_windows.zip ${itchio}:windows
web: check_label clean_web
${pico8} ${fullname}.p8 -export ${name}.html
mv ${name}.html ${project}/index.html
mv ${name}.js ${project}/
cd ${project} && zip ${name}.zip index.html ${name}.js
cd ${project} && rm -r ${name}.js index.html
bin: check_label clean_bin
${pico8} ${fullname}.p8 -export ${name}.bin
mv ${name}.bin ${fullname}.bin
clean: clean_web clean_bin
clean_web:
rm -f ${fullname}.zip
rm -f ${project}/*.js
rm -f ${project}/*.html
clean_bin:
rm -rf ${fullname}.bin
check_label:
grep -q __label__ ${fullname}.p8
count:
wc -m ${name}/*lua
.PHONY: all deploy deploy_all deploy_web deploy_os deploy_linux deploy_mac deploy_windows web clean clean_web clean_bin check_label count