add command to build examples to Makefile

This commit is contained in:
syumai 2024-04-16 10:19:53 +09:00
parent 91dafbfb1e
commit c87cca2b5f

View File

@ -2,3 +2,10 @@
test:
@PATH=$(CURDIR)/misc/wasm:$(PATH) GOOS=js GOARCH=wasm go test ./...
.PHONY: build-examples
build-examples:
for dir in $(shell find ./_examples -maxdepth 1 -type d); do \
if [ $$dir = "./_examples" ]; then continue; fi; \
cd $$dir && GOOS=js GOARCH=wasm go build -o ./build/app.wasm; \
cd ../../; \
done