Move from Make to just
parent
129db30e55
commit
15cb9ae49b
@ -1,44 +0,0 @@
|
|||||||
VERSION=$(shell git rev-parse --short HEAD)
|
|
||||||
|
|
||||||
web/trees: dist/trees dist/trees/trees_bg.wasm dist/trees/index.html dist/trees/assets
|
|
||||||
|
|
||||||
# Create dist directory for trees
|
|
||||||
dist/trees:
|
|
||||||
mkdir -p dist/trees
|
|
||||||
|
|
||||||
# Build the web version
|
|
||||||
release/trees/web: src/bin/trees/main.rs src/bin/trees/mono.rs
|
|
||||||
cargo build --bin trees --release --target wasm32-unknown-unknown
|
|
||||||
|
|
||||||
# Use wasm-bindgen to do some magic
|
|
||||||
dist/trees/trees_bg.wasm: release/trees/web
|
|
||||||
wasm-bindgen --no-typescript --target web \
|
|
||||||
--out-dir ./dist/trees \
|
|
||||||
--out-name "trees" \
|
|
||||||
${CARGO_TARGET_DIR}/wasm32-unknown-unknown/release/trees.wasm
|
|
||||||
|
|
||||||
# Copy html
|
|
||||||
dist/trees/index.html: web/trees.html
|
|
||||||
cp ./web/trees.html ./dist/trees/index.html
|
|
||||||
|
|
||||||
# Copy assets
|
|
||||||
dist/trees/assets/trees:
|
|
||||||
rm -rf dist/trees/assets
|
|
||||||
rsync -av \
|
|
||||||
--include='*/' \
|
|
||||||
--include='*.png' \
|
|
||||||
--include='*.mono' \
|
|
||||||
--exclude='*' \
|
|
||||||
--delete \
|
|
||||||
assets/trees \
|
|
||||||
dist/trees/assets/trees
|
|
||||||
|
|
||||||
# Helpful shorthand to serve files
|
|
||||||
web/trees/serve: web/trees
|
|
||||||
cd dist/trees && simple-http-server
|
|
||||||
|
|
||||||
itch.io/trees: web/trees
|
|
||||||
butler push dist/trees popgame/trees:html5 --userversion=$(VERSION)
|
|
||||||
|
|
||||||
clean:
|
|
||||||
rm -rf dist/trees
|
|
||||||
@ -0,0 +1,32 @@
|
|||||||
|
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/*
|
||||||
Loading…
Reference in New Issue