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-23 11:09:32 +02:00
|
|
|
wasm: src/waforth.assembled.wat scripts/word.wasm.hex
|
2018-05-12 21:09:19 +02:00
|
|
|
|
2022-05-01 22:55:32 +02:00
|
|
|
src/web/benchmarks/sieve/sieve-c.js:
|
2022-12-18 16:24:35 +01:00
|
|
|
emcc src/web/benchmarks/sieve/sieve.c -O2 -o $@ \
|
|
|
|
-sSINGLE_FILE -sMODULARIZE -sINITIAL_MEMORY=100Mb \
|
|
|
|
-sEXPORTED_FUNCTIONS=_sieve -sEXPORTED_RUNTIME_METHODS=ccall,cwrap
|
2022-05-01 20:45:10 +02:00
|
|
|
|
2022-05-28 22:08:12 +02:00
|
|
|
.PHONY: standalone
|
|
|
|
standalone:
|
|
|
|
$(MAKE) -C src/standalone
|
|
|
|
|
2022-11-16 21:54:37 +01:00
|
|
|
.PHONY: waforthc
|
|
|
|
waforthc:
|
|
|
|
$(MAKE) -C src/waforthc
|
|
|
|
|
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
|
|
|
|