34 lines
618 B
Makefile
34 lines
618 B
Makefile
WABT_DIR := /home/johan/Sources/github.com/WebAssembly/wabt
|
|
|
|
WAT2WASM := $(WABT_DIR)/bin/wat2wasm
|
|
WASM2C := $(WABT_DIR)/bin/wasm2c
|
|
|
|
%.wat: %.py py2wasm/*.py
|
|
python3.8 -m py2wasm $< $@
|
|
|
|
%.wasm: %.wat
|
|
$(WAT2WASM) $^ -o $@
|
|
|
|
%.c: %.wasm
|
|
$(WASM2C) $^ -o $@
|
|
|
|
# %.exe: %.c
|
|
# cc $^ -o $@ -I $(WABT_DIR)/wasm2c
|
|
|
|
server:
|
|
python3.8 -m http.server
|
|
|
|
test: venv/.done
|
|
WAT2WASM=$(WAT2WASM) venv/bin/pytest tests $(TEST_FLAGS)
|
|
|
|
lint: venv/.done
|
|
venv/bin/pylint py2wasm
|
|
|
|
typecheck: venv/.done
|
|
venv/bin/mypy --strict py2wasm
|
|
|
|
venv/.done: requirements.txt
|
|
python3.8 -m venv venv
|
|
venv/bin/python3 -m pip install -r $^
|
|
touch $@
|