mirror of https://github.com/pyodide/pyodide.git
parent
b4a4249278
commit
983f83ba1d
4
Makefile
4
Makefile
|
@ -145,9 +145,6 @@ dist/pyodide.d.ts dist/pyodide/ffi.d.ts: src/js/*.ts src/js/pyproxy.gen.ts src/j
|
|||
src/js/error_handling.gen.ts : src/core/error_handling.ts
|
||||
cp $< $@
|
||||
|
||||
%.wasm.gen.js: %.wat
|
||||
node tools/assemble_wat.js $@
|
||||
|
||||
src/js/pyproxy.gen.ts : src/core/pyproxy.* src/core/*.h
|
||||
# We can't input pyproxy.js directly because CC will be unhappy about the file
|
||||
# extension. Instead cat it and have CC read from stdin.
|
||||
|
@ -225,6 +222,7 @@ benchmark: all
|
|||
clean:
|
||||
rm -fr dist/*
|
||||
rm -fr src/*/*.o
|
||||
rm -fr src/*/*.gen.*
|
||||
rm -fr node_modules
|
||||
make -C packages clean
|
||||
echo "The Emsdk, CPython are not cleaned. cd into those directories to do so."
|
||||
|
|
|
@ -1,29 +0,0 @@
|
|||
const fs = require("fs");
|
||||
const { execFileSync } = require("child_process");
|
||||
|
||||
process.argv[2].split();
|
||||
|
||||
const path = process.argv[2].split("/");
|
||||
const filename = path.pop().split(".")[0];
|
||||
process.chdir(path.join("/"));
|
||||
|
||||
try {
|
||||
execFileSync("wat2wasms", [filename + ".wat", "--enable-all"]);
|
||||
} catch (e) {
|
||||
if (e.code === "ENOENT") {
|
||||
process.stderr.write(
|
||||
"assemble_wat.js: wat2wasm is not on path. " +
|
||||
"Please install the WebAssembly Binary Toolkit.\n",
|
||||
);
|
||||
process.stderr.write("Quitting.\n");
|
||||
process.exit(1);
|
||||
}
|
||||
throw e;
|
||||
}
|
||||
|
||||
const f = fs.readFileSync(filename + ".wasm");
|
||||
fs.unlinkSync(filename + ".wasm");
|
||||
|
||||
const s = Array.from(f, (x) => x.toString(16).padStart(2, "0")).join("");
|
||||
const output = `const ${filename}_wasm = decodeHexString("${s}");`;
|
||||
fs.writeFileSync(filename + ".wasm.gen.js", output);
|
Loading…
Reference in New Issue