webtools/Makefile
Leon Mika d1dee7bc3d
All checks were successful
/ publish (push) Successful in 55s
Added a Go template playground
2025-09-26 17:28:30 +10:00

24 lines
554 B
Makefile

GOROOT := $(shell go env | grep GOROOT | sed -e "s/GOROOT=//g" | sed -e "s/[']//g")
.Phony: build
build: clean build.wasm build.site
.Phony: clean
clean:
-rm -r target
mkdir target
.Phony: build.wasm
build.wasm:
mkdir target/wasm
GOOS=js GOARCH=wasm go build -o target/wasm/clocks.wasm ./cmds/clocks
GOOS=js GOARCH=wasm go build -o target/wasm/gotemplate.wasm ./cmds/gotemplate
cp $(GOROOT)/lib/wasm/wasm_exec.js target/wasm/.
.Phony: build.site
build.site:
cp -r site/* target/.
.Phony: dev
dev: build
( cd target ; python3 -m http.server )