forked from bvibber/ogv.js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
375 lines (317 loc) · 14.6 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
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
VERSION:=1.0
BUILDDATE:=$(shell date -u "+%Y%m%d%H%M%S")
HASH:=$(shell git rev-parse --short HEAD)
FULLVER:=$(VERSION)-$(BUILDDATE)-$(HASH)
.FAKE : all clean cleanswf swf js demo democlean tests dist jshint
all : js \
demo \
tests
js : build/ogv.js \
build/ogv-version.js \
build/ogv-support.js
demo : build/demo/index.html
tests : build/tests/index.html
democlean:
rm -rf build/demo
clean:
rm -rf build
rm -rf dist
rm -f libogg/configure
rm -f libvorbis/configure
rm -f libtheora/configure
rm -f libopus/configure
rm -f libskeleton/configure
rm -f libnestegg/configure
dist: js src/dynamicaudio.swf readme.md COPYING
rm -rf dist
mkdir dist
mkdir dist/ogvjs-$(VERSION)
cp -p build/ogv.js \
build/ogv-demuxer-ogg.js \
build/ogv-demuxer-webm.js \
build/ogv-decoder-audio-opus.js \
build/ogv-decoder-audio-vorbis.js \
build/ogv-decoder-video-theora.js \
build/ogv-decoder-video-vp8.js \
build/ogv-support.js \
build/ogv-version.js \
build/ogv-worker-audio.js \
build/ogv-worker-video.js \
src/dynamicaudio.swf \
readme.md \
COPYING \
dist/ogvjs-$(VERSION)/
cp -p libogg/COPYING dist/ogvjs-$(VERSION)/COPYING-ogg.txt
cp -p libvorbis/COPYING dist/ogvjs-$(VERSION)/COPYING-vorbis.txt
cp -p libtheora/COPYING dist/ogvjs-$(VERSION)/COPYING-theora.txt
cp -p libopus/COPYING dist/ogvjs-$(VERSION)/COPYING-opus.txt
cp -p libnestegg/LICENSE dist/ogvjs-$(VERSION)/LICENSE-nestegg.txt
cp -p libvpx/LICENSE dist/ogvjs-$(VERSION)/LICENSE-vpx.txt
cp -p libvpx/PATENTS dist/ogvjs-$(VERSION)/PATENTS-vpx.txt
(cd dist && zip -r ogvjs-$(VERSION).zip ogvjs-$(VERSION))
build/js/root/lib/libogg.a : configureOgg.sh compileOggJs.sh
test -d build || mkdir build
./configureOgg.sh
./compileOggJs.sh
build/js/root/lib/liboggz.a : build/js/root/lib/libogg.a configureOggz.sh compileOggzJs.sh
test -d build || mkdir build
./configureOggz.sh
./compileOggzJs.sh
build/js/root/lib/libvorbis.a : build/js/root/lib/libogg.a configureVorbis.sh compileVorbisJs.sh
test -d build || mkdir build
./configureVorbis.sh
./compileVorbisJs.sh
build/js/root/lib/libopus.a : build/js/root/lib/libogg.a configureOpus.sh compileOpusJs.sh
test -d build || mkdir build
./configureOpus.sh
./compileOpusJs.sh
build/js/root/lib/libskeleton.a : build/js/root/lib/libogg.a configureSkeleton.sh compileSkeletonJs.sh
test -d build || mkdir build
./configureSkeleton.sh
./compileSkeletonJs.sh
build/js/root/lib/libtheoradec.a : build/js/root/lib/libogg.a configureTheora.sh compileTheoraJs.sh
test -d build || mkdir build
./configureTheora.sh
./compileTheoraJs.sh
build/js/root/lib/libnestegg.a : configureNestEgg.sh compileNestEggJs.sh
test -d build || mkdir build
./configureNestEgg.sh
./compileNestEggJs.sh
build/js/root/lib/libvpx.a : configureVpx.sh compileVpxJs.sh
test -d build || mkdir build
./configureVpx.sh
./compileVpxJs.sh
build/ogv-demuxer-ogg.js : src/ogv-demuxer-ogg.c \
src/ogv-demuxer.h \
src/ogv-demuxer.js \
src/ogv-demuxer-callbacks.js \
src/ogv-demuxer-exports.json \
src/ogv-module-pre.js \
build/js/root/lib/libogg.a \
build/js/root/lib/liboggz.a \
build/js/root/lib/libskeleton.a \
compileOgvDemuxerOgg.sh
test -d build || mkdir build
./compileOgvDemuxerOgg.sh
build/ogv-demuxer-webm.js : src/ogv-demuxer-webm.c \
src/ogv-demuxer.h \
src/ogv-demuxer.js \
src/ogv-demuxer-callbacks.js \
src/ogv-demuxer-exports.json \
src/ogv-module-pre.js \
build/js/root/lib/libnestegg.a \
compileOgvDemuxerWebM.sh
test -d build || mkdir build
./compileOgvDemuxerWebM.sh
build/ogv-decoder-audio-vorbis.js : src/ogv-decoder-audio-vorbis.c \
src/ogv-decoder-audio.h \
src/ogv-decoder-audio.js \
src/ogv-decoder-audio-callbacks.js \
src/ogv-decoder-audio-exports.json \
src/ogv-module-pre.js \
build/js/root/lib/libogg.a \
build/js/root/lib/libvorbis.a \
compileOgvDecoderAudioVorbis.sh
test -d build || mkdir build
./compileOgvDecoderAudioVorbis.sh
build/ogv-decoder-audio-opus.js : src/ogv-decoder-audio-opus.c \
src/ogv-decoder-audio.h \
src/ogv-decoder-audio.js \
src/ogv-decoder-audio-callbacks.js \
src/ogv-decoder-audio-exports.json \
src/ogv-module-pre.js \
build/js/root/lib/libogg.a \
build/js/root/lib/libopus.a \
compileOgvDecoderAudioOpus.sh
test -d build || mkdir build
./compileOgvDecoderAudioOpus.sh
build/ogv-decoder-video-theora.js : src/ogv-decoder-video-theora.c \
src/ogv-decoder-video.h \
src/ogv-decoder-video.js \
src/ogv-decoder-video-callbacks.js \
src/ogv-decoder-video-exports.json \
src/ogv-module-pre.js \
build/js/root/lib/libogg.a \
build/js/root/lib/libtheoradec.a \
compileOgvDecoderVideoTheora.sh
test -d build || mkdir build
./compileOgvDecoderVideoTheora.sh
build/ogv-decoder-video-vp8.js : src/ogv-decoder-video-vp8.c \
src/ogv-decoder-video.h \
src/ogv-decoder-video.js \
src/ogv-decoder-video-callbacks.js \
src/ogv-decoder-video-exports.json \
src/ogv-module-pre.js \
build/js/root/lib/libogg.a \
build/js/root/lib/libvpx.a \
compileOgvDecoderVideoVP8.sh
test -d build || mkdir build
./compileOgvDecoderVideoVP8.sh
build/YCbCr-shaders.h : src/YCbCr.vsh src/YCbCr.fsh src/YCbCr-stripe.fsh file2def.js
test -d build || mkdir build
node file2def.js src/YCbCr.vsh YCBCR_VERTEX_SHADER > build/YCbCr-shaders.h
node file2def.js src/YCbCr.fsh YCBCR_FRAGMENT_SHADER >> build/YCbCr-shaders.h
node file2def.js src/YCbCr-stripe.fsh YCBCR_STRIPE_FRAGMENT_SHADER >> build/YCbCr-shaders.h
build/FrameSink.js : src/FrameSink.js.in src/YCbCr.js
test -d build || mkdir build
cpp -E -w -P -CC -nostdinc -Ibuild src/FrameSink.js.in > build/FrameSink.js
build/WebGLFrameSink.js : src/WebGLFrameSink.js.in build/YCbCr-shaders.h
cpp -E -w -P -CC -nostdinc -Ibuild src/WebGLFrameSink.js.in > build/WebGLFrameSink.js
build/ogv.js : src/ogv.js.in \
src/OGVLoader.js \
src/StreamFile.js \
src/AudioFeeder.js \
build/FrameSink.js \
build/WebGLFrameSink.js \
src/Bisector.js \
src/OGVMediaType.js \
src/OGVWrapperCodec.js \
src/OGVProxyClass.js \
src/OGVDecoderAudioProxy.js \
src/OGVDecoderVideoProxy.js \
src/OGVPlayer.js \
build/ogv-demuxer-ogg.js \
build/ogv-demuxer-webm.js \
build/ogv-decoder-audio-opus.js \
build/ogv-decoder-audio-vorbis.js \
build/ogv-decoder-video-theora.js \
build/ogv-decoder-video-vp8.js \
src/dynamicaudio.swf \
build/ogv-worker-audio.js \
build/ogv-worker-video.js
cpp -E -w -P -CC -nostdinc -Ibuild src/ogv.js.in > build/ogv.js
echo 'this.OGVVersion = "$(FULLVER)";' >> build/ogv.js
build/ogv-support.js : src/ogv-support.js.in \
src/BogoSlow.js \
src/OGVCompat.js \
build/ogv.js
cpp -E -w -P -CC -nostdinc -Ibuild src/ogv-support.js.in > build/ogv-support.js
echo 'this.OGVVersion = "$(FULLVER)";' >> build/ogv-support.js
build/ogv-version.js : build/ogv.js
echo 'this.OGVVersion = "$(FULLVER)";' > build/ogv-version.js
build/ogv-worker-audio.js : src/OGVLoader.js \
src/OGVWorkerSupport.js \
src/OGVWorkerAudio.js \
build/ogv-version.js
cat src/OGVLoader.js \
src/OGVWorkerSupport.js \
src/OGVWorkerAudio.js \
build/ogv-version.js \
> build/ogv-worker-audio.js
build/ogv-worker-video.js : src/OGVLoader.js \
src/OGVWorkerSupport.js \
src/OGVWorkerVideo.js \
build/ogv-version.js
cat src/OGVLoader.js \
src/OGVWorkerSupport.js \
src/OGVWorkerVideo.js \
build/ogv-version.js \
> build/ogv-worker-video.js
# The player demo, with the JS build
build/demo/index.html : src/demo/index.html.in \
build/demo/demo.css \
build/demo/demo.js \
build/demo/iconfont.css \
build/demo/motd.js \
build/demo/benchmark.html \
build/demo/minimal.html \
build/demo/media/ehren-paper_lights-96.opus \
build/demo/media/pixel_aspect_ratio.ogg \
build/demo/media/curiosity.ogv \
build/demo/lib/ogv.js \
build/demo/lib/cortado.jar \
build/demo/lib/CortadoPlayer.js
test -d build/demo || mkdir -p build/demo
cpp -E -w -P -CC -nostdinc -DWITH_JS src/demo/index.html.in > build/demo/index.html
build/demo/demo.css : src/demo/demo.css
test -d build/demo || mkdir -p build/demo
cp src/demo/demo.css build/demo/demo.css
build/demo/demo.js : src/demo/demo.js
test -d build/demo || mkdir -p build/demo
cp src/demo/demo.js build/demo/demo.js
build/demo/iconfont.css : src/demo/iconfont.css
test -d build/demo || mkdir -p build/demo
cp src/demo/iconfont.css build/demo/iconfont.css
build/demo/motd.js : src/demo/motd.js
test -d build/demo || mkdir -p build/demo
cp src/demo/motd.js build/demo/motd.js
build/demo/benchmark.html : src/demo/benchmark.html
test -d build/demo || mkdir -p build/demo
cp src/demo/benchmark.html build/demo/benchmark.html
build/demo/minimal.html : src/demo/minimal.html
test -d build/demo || mkdir -p build/demo
cp src/demo/minimal.html build/demo/minimal.html
build/demo/media/ehren-paper_lights-96.opus : src/demo/media/ehren-paper_lights-96.opus
test -d build/demo/media || mkdir -p build/demo/media
cp src/demo/media/ehren-paper_lights-96.opus build/demo/media/ehren-paper_lights-96.opus
build/demo/media/pixel_aspect_ratio.ogg : src/demo/media/pixel_aspect_ratio.ogg
test -d build/demo/media || mkdir -p build/demo/media
cp src/demo/media/pixel_aspect_ratio.ogg build/demo/media/pixel_aspect_ratio.ogg
build/demo/media/curiosity.ogv : src/demo/media/curiosity.ogv
test -d build/demo/media || mkdir -p build/demo/media
cp src/demo/media/curiosity.ogv build/demo/media/curiosity.ogv
build/demo/lib/ogv.js : dist
test -d build/demo/lib || mkdir -p build/demo/lib
cp -pr dist/ogvjs-$(VERSION)/* build/demo/lib/
build/demo/lib/cortado.jar : src/cortado.jar
test -d build/demo/lib || mkdir -p build/demo/lib
cp src/cortado.jar build/demo/lib/cortado.jar
build/demo/lib/CortadoPlayer.js : src/CortadoPlayer.js
test -d build/demo/lib || mkdir -p build/demo/lib
cp src/CortadoPlayer.js build/demo/lib/CortadoPlayer.js
# QUnit test cases
build/tests/index.html : build/tests/tests.js \
build/tests/lib/ogv.js \
build/tests/media/1frame.ogv \
build/tests/media/3frames.ogv \
build/tests/media/1second.ogv \
build/tests/media/3seconds.ogv \
build/tests/media/3seconds-noskeleton.ogv \
build/tests/media/320x240.ogv \
src/tests/index.html
test -d build/tests || mkdir -p build/tests
cp src/tests/index.html build/tests/index.html
build/tests/tests.js : src/tests/tests.js
test -d build/tests || mkdir -p build/tests
cp src/tests/tests.js build/tests/tests.js
build/tests/lib/ogv.js : dist
test -d build/tests/lib || mkdir -p build/tests/lib
cp -pr dist/ogvjs-$(VERSION)/* build/tests/lib/
build/tests/media/1frame.ogv : src/tests/media/1frame.ogv
test -d build/tests/media || mkdir -p build/tests/media
cp src/tests/media/1frame.ogv build/tests/media/1frame.ogv
build/tests/media/3frames.ogv : src/tests/media/3frames.ogv
test -d build/tests/media || mkdir -p build/tests/media
cp src/tests/media/3frames.ogv build/tests/media/3frames.ogv
build/tests/media/1second.ogv : src/tests/media/1second.ogv
test -d build/tests/media || mkdir -p build/tests/media
cp src/tests/media/1second.ogv build/tests/media/1second.ogv
build/tests/media/3seconds.ogv : src/tests/media/3seconds.ogv
test -d build/tests/media || mkdir -p build/tests/media
cp src/tests/media/3seconds.ogv build/tests/media/3seconds.ogv
build/tests/media/3seconds-noskeleton.ogv : src/tests/media/3seconds-noskeleton.ogv
test -d build/tests/media || mkdir -p build/tests/media
cp src/tests/media/3seconds-noskeleton.ogv build/tests/media/3seconds-noskeleton.ogv
build/tests/media/320x240.ogv : src/tests/media/320x240.ogv
test -d build/tests/media || mkdir -p build/tests/media
cp src/tests/media/320x240.ogv build/tests/media/320x240.ogv
# There is a Flash shim for audio on Internet Explorer which doesn't
# have Web Audio API.
#
# The .swf build artifact is in the source tree so you don't have to
# figure out how to install the Apache Flex SDK when you've already
# gone to the trouble of setting up emscripten.
#
# Get SDK binaries from http://flex.apache.org/ and install them somewhere
# in your PATH.
#
# To rebuild the .swf, run 'make cleanswf' then 'make swf'
#
swf : src/dynamicaudio.swf
cleanswf:
rm -f src/dynamicaudio.swf
src/dynamicaudio.swf : src/dynamicaudio.as
mxmlc -o src/dynamicaudio.swf -file-specs src/dynamicaudio.as
# fixme move all this to grunt and modules
jshint : js
jshint src/*.js build/FrameSink.js build/WebGLFrameSink.js