aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorGravatar zinc <zinc@downsta.ir> 2026-10-14 07:55:08 +0000
committerGravatar zinc <zinc@downsta.ir> 2026-10-14 07:55:08 +0000
commitd8da21a406f449d277c42b91d4c9bf8b20bd0dcc (patch)
tree79a4dbf6839eaee19aa626f1aa3981d5b0c19377 /Makefile
parentbuild: embed images with #embed, keep everything generated in build/ (diff)
embed: tests, editor support and docs; js vm file access; test fixes
embed declarations get accept and reject fixtures, a run-only image check through zc0, an lsp keyword hover and the grammar keyword. errors point at the declaration and still declare the name, so its uses are not reported again. zc0 tracks byte-string globals and lays embedded arrays out one word per element, the way its own indexing reads them. the command-line javascript vm reaches node's file system for the file syscalls, so include and embed work there; other embedders opt in. the web build is self-contained in build/web with its examples. README, BORROW and BOOTSTRAP-OWNERSHIP describe the new build and ownership rules, and ONBOARD.md is a reading and verification order for the code. the suite passes the map header to mklayout, the wasm fuzz program uses the include format, and lsp drivers scale their deadlines on hosts without the arm64 jit (ZC_TEST_TIMEOUT_SCALE). LLVM_CONFIG selects an llvm with headers for the llvm section.
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/%