2020-09-02 15:46:01 +00:00
|
|
|
# Based on https://raw.githubusercontent.com/saschagrunert/webapp.rs/master/Makefile
|
|
|
|
|
2020-09-16 13:02:15 +00:00
|
|
|
all: build-frontend
|
2020-09-02 15:46:01 +00:00
|
|
|
|
2020-09-17 09:24:37 +00:00
|
|
|
build-frontend: build-frontend-core build-frontend-player
|
|
|
|
|
|
|
|
build-frontend-core:
|
2020-09-17 04:35:11 +00:00
|
|
|
cd frontend/core && \
|
2020-09-17 09:24:37 +00:00
|
|
|
wasm-pack build \
|
|
|
|
--dev \
|
|
|
|
--target web \
|
|
|
|
--no-typescript \
|
|
|
|
--out-name audioview_core \
|
|
|
|
--out-dir ./static/wasm/
|
|
|
|
|
|
|
|
build-frontend-player:
|
|
|
|
RUSTFLAGS='-C target-feature=+atomics,+bulk-memory' \
|
|
|
|
cargo build -p audioview-frontend-player --target-dir ./target --target wasm32-unknown-unknown -Z build-std=std,panic_abort && \
|
|
|
|
wasm-bindgen \
|
|
|
|
target/wasm32-unknown-unknown/debug/audioview_frontend_player.wasm \
|
|
|
|
--out-name audioview_player \
|
|
|
|
--out-dir ./frontend/core/static/wasm/ \
|
|
|
|
--target no-modules
|
|
|
|
|
|
|
|
clean:
|
|
|
|
cargo clean
|
|
|
|
rm -rf frontend/core/static/wasm/
|
2020-09-02 15:46:01 +00:00
|
|
|
|
|
|
|
build-doc:
|
|
|
|
cargo doc --all --no-deps
|
|
|
|
|
|
|
|
run:
|
2020-09-17 04:35:11 +00:00
|
|
|
simple-http-server -i ./frontend/core/static/ -p 3000 --nocache --try-file ./frontend/core/static/index.html
|
2020-09-02 15:46:01 +00:00
|
|
|
|
|
|
|
lint: lint-rustfmt lint-clippy
|
|
|
|
|
|
|
|
lint-clippy:
|
|
|
|
cargo clippy --all -- -D warnings
|
|
|
|
|
|
|
|
lint-rustfmt:
|
|
|
|
cargo fmt
|
|
|
|
git diff --exit-code
|