waforth2c: Remove binaryen dependency.

Requires wabt > 1.0.10
This commit is contained in:
Remko Tronçon 2019-03-09 13:25:45 +01:00
parent a03f8a5fbc
commit ac79104e20
2 changed files with 1 additions and 8 deletions

View file

@ -38,10 +38,6 @@ waforth_core.o: waforth_core.c
waforth.gen/waforth_module_%.c waforth.gen/waforth_module_%.h: waforth.gen/waforth_module_%.wasm
wasm2c $< -o $(subst .wasm,.c,$<)
waforth.gen/waforth_module_%.wasm: waforth.gen/waforth_module_%.in.wasm
wasm-dis $< -o $(subst .wasm,.wat,$@)
wasm-as $(subst .wasm,.wat,$@) -o $@
waforth.gen/waforth_module_%.o: waforth.gen/waforth_module_%.c
$(CC) $(CPPFLAGS) $(CFLAGS) -DWASM_RT_MODULE_PREFIX=$(subst waforth.gen/,,$(subst .o,,$@))_ -c $< -o $@

View file

@ -119,10 +119,7 @@ WebAssembly.instantiate(coreWasm, {
];
const moduleFiles = [];
for (let i = 0; i < modules.length; ++i) {
fs.writeFileSync(
"waforth.gen/waforth_module_" + i + ".in.wasm",
modules[i]
);
fs.writeFileSync("waforth.gen/waforth_module_" + i + ".wasm", modules[i]);
include.push("#define WASM_RT_MODULE_PREFIX waforth_module_" + i + "_");
include.push('#include "waforth.gen/waforth_module_' + i + '.h"');
include.push("#undef WASM_RT_MODULE_PREFIX");