forked from oflatt/egglog
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
36 lines (24 loc) · 893 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
.PHONY: all web test serve
RUST_SRC=$(shell find -type f -wholename '*/src/*.rs' -or -name 'Cargo.toml')
TESTS=$(shell find tests/ -type f -name '*.egg' -not -name '*repro-*')
WWW=${PWD}/target/www/
WEB_SRC=$(wildcard web-demo/static/*)
WASM=web_demo.js web_demo_bg.wasm
DIST_WASM=$(addprefix ${WWW}, ${WASM})
all: test web
test:
cargo test --release -- -Zunstable-options --report-time
@rustup component add clippy
cargo clippy --tests -- -D warnings
@rustup component add rustfmt
cargo fmt --check
web: ${DIST_WASM} ${WEB_SRC} ${WWW}/examples.json
mkdir -p ${WWW}
cp ${WEB_SRC} ${WWW}
serve:
cargo watch --shell "make web && python3 -m http.server 8080 -d ${WWW}"
${WWW}/examples.json: web-demo/examples.py ${TESTS}
$^ > $@
${DIST_WASM}: ${RUST_SRC}
wasm-pack build web-demo --target no-modules --no-typescript --out-dir ${WWW}
rm -f ${WWW}/{.gitignore,package.json}