-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.sh
85 lines (73 loc) · 2.14 KB
/
build.sh
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
#!/bin/bash
# 1. build 'pacman.js' by concatenating files specified in js_order
# 2. update time stamp in index.htm
# 3. build debug.htm with individual script includes
output="pacman.js"
debug_includes="\n"
# write header
echo "
// Copyright 2012 Shaun Williams
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License Version 3 as
// published by the Free Software Foundation.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// ==========================================================================
// PAC-MAN
// an accurate remake of the original arcade game
// Based on original works by Namco, GCC, and Midway.
// Research by Jamey Pittman and Bart Grantham
// Developed by Shaun Williams
// ==========================================================================
(function(){
" > $output
for file in \
inherit.js \
random.js \
game.js \
direction.js \
Map.js \
colors.js \
mapgen.js \
atlas.js \
renderers.js \
hud.js \
galagaStars.js \
Button.js \
Menu.js \
inGameMenu.js \
sprites.js \
Actor.js \
Ghost.js \
Player.js \
actors.js \
targets.js \
ghostCommander.js \
ghostReleaser.js \
elroyTimer.js \
energizer.js \
fruit.js \
executive.js \
states.js \
input.js \
cutscenes.js \
maps.js \
vcr.js \
main.js
do
# points firebug to correct file (or so I hoped)
# if JSOPTION_ATLINE is set, this should work in firefox (but I don't know how to set it)
echo "//@line 1 \"src/$file\"" >> $output
# concatenate file to output
cat src/$file >> $output
# add this file to debug includes
debug_includes="$debug_includes<script src=\"src/$file\"></script>\n"
done
# end anonymous function wrapper
echo "})();" >> $output
# build debug.htm from index.htm adding debug includes
sed "s:.*$output.*:$debug_includes:" index.htm > debug.htm