waforth/Makefile

44 lines
852 B
Makefile
Raw Normal View History

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)
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-23 11:09:32 +02:00
wasm: src/waforth.assembled.wat scripts/word.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
2019-11-09 20:04:11 +01:00
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
2022-05-01 22:55:32 +02:00
src/web/benchmarks/sieve/sieve-c.js:
2022-05-01 20:45:10 +02:00
emcc src/web/benchmarks/sieve/sieve.c -O2 -o $@ -sEXPORTED_FUNCTIONS=_sieve -sEXPORTED_RUNTIME_METHODS=ccall,cwrap
2022-05-01 22:55:32 +02:00
%.wasm: %.wat
2018-05-12 21:09:19 +02:00
$(WAT2WASM) $(WAT2WASM_FLAGS) -o $@ $<
2022-05-01 22:55:32 +02:00
%.wasm.hex: %.wasm
2022-04-23 12:09:28 +02:00
hexdump -v -e '16/1 "_%02X" "\n"' $< | sed 's/_/\\/g; s/\\u //g; s/.*/ "&"/' > $@
2018-05-12 21:09:19 +02:00
clean:
2022-04-23 11:09:32 +02:00
-rm -rf $(WASM_FILES) scripts/word.wasm scripts/word.wasm.hex src/waforth.wat.tmp \
2022-04-21 13:38:53 +02:00
public/waforth
2019-03-09 20:13:00 +01:00