aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile8
1 files changed, 6 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index 7f8f3f2..d5caa92 100644
--- a/Makefile
+++ b/Makefile
@@ -123,8 +123,12 @@ $(JS)/lsp.bin: $(BIN)/zclsp$(EXE) src/js/extract_lsp.js src/js/mapvalues.js | $(
vsix:
bash src/tools/mkvsix.sh
-# the browser compiler: the page and its loader beside the wasm build
-web: $(WEB)/zc.wasm $(WEB)/index.html $(WEB)/zc.js
+# the browser compiler: the page, its loader and the examples it offers beside the wasm build
+WEB_EXAMPLES := $(patsubst examples/%,$(WEB)/examples/%,$(wildcard examples/*.zc))
+web: $(WEB)/zc.wasm $(WEB)/index.html $(WEB)/zc.js $(WEB_EXAMPLES)
+$(WEB)/examples/%.zc: examples/%.zc
+ mkdir -p $(WEB)/examples
+ cp $< $@
$(WEB)/zc.wasm: src/micro/micro.c src/micro/micro_port.h src/web/port_wasm.c src/web/build.sh $(B)/core/genome.bin $(CORE_H)
bash src/web/build.sh $@
$(WEB)/index.html $(WEB)/zc.js: $(WEB)/%: src/web/%