aboutsummaryrefslogtreecommitdiff
path: root/html/Makefile
diff options
context:
space:
mode:
authorFlorian Fischer <florian.fischer@muhq.space>2025-04-10 15:14:43 -0400
committerFlorian Fischer <florian.fischer@muhq.space>2025-04-10 15:17:28 -0400
commit93fb965ba2d3bd87177fd08715f8eac755f25bf0 (patch)
treed0592f9c61faa38ebf1674c6a70f13b172e96034 /html/Makefile
parent8ca183f2ba74e7e21c8c9e934469d3f0d7df2546 (diff)
downloadmuhqs-game-93fb965ba2d3bd87177fd08715f8eac755f25bf0.tar.gz
muhqs-game-93fb965ba2d3bd87177fd08715f8eac755f25bf0.zip
improve wasm support during build time
Copy wasm_exec.js bundled with the used go version. Generalise the wasm build rule.
Diffstat (limited to 'html/Makefile')
-rw-r--r--html/Makefile7
1 files changed, 5 insertions, 2 deletions
diff --git a/html/Makefile b/html/Makefile
index 25997e88..e28c9dee 100644
--- a/html/Makefile
+++ b/html/Makefile
@@ -66,10 +66,13 @@ all: $(HTML) $(RULES_HTML) maps misc $(BLOG_POSTS_HTML)
misc: $(BUILDDIR)/latex-build $(BUILDDIR)/cards-data $(FILES_TO_COPY_TARGETS) \
$(BUILDDIR)/webtools.wasm
-$(BUILDDIR)/webtools.wasm:
+wasm_exec.js: $(shell go env GOROOT)/lib/wasm/wasm_exec.js
+ cp $< $@
+
+$(BUILDDIR)/%.wasm:
@echo "creating symlink $@"
@if test \( ! \( -d $(@D) \) \) ;then mkdir -p $(@D);fi
- ln -s $(GO_ROOT)/webtools/webtools.wasm $@
+ ln -s $(GO_ROOT)/$(*F)/$(*F).wasm $@
$(FILES_TO_COPY_TARGETS): $(BUILDDIR)/%: %
@echo "copying $@"