-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
120 lines (106 loc) · 3.69 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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
# Partially based off of:
# http://nefariousdesigns.co.uk/website-builds-using-make.html
js-target = scripts/build/hangoverx.js
js-target-min = scripts/build/hangoverx.min.js
js-modules = scripts/util.js \
scripts/_head.js \
scripts/game.js \
scripts/codeEditor.js \
scripts/display.js \
scripts/dynamicObject.js \
scripts/inventory.js \
scripts/map.js \
scripts/objects.js \
scripts/player.js \
scripts/reference.js \
scripts/sound.js \
scripts/validate.js \
scripts/ui.js \
levels/levels.js \
scripts/_launcher_release.js \
scripts/_tail.js
js-modules-debug = scripts/util.js \
scripts/_head.js \
scripts/game.js \
scripts/codeEditor.js \
scripts/display.js \
scripts/dynamicObject.js \
scripts/inventory.js \
scripts/map.js \
scripts/objects.js \
scripts/player.js \
scripts/reference.js \
scripts/sound.js \
scripts/validate.js \
scripts/ui.js \
levels/levels.js \
scripts/_launcher_debug.js \
scripts/_tail.js
yui-jar = tools/yuicompressor-2.4.8pre.jar
# `make` or `make debug` merges scripts (using debug launcher)
debug:
@echo "Building level file…\t\t\t\c"
@./compile_levels.sh
@echo "[ Done ]"
@echo "Merging JS files…\t\t\t\c"
@cat $(js-modules-debug) > $(js-target)
@echo "[ Done ]"
# `make release` merges and compresses scripts (using release launcher)
release:
@rm -f $(js-target-min)
@echo "Building level file…\t\t\t\c"
@./compile_levels.sh
@echo "[ Done ]"
@echo "Merging JS files…\t\t\t\c"
@cat $(js-modules) > $(js-target)
@echo "[ Done ]"
@echo "Compressing merged JS…\t\t\t\c"
@java -jar $(yui-jar) -o $(js-target-min) $(js-target)
@echo "[ Done ]"
# `make clean` removes built scripts
clean:
@rm -f $(js-target) $(js-target-min)
# to use `make deploy` to deploy HangoverX to your own server, create
# a deploy.sh script (ncftpput is helpful for uploading via FTP).
deploy: release
@echo "Deploying to server…\t\t\t\c"
@rm -rf _site
@mkdir _site
@cp -R levels scripts styles images sound index.html _site
@./deploy.sh /hangoverx _site
@rm -rf _site
@echo "[ Done ]"
# `make deploy-full` also deploys music and libs
deploy-full: release
@echo "Deploying to server…\t\t\t\c"
@rm -rf _site
@mkdir _site
@cp -R levels scripts styles images sound music lib index.html _site
@./deploy.sh /hangoverx _site
@rm -rf _site
@echo "[ Done ]"
# `make deploy-debug` deploys the debug version to /debug
deploy-debug: debug
@echo "Deploying to server…\t\t\t\c"
@rm -rf _site
@mkdir _site
@cp -R levels scripts styles images sound index.html _site
@./deploy.sh /hangoverx/debug _site
@rm -rf _site
@echo "[ Done ]"
# `make deploy-debug` deploys the debug version to /debug
deploy-debug-full: debug
@echo "Deploying to server…\t\t\t\c"
@rm -rf _site
@mkdir _site
@cp -R levels scripts styles images sound music lib index.html _site
@./deploy.sh /hangoverx/debug _site
@rm -rf _site
@echo "[ Done ]"
deploy-github:
@git checkout gh-pages && git rebase master && make release && git commit -am build && git push -uf origin gh-pages && git checkout master && make
# run-local will start a mini python webserver and host a local
# instance of the game on port 9001 (-c-1 disables caching)
runlocal: debug
@echo "Running local instance"
./node_modules/http-server/bin/http-server -p 9001 -c-1