You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
33 lines
852 B
Plaintext
33 lines
852 B
Plaintext
VERSION := `git rev-parse --short HEAD`
|
|
|
|
# Build the web version
|
|
web GAME:
|
|
# base directory
|
|
mkdir -p dist/{{GAME}}/assets/{{GAME}}
|
|
|
|
# wasm binar
|
|
# cargo build --bin {{GAME}} --release --target wasm32-unknown-unknown
|
|
|
|
# wasm bindgen
|
|
wasm-bindgen --no-typescript --target web \
|
|
--out-dir ./dist/{{GAME}} \
|
|
--out-name "bin" \
|
|
${CARGO_TARGET_DIR}/wasm32-unknown-unknown/release/{{GAME}}.wasm
|
|
|
|
# index.html
|
|
cp ./web/{{GAME}}.html ./dist/{{GAME}}/index.html
|
|
|
|
# assest
|
|
rm -rf dist/{{GAME}}/assets/{{GAME}}
|
|
cp -r assets/{{GAME}} dist/{{GAME}}/assets/{{GAME}}
|
|
|
|
# Helpful shorthand to serve files
|
|
serve GAME: (web GAME)
|
|
cd dist/{{GAME}} && simple-http-server
|
|
|
|
# itchio GAME: (web GAME)
|
|
# butler push dist/{{GAME}} popgame/{{GAME}}:html5 --userversion={{VERSION}}
|
|
|
|
clean:
|
|
rm -rf dist/*
|