summaryrefslogtreecommitdiff
path: root/build-js.sh
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2016-04-24 09:04:34 -0700
committerAlon Zakai <alonzakai@gmail.com>2016-04-24 09:04:34 -0700
commite9349f082af7d3057aa475a76a58cba7adac2b21 (patch)
tree543c409e2256ac6c11bc08cb466c052da939a2d3 /build-js.sh
parenta493b1dfcfbac5165beed3e05891fd467dd4da25 (diff)
downloadbinaryen-e9349f082af7d3057aa475a76a58cba7adac2b21.tar.gz
binaryen-e9349f082af7d3057aa475a76a58cba7adac2b21.tar.bz2
binaryen-e9349f082af7d3057aa475a76a58cba7adac2b21.zip
build cleanups (#385)
Diffstat (limited to 'build-js.sh')
-rwxr-xr-xbuild-js.sh14
1 files changed, 14 insertions, 0 deletions
diff --git a/build-js.sh b/build-js.sh
new file mode 100755
index 000000000..dc3ec3326
--- /dev/null
+++ b/build-js.sh
@@ -0,0 +1,14 @@
+#
+# This file builds the js components using emscripten. You normally don't need
+# to run this, as the builds are bundled in the repo in bin/. Running this is
+# useful if you are a developer and want to update those builds.
+#
+
+echo "building wasm.js"
+
+em++ -std=c++11 src/wasm-js.cpp src/pass.cpp src/passes/MergeBlocks.cpp src/passes/Print.cpp src/passes/OptimizeInstructions.cpp src/passes/RemoveUnusedBrs.cpp src/passes/RemoveUnusedNames.cpp src/passes/PostEmscripten.cpp src/passes/SimplifyLocals.cpp src/passes/ReorderLocals.cpp src/passes/Vacuum.cpp src/emscripten-optimizer/parser.cpp src/emscripten-optimizer/simple_ast.cpp src/emscripten-optimizer/optimizer-shared.cpp src/support/colors.cpp src/support/safe_integer.cpp src/support/bits.cpp src/support/threads.cpp -Isrc/ -o bin/wasm.js -s MODULARIZE=1 -s 'EXPORT_NAME="WasmJS"' --memory-init-file 0 -Oz -s ALLOW_MEMORY_GROWTH=1 -profiling -s DEMANGLE_SUPPORT=1 #-DWASM_JS_DEBUG -DWASM_INTERPRETER_DEBUG=2
+
+echo "building binaryen.js"
+
+python ~/Dev/emscripten/tools/webidl_binder.py src/js/binaryen.idl glue
+em++ -std=c++11 src/binaryen-js.cpp src/pass.cpp src/passes/MergeBlocks.cpp src/passes/Print.cpp src/passes/RemoveUnusedBrs.cpp src/passes/RemoveUnusedNames.cpp src/passes/PostEmscripten.cpp src/passes/SimplifyLocals.cpp src/passes/ReorderLocals.cpp src/passes/Vacuum.cpp src/emscripten-optimizer/parser.cpp src/emscripten-optimizer/simple_ast.cpp src/emscripten-optimizer/optimizer-shared.cpp src/support/colors.cpp src/support/safe_integer.cpp src/support/bits.cpp -Isrc/ -o bin/binaryen.js -s MODULARIZE=1 -s 'EXPORT_NAME="Binaryen"' --memory-init-file 0 -Oz -s ALLOW_MEMORY_GROWTH=1 -profiling -s DEMANGLE_SUPPORT=1 -s INVOKE_RUN=0 --post-js glue.js