summaryrefslogtreecommitdiff
path: root/emcc_to_wasm.js.sh
diff options
context:
space:
mode:
Diffstat (limited to 'emcc_to_wasm.js.sh')
-rwxr-xr-xemcc_to_wasm.js.sh20
1 files changed, 20 insertions, 0 deletions
diff --git a/emcc_to_wasm.js.sh b/emcc_to_wasm.js.sh
new file mode 100755
index 000000000..ac01b1638
--- /dev/null
+++ b/emcc_to_wasm.js.sh
@@ -0,0 +1,20 @@
+#!/bin/sh
+
+set -e
+
+echo "calling emcc"
+emcc -o a.html --separate-asm -profiling -s TOTAL_MEMORY=67108864 $@
+
+# 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
+