From c87cca2b5f2c7156096ac7a6fed248474ebe0db1 Mon Sep 17 00:00:00 2001 From: syumai Date: Tue, 16 Apr 2024 10:19:53 +0900 Subject: [PATCH] add command to build examples to Makefile --- Makefile | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Makefile b/Makefile index b2084f5..4bb3c27 100644 --- a/Makefile +++ b/Makefile @@ -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 \ No newline at end of file