Commit 764f8258 authored by Camil Staps's avatar Camil Staps 🍃

Move generic wasm-supporting JS from iTasks to this repository

parent 27cc66bf
Pipeline #25964 canceled with stages
in 44 seconds
abc-instructions.js
abc-interpreter.wat
WebPublic
JS?=js
WASM:=abc-interpreter.wasm abc-interpreter-util.wasm
TARGETS:=$(WASM) abc-instructions.js
all: $(TARGETS) WebPublic
all: $(WASM) WebPublic
WebPublic: $(TARGETS)
WebPublic: $(WASM) abc-interpreter.js ../src/abc_instructions.h
mkdir -p WebPublic/js
cp $^ WebPublic/js
cp $(WASM) WebPublic/js
cp abc-interpreter.js WebPublic/js
echo 'ABCInterpreter.instructions=[' >> WebPublic/js/abc-interpreter.js
sed -n 's/^\tINSTRUCTION(\(.*\))/\t"\1",/p' ../src/abc_instructions.h >> WebPublic/js/abc-interpreter.js
echo '];' >> WebPublic/js/abc-interpreter.js
%.wasm: %.wat
$(JS) ../tools/wat2wasm.js $< -o $@
......@@ -16,9 +19,4 @@ abc-interpreter.wat: .FORCE
$(MAKE) -C ../tools interpretergenwasm
../tools/interpretergenwasm $(INTERPRETERGENWASMFLAGS) -i ../src/abc_instructions.h > $@
abc-instructions.js: ../src/abc_instructions.h
echo 'var abc_instructions = [' > $@
sed -n 's/^\tINSTRUCTION(\(.*\))/\t"\1",/p' $< >> $@
echo '];' >> $@
.FORCE:
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment