-
Notifications
You must be signed in to change notification settings - Fork 7
/
Makefile
64 lines (51 loc) · 2.1 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
##########################################
# Skeleton Jigsaw
# http://plaev.github.com
##########################################
NAME = game.min
# Google Closure Compiler Options
GCC_OPTION = --jscomp_off=internetExplorerChecks
#--compilation_level ADVANCED_OPTIMIZATIONS
publish: unify prepare copy update-git
@echo " ----> Done!"
optimize-media:
@echo " ----> Preparing repository"
@if test -f /usr/bin/pngout; then \
for i in `ls media/*.png`; do pngout $$i 2>&1 > /dev/null; done \
fi
update-git:
@echo " ----> Updating git"
@cd production && git checkout gh-pages && git commit -am "Updating skeleton jigsaw version" && [[ ! -f config.ru ]]; git push && cd ..
@git checkout index.html media
copy:
@echo " ----> Copying to production repository"
@cp -R index.html game.min.js analytics.js media/ production/
# Prepare impact to use on plaev games
impact:
if test -d /Applications; then \
sed -i '' 's/\.php//g' lib/weltmeister/config.js; \
sed -i '' 's/cd \.\.//g' tools/bake.sh; \
else \
sed -i 's/\.php//g' lib/weltmeister/config.js; \
sed -i 's/cd \.\.//g' tools/bake.sh; \
fi
unify:
@echo " ----> Unifying!"
@./tools/bake.sh > /dev/null
prepare:
@echo " ----> Preparing HTML"
@if test -d /Applications; then \
sed -i '' 's/<script type="text\/javascript" src="lib\/impact\/impact.js"><\/script>//g' index.html; \
sed -i '' 's/<script type="text\/javascript" src="lib\/game\/main.js"><\/script>//g' index.html; \
sed -i '' 's/<!-- <script type="text\/javascript" src="game.min.js"><\/script> -->/<script type="text\/javascript" src="game.min.js"><\/script>/g' index.html; \
else \
sed -i 's/<script type="text\/javascript" src="lib\/impact\/impact.js"><\/script>//g' index.html;\
sed -i 's/<script type="text\/javascript" src="lib\/game\/main.js"><\/script>//g' index.html;\
sed -i 's/<!-- <script type="text\/javascript" src="game.min.js"><\/script> -->/<script type="text\/javascript" src="game.min.js"><\/script>/g' index.html;\
fi
check:
find lib/game -name "*.js" -exec jshint {} \;
update:
git add production
git commit -m "Updating skeleton jigsaw production version"
git push