-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
25 lines (21 loc) · 1.01 KB
/
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
# path to wasm-bindgen binary *built from source*
PKG_DIR=pkg
FLAGS=--release
build:
echo "cross compiling to .wasm and generating bindings"
rm -rf pkg
# see .cargo/config.toml for all flags used
# this is because some flags seem not to work with wasm-pack when passed via --target or via RUSTFLAGS instead of .cargo/config.toml
RUSTFLAGS=' -C target-feature=+atomics,+bulk-memory' wasm-pack --verbose build --target no-modules --out-dir $(PKG_DIR) --out-name beh
simd:
RUSTFLAGS=' -C target-feature=+atomics,+simd128,+bulk-memory -Cno-vectorize-loops -Cno-vectorize-slp -Copt-level=z -Clinker-flavor=em' \
cargo build --target wasm32-unknown-unknown -Z build-std=std,panic_abort
echo "Generating bindings"
rm -rf pkg
$(WASM_BINDGEN) ./target/wasm32-unknown-unknown/debug/beh.wasm --out-dir $(PKG_DIR) --target no-modules
serve:
python3 -m http.server
deploy:
scp -r index.html *.js pkg [email protected]:/u/narekg/public_html/wasm_rayon/
deployv:
scp -r index.html *.js *.php pkg "${MY_WEB_SERVER}"