audioview/Makefile

43 lines
1.1 KiB
Makefile

# Based on https://raw.githubusercontent.com/saschagrunert/webapp.rs/master/Makefile
all: build-frontend
build-frontend: build-frontend-core build-frontend-player
build-frontend-core:
cd frontend/core && \
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/
build-doc:
cargo doc --all --no-deps
run:
simple-http-server -i ./frontend/core/static/ -p 3000 --nocache --try-file ./frontend/core/static/index.html
lint: lint-rustfmt lint-clippy
lint-clippy:
cargo clippy --all -- -D warnings
lint-rustfmt:
cargo fmt
git diff --exit-code