-
Notifications
You must be signed in to change notification settings - Fork 51
/
Copy pathMakefile
137 lines (117 loc) · 4.98 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
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
.PHONY: all clean cleaner deploy-www
LIBS_MIN = lib/evento/evento-min.js \
lib/hijos/hijos-min.js \
lib/arbutus/arbutus-min.js \
lib/grail/grail-min.js \
lib/hormigas/hormigas-min.js
LIBS = lib/evento/evento.js \
lib/hijos/hijos.js \
lib/arbutus/arbutus.js \
lib/grail/grail.js \
lib/hormigas/hormigas.js
SRCS = src/header.js \
src/namespace.js \
src/capitalize.js \
src/trim.js \
src/some.js \
src/create.js \
src/borrow.js \
src/subclass.js \
src/borrowEvento.js \
src/borrowHijos.js \
src/borrowGrail.js \
src/Model.js \
src/SetModel.js \
src/View.js \
src/ElementView.js \
src/SetView.js \
src/Controller.js \
src/Model.subclass.js \
src/SetModel.subclass.js \
src/View.subclass.js \
src/ElementView.subclass.js \
src/SetView.subclass.js \
src/Controller.subclass.js
all: build/dist build/dist/maria-min.js build/www
build/dist: build/dist/README.md build/dist/CHANGES.md build/dist/LICENSE build/dist/maria.js build/dist/maria-min.js
build/dist/README.md: README.md
mkdir -p build/dist
cp README.md build/dist/README.md
build/dist/CHANGES.md: CHANGES.md
mkdir -p build/dist
cp CHANGES.md build/dist/CHANGES.md
build/dist/LICENSE: LICENSE
mkdir -p build/dist
cp LICENSE build/dist/LICENSE
tmp/maria-raw.js: $(LIBS) $(SRCS)
mkdir -p build/dist tmp
cat $(LIBS) $(SRCS) >tmp/maria-raw.js
build/dist/maria-debug.js: tmp/maria-raw.js
mkdir -p build/dist
echo "var maria = (function () { // IIFE" > build/dist/maria-debug.js
cat tmp/maria-raw.js >> build/dist/maria-debug.js
echo "\nreturn maria;}()); // IIFE" >> build/dist/maria-debug.js
gzip --best -c build/dist/maria-debug.js > build/dist/maria-debug.js.gz
build/dist/maria.js: build/dist/maria-debug.js
bin/strip-debugging-code build/dist/maria-debug.js > build/dist/maria.js
gzip --best -c build/dist/maria.js > build/dist/maria.js.gz
build/dist/maria-min.js: build/dist/maria.js lib/compiler
mkdir -p build/dist tmp
cd build/dist && java -jar ../../lib/compiler/compiler.jar --js maria.js --js_output_file maria-min.js --create_source_map maria-min.map --source_map_format V3
echo "/*\n//@ sourceMappingURL=maria-min.map\n*/\n" >> build/dist/maria-min.js
gzip --best -c build/dist/maria-min.js > build/dist/maria-min.js.gz
deploy-www: build/www
scp -r build/www/* [email protected]:~/sites/maria
build/www: build/www/eg build/www/api doc/* doc/*/* doc/*/*/* doc/*/*/* doc/*/*/*/* doc/*/*/*/*/*
mkdir -p build/www
touch build/www
cp -R doc/* build/www
# Need to make the file tmp/maria.js as the input source code used by JSDoc
# for three reasons:
#
# The real build/dist/maria.js is wrapped in an IIFE and using that file as the source
# that JSDoc processes makes JSDoc unable to produce HTML documentation with
# the appropriate filenames. For example, the filename for maria.Controller documentation
# ends up being 5a25124d2e.html.
#
# We cannot use tmp/maria-raw.js as the source file processed by JSDoc because an extra
# line is needed at the top of the file. This is the line that is used in
# build/dist/maria.js for the IIFE. At least an empty line is needed here so that line
# numbers in the documentation match the distribution built code.
#
# The file needs to be named "maria.js" so that the built documentation says "maria.js"
# rather than "maria-raw.js" or something else that is not the name of the real file
# that is distributed.
#
build/www/api: tmp/maria-raw.js lib/jsdoc
mkdir -p build/www
rm -f tmp/maria.js
echo "" > tmp/maria.js
cat tmp/maria-raw.js >> tmp/maria.js
rm -rf build/www/api
lib/jsdoc/jsdoc tmp/maria.js --destination build/www/api --configure etc/jsdoc-config.js
build/www/eg: build/dist/maria.js eg/* eg/*/* eg/*/*/* eg/*/*/* eg/*/*/*/* eg/*/*/*/*/*
mkdir -p build/www
rm -rf build/www/eg
mkdir -p build/www/eg
bin/build-example checkit
bin/build-example scrollit
bin/build-example timeit
lib/compiler:
mkdir -p tmp/compiler
cd tmp/compiler && \
curl -O http://dl.google.com/closure-compiler/compiler-latest.zip && \
unzip compiler-latest.zip
mkdir -p lib/compiler
mv tmp/compiler/compiler.jar lib/compiler
lib/jsdoc:
mkdir -p tmp/jsdoc
cd tmp/jsdoc && \
curl https://codeload.github.com/jsdoc3/jsdoc/tar.gz/v3.1.1 --output jsdoc-3.1.1.tar.gz && \
tar xvzf jsdoc-3.1.1.tar.gz
mkdir -p lib
mv tmp/jsdoc/jsdoc-3.1.1 lib/jsdoc
clean:
rm -rf build tmp
cleaner: clean
rm -rf lib/compiler lib/jsdoc