summaryrefslogtreecommitdiff
path: root/emcc_to_wasm.js.sh
blob: c4c3a4bf33d23b6cb8e61797230f87f7aaf9ee2d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/bin/sh

set -e

echo "calling emcc"
emcc -o a.html --separate-asm -profiling -s TOTAL_MEMORY=67108864 -s GLOBAL_BASE=1024 -s ALIASING_FUNCTION_POINTERS=0 $@

# we now have a.asm.js and a.js

echo 'constructing a.normal.js' # just normal combination of the files. no wasm yet
cat src/templates/normal.js > a.normal.js
cat a.asm.js >> a.normal.js
cat a.js >> a.normal.js

echo 'constructing a.wasm.js' # use wasm polyfill in place of asm.js THIS IS NOT A DRILL
cp a.asm.js a.asm.code.js
cat src/templates/wasm.js > a.wasm.js
cat bin/wasm.js >> a.wasm.js
cat a.js >> a.wasm.js