Automatically fill version info in index.html
This commit is contained in:
6
Makefile
6
Makefile
@@ -3,18 +3,23 @@
|
|||||||
## Do not use it if that isn't your goal!
|
## Do not use it if that isn't your goal!
|
||||||
##
|
##
|
||||||
|
|
||||||
|
# # # Configuration Variables # # #
|
||||||
|
#
|
||||||
# Patch these to select a different build profile or target
|
# Patch these to select a different build profile or target
|
||||||
# The target shouldn't change any time soon. WASM64, I guess. Other targets
|
# 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.
|
# aren't aimed at the web, so you shouldn't be using this makefile.
|
||||||
CARGO_TARGET := wasm32-unknown-unknown
|
CARGO_TARGET := wasm32-unknown-unknown
|
||||||
CARGO_PROFILE := tiny
|
CARGO_PROFILE := tiny
|
||||||
|
|
||||||
|
# # # Automatic Variables # # #
|
||||||
SRC_DIR = ./src
|
SRC_DIR = ./src
|
||||||
SRCS := $(wildcard $(SRC_DIR)/**)
|
SRCS := $(wildcard $(SRC_DIR)/**)
|
||||||
|
|
||||||
ASSET_SOURCE := $(wildcard assets/**)
|
ASSET_SOURCE := $(wildcard assets/**)
|
||||||
ASSETS := $(patsubst assets/%.ogg, out/assets/%.ogg, $(ASSET_SOURCE))
|
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
|
.PHONY: clean full-clean tarball tarball-standalone web web-standalone
|
||||||
|
|
||||||
# "Standalone" version. It includes an index.html to serve as-is
|
# "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
|
out/index.html: www/index.html
|
||||||
cp -a $< $@
|
cp -a $< $@
|
||||||
rm -f out/asteroids.html
|
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.
|
# Like `out/index.html`, but renames the page for use in a larger site.
|
||||||
out/asteroids.html: www/index.html
|
out/asteroids.html: www/index.html
|
||||||
|
|||||||
@@ -118,8 +118,7 @@
|
|||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>Program Version</td>
|
<td>Program Version</td>
|
||||||
<!-- This version text is completely unchecked. I'll need to do something about that. -->
|
<td><code>#CRATE_VERSION_PLACEHOLDER#</code></td>
|
||||||
<td><code>v0.6.1</code></td>
|
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
</article>
|
</article>
|
||||||
|
|||||||
Reference in New Issue
Block a user