diff --git a/Makefile b/Makefile index 5960571..3c9e8c1 100644 --- a/Makefile +++ b/Makefile @@ -3,18 +3,23 @@ ## Do not use it if that isn't your goal! ## +# # # Configuration Variables # # # +# # Patch these to select a different build profile or target # The target shouldn't change any time soon. WASM64, I guess. Other targets # aren't aimed at the web, so you shouldn't be using this makefile. CARGO_TARGET := wasm32-unknown-unknown CARGO_PROFILE := tiny +# # # Automatic Variables # # # SRC_DIR = ./src SRCS := $(wildcard $(SRC_DIR)/**) ASSET_SOURCE := $(wildcard assets/**) ASSETS := $(patsubst assets/%.ogg, out/assets/%.ogg, $(ASSET_SOURCE)) +CRATE_VERSION != sed -nre 's/^version = "(.*)"/\1/p' Cargo.toml + .PHONY: clean full-clean tarball tarball-standalone web web-standalone # "Standalone" version. It includes an index.html to serve as-is @@ -56,6 +61,7 @@ out/asteroids.js out/asteroids_bg.wasm.gz &: target/$(CARGO_TARGET)/$(CARGO_PROF out/index.html: www/index.html cp -a $< $@ rm -f out/asteroids.html + sed -i -e "s/#CRATE_VERSION_PLACEHOLDER#/$(CRATE_VERSION)/" $@ # Like `out/index.html`, but renames the page for use in a larger site. out/asteroids.html: www/index.html diff --git a/www/index.html b/www/index.html index 3cb4570..96a60f6 100644 --- a/www/index.html +++ b/www/index.html @@ -118,8 +118,7 @@ Program Version - - v0.6.1 + #CRATE_VERSION_PLACEHOLDER#