From 93fb965ba2d3bd87177fd08715f8eac755f25bf0 Mon Sep 17 00:00:00 2001 From: Florian Fischer Date: Thu, 10 Apr 2025 15:14:43 -0400 Subject: improve wasm support during build time Copy wasm_exec.js bundled with the used go version. Generalise the wasm build rule. --- html/Makefile | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'html/Makefile') 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 $@" -- cgit v1.2.3