waforth/Makefile

41 lines
940 B
Makefile
Raw Normal View History

2018-05-12 21:09:19 +02:00
WAT2WASM=wat2wasm
WAT2WASM_FLAGS=
ifeq ($(DEBUG),1)
WAT2WASM_FLAGS=--debug-names
endif
2018-05-29 21:14:22 +02:00
WASM_FILES=src/waforth.wasm tests/benchmarks/sieve-vanilla.wasm
2018-05-12 21:09:19 +02:00
all: $(WASM_FILES)
2019-03-10 10:37:01 +01:00
yarn -s build
2018-05-12 21:09:19 +02:00
dev-server: $(WASM_FILES)
2019-03-10 10:37:01 +01:00
yarn -s dev-server
2018-05-29 08:48:08 +02:00
2018-05-12 21:09:19 +02:00
wasm: $(WASM_FILES) src/tools/quadruple.wasm.hex
src/waforth.wasm: src/waforth.wat dist
2018-05-12 21:09:19 +02:00
racket -f $< > src/waforth.wat.tmp
$(WAT2WASM) $(WAT2WASM_FLAGS) -o $@ src/waforth.wat.tmp
2018-05-29 21:14:22 +02:00
tests/benchmarks/sieve-vanilla.wasm: tests/benchmarks/sieve-vanilla.wat
2018-05-19 14:17:16 +02:00
$(WAT2WASM) $(WAT2WASM_FLAGS) -o $@ $<
2018-05-12 21:09:19 +02:00
dist:
mkdir -p $@
src/tools/quadruple.wasm: src/tools/quadruple.wat
$(WAT2WASM) $(WAT2WASM_FLAGS) -o $@ $<
src/tools/quadruple.wasm.hex: src/tools/quadruple.wasm
hexdump -v -e '16/1 "_u%04X" "\n"' $< | sed 's/_/\\/g; s/\\u //g; s/.*/ "&"/' > $@
clean:
-rm -rf $(WASM_FILES) src/tools/quadruple.wasm src/tools/quadruple.wasm.hex src/waforth.wat.tmp dist
2019-03-09 20:13:00 +01:00
2019-03-10 10:37:01 +01:00
check:
yarn -s test
2019-03-09 20:13:00 +01:00
lint:
2019-03-10 10:37:01 +01:00
yarn -s lint