diff options
| author | user <user@clank> | 2026-09-02 14:47:30 +0200 |
|---|---|---|
| committer | user <user@clank> | 2026-09-02 14:47:30 +0200 |
| commit | 3578eefea5b53bce2c1dbbc7f104f3cf85c8aa5b (patch) | |
| tree | cccc5aaf79eb145496fb2c388654e3cf9fb571ff /web | |
| parent | shaders: remove the .so plugin loader (diff) | |
| download | slosh-3578eefea5b53bce2c1dbbc7f104f3cf85c8aa5b.tar.gz slosh-3578eefea5b53bce2c1dbbc7f104f3cf85c8aa5b.tar.xz slosh-3578eefea5b53bce2c1dbbc7f104f3cf85c8aa5b.zip | |
webdemo: version from contrib/version, published by ship
The demo's Makefile said VERSION := 0.1.0 by hand, so the in-browser
slosh announced a release two tags old no matter what was built into
it. It now derives from contrib/version like every other artifact,
suffixed +webdemo so the guest build names itself. And ship gains a
website step: the site (demo included) is rebuilt from the tag
checkout and published as part of a release, so the demo cannot fall
behind again.
Diffstat (limited to 'web')
| -rw-r--r-- | web/demo/Makefile | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/web/demo/Makefile b/web/demo/Makefile index 06d1f5b..431bb53 100644 --- a/web/demo/Makefile +++ b/web/demo/Makefile @@ -27,8 +27,11 @@ GUEST := build/slosh-riscv64 # by somebody's browser, 256 KiB at a time. CFLAGS := -target $(TARGET) -std=c23 -Os -Wall -Wextra -Wno-unused-parameter \ -MMD -MP -I$(VT_INC) -I$(ROOT)/include -Ibuild -VERSION := 0.1.0 -GITDESC = $(shell cd $(ROOT) && git describe --always --dirty 2>/dev/null || echo unknown) +# The same derivation as every other artifact (contrib/version: the tag is +# the single source of truth), so the demo cannot fall behind a release the +# way a hand-written number here once did. +webdemo, because this binary is +# the riscv64 guest build and should say so when someone asks it. +VERSION := $(shell cd $(ROOT) && contrib/version) SITE := build/site IMAGE := build/rootfs.bin @@ -85,8 +88,8 @@ $(VT_LIB): # so a new commit rebuilds and `make` twice in a row does not. .PHONY: FORCE build/version.h: FORCE | build - @printf '/* generated by web/demo/Makefile */\n#define SLOSH_VERSION "%s+%s"\n' \ - '$(VERSION)' '$(GITDESC)' > $@.tmp + @printf '/* generated by web/demo/Makefile */\n#define SLOSH_VERSION "%s+webdemo"\n' \ + '$(VERSION)' > $@.tmp @cmp -s $@.tmp $@ || mv $@.tmp $@ @rm -f $@.tmp |
