-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMakefile
54 lines (42 loc) · 1.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
EMCC_OPTS:=-O1 -s LINKABLE=1 -s ASM_JS=0
OGG_URL:="http://downloads.xiph.org/releases/ogg/libogg-1.3.1.tar.gz"
VORBIS_URL:="http://downloads.xiph.org/releases/vorbis/libvorbis-1.3.3.tar.gz"
CLOSCOMP_URL:=''
VORBIS:=libvorbis-1.3.3
OGG:=libogg-1.3.1
all: dist/libvorbis.min.js
dist/libvorbis.js: $(OGG) $(VORBIS) pre.js post.js
emcc $(EMCC_OPTS) --pre-js pre.js --post-js post.js $(OGG)/install/lib/libogg.a $(VORBIS)/lib/.libs/libvorbis.a $(VORBIS)/lib/.libs/libvorbisenc.a -o $@
dist/libvorbis.min.js: dist/libvorbis.js closcomp
java -jar closcomp/compiler.jar $< --language_in ECMASCRIPT5 --js_output_file $@
closcomp: closcomp.tar.gz
mkdir $@ && \
cd $@ && \
tar xzvf ../[email protected]
closcomp.tar.gz:
test -e "$@" || wget -O closcomp.tar.gz http://closure-compiler.googlecode.com/files/compiler-20131014.tar.gz
$(VORBIS): $(VORBIS).tar.gz
tar xzvf [email protected] && \
cd $@ && \
echo sed -i "" '''s/as_fn_error $$? "Ogg >= 1.0/echo "Ogg >= 1.0/g''' && \
sed -i "" 's/as_fn_error $$? "Ogg >= 1.0/echo "Ogg >= 1.0/g' configure && \
sed -i "" "s/-O20/-O2/g" configure && \
sed -i "" "s/-O4/-O3/g" configure && \
emconfigure ./configure --build=x86_64 --disable-oggtest --with-ogg-includes=`pwd`/../$(OGG)/install/include/ --with-ogg-libraries=`pwd`/../$(OGG)/install/lib/ && \
emmake make
$(OGG): $(OGG).tar.gz
tar xzvf [email protected] && \
cd $@ && \
sed -i "" "s/-O20/-O2/g" configure && \
sed -i "" "s/-O4/-O3/g" configure && \
emconfigure ./configure --prefix=`pwd`/install && \
emmake make && \
emmake make install
$(OGG).tar.gz:
test -e "$@" || wget $(OGG_URL)
$(VORBIS).tar.gz:
test -e "$@" || wget $(VORBIS_URL)
clean:
$(RM) -rf $(VORBIS) $(OGG)
distclean: clean
$(RM) $(VORBIS).tar.gz $(OGG).tar.gz