2019-03-11 16:34:15 +01:00
|
|
|
WASM2WAT=wasm2wat
|
2018-05-12 21:09:19 +02:00
|
|
|
WAT2WASM=wat2wasm
|
2019-11-09 20:04:11 +01:00
|
|
|
WAT2WASM_FLAGS=
|
2018-05-12 21:09:19 +02:00
|
|
|
ifeq ($(DEBUG),1)
|
2019-11-09 19:28:59 +01:00
|
|
|
WAT2WASM_FLAGS:=$(WAT2WASM_FLAGS) --debug-names
|
2018-05-12 21:09:19 +02:00
|
|
|
endif
|
|
|
|
|
2022-04-13 17:02:46 +02:00
|
|
|
all:
|
2019-03-10 10:37:01 +01:00
|
|
|
yarn -s build
|
2018-05-12 21:09:19 +02:00
|
|
|
|
2022-04-13 17:02:46 +02:00
|
|
|
dev:
|
|
|
|
yarn -s dev
|
|
|
|
|
2022-04-17 09:28:53 +02:00
|
|
|
check:
|
2022-04-13 17:02:46 +02:00
|
|
|
yarn -s test
|
|
|
|
|
2022-04-17 09:28:53 +02:00
|
|
|
check-watch:
|
2022-04-13 17:02:46 +02:00
|
|
|
yarn -s test-watch
|
2018-05-29 08:48:08 +02:00
|
|
|
|
2022-04-17 09:28:53 +02:00
|
|
|
lint:
|
|
|
|
yarn -s lint
|
|
|
|
|
2022-04-15 15:33:50 +02:00
|
|
|
wasm: src/waforth.assembled.wat scripts/quadruple.wasm.hex
|
2018-05-12 21:09:19 +02:00
|
|
|
|
2019-11-11 11:29:20 +01:00
|
|
|
process: src/waforth.vanilla.wat
|
|
|
|
cp $< src/waforth.wat
|
|
|
|
|
|
|
|
src/waforth.wasm: src/waforth.wat
|
2019-11-09 20:04:11 +01:00
|
|
|
$(WAT2WASM) $(WAT2WASM_FLAGS) -o $@ $<
|
|
|
|
|
|
|
|
src/waforth.vanilla.wat: src/waforth.wat
|
2022-04-15 15:33:50 +02:00
|
|
|
./scripts/process.js $< $@
|
2018-05-12 21:09:19 +02:00
|
|
|
|
2019-11-09 20:04:11 +01:00
|
|
|
src/waforth.bulkmem.wasm: src/waforth.bulkmem.wat
|
|
|
|
$(WAT2WASM) $(WAT2WASM_FLAGS) --enable-bulk-memory -o $@ $<
|
|
|
|
|
|
|
|
src/waforth.bulkmem.wat: src/waforth.wat
|
2022-04-15 15:33:50 +02:00
|
|
|
./scripts/process.js --enable-bulk-memory $< $@
|
2019-03-11 16:34:15 +01:00
|
|
|
|
2022-04-13 17:02:46 +02:00
|
|
|
src/benchmarks/sieve-vanilla.wasm: src/benchmarks/sieve-vanilla.wat
|
2018-05-19 14:17:16 +02:00
|
|
|
$(WAT2WASM) $(WAT2WASM_FLAGS) -o $@ $<
|
|
|
|
|
2022-04-15 15:33:50 +02:00
|
|
|
scripts/quadruple.wasm: scripts/quadruple.wat
|
2018-05-12 21:09:19 +02:00
|
|
|
$(WAT2WASM) $(WAT2WASM_FLAGS) -o $@ $<
|
|
|
|
|
2022-04-15 15:33:50 +02:00
|
|
|
scripts/quadruple.wasm.hex: scripts/quadruple.wasm
|
2018-05-12 21:09:19 +02:00
|
|
|
hexdump -v -e '16/1 "_u%04X" "\n"' $< | sed 's/_/\\/g; s/\\u //g; s/.*/ "&"/' > $@
|
|
|
|
|
|
|
|
clean:
|
2022-04-15 15:33:50 +02:00
|
|
|
-rm -rf $(WASM_FILES) scripts/quadruple.wasm scripts/quadruple.wasm.hex src/waforth.wat.tmp dist
|
2019-03-09 20:13:00 +01:00
|
|
|
|