feat: add wasm build targets, profile hooks, os_demo example, and restructure manual source

- Add `wasm`, `wasm-clean`, and `install-emscripten` phony targets to Makefile for WebAssembly cross-compilation
- Insert `WREN_PROFILE_ENTER`/`WREN_PROFILE_EXIT` macros in `wren_vm.h` and `wren_vm.c` to support optional runtime profiling via `WREN_PROFILE_ENABLED`
- Create `example/os_demo.wren` demonstrating Platform, Process, and conditional exit usage
- Update `example/regex_demo.wren` to import `Match` and exercise Match object properties, groups, and `matchAll`
- Remove static HTML manual pages (`base64.html`, `dns.html`, `json.html`) and replace with structured `manual_src/` directory containing Jinja2 templates, YAML metadata, and content pages
- Expand `README.md` with build targets table, manual building instructions, source layout, and guide for adding new module documentation
This commit is contained in:
2026-01-26 04:12:14 +00:00
parent 79ff93c9a2
commit 04e467e09b
143 changed files with 13333 additions and 15112 deletions
+23 -1
View File
@@ -1,6 +1,6 @@
# retoor <retoor@molodetz.nl>
.PHONY: build tests clean debug sync-sidebar buildmanual
.PHONY: build tests clean debug sync-sidebar buildmanual wasm wasm-clean install-emscripten
build:
cd projects/make && $(MAKE) -f wren_cli.make -j $$(nproc 2>/dev/null || sysctl -n hw.ncpu 2>/dev/null || echo 4)
@@ -26,5 +26,27 @@ install:
clean:
cd projects/make && $(MAKE) -f wren_cli.make clean
wasm-clean:
cd projects/make.wasm && $(MAKE) -f wren_wasm.make clean
install-emscripten:
@if [ ! -d "$(HOME)/emsdk" ]; then \
echo "Cloning Emscripten SDK..."; \
git clone https://github.com/emscripten-core/emsdk.git $(HOME)/emsdk; \
cd $(HOME)/emsdk && ./emsdk install latest && ./emsdk activate latest; \
echo ""; \
echo "Emscripten installed. Run: source ~/emsdk/emsdk_env.sh"; \
else \
echo "Emscripten SDK already exists at ~/emsdk"; \
echo "Run: source ~/emsdk/emsdk_env.sh"; \
fi
wasm:
@if [ -z "$$EMSDK" ]; then \
echo "Error: EMSDK is not set. Run 'source ~/emsdk/emsdk_env.sh' first"; \
exit 1; \
fi
cd projects/make.wasm && $(MAKE) -f wren_wasm.make -j $$(nproc 2>/dev/null || sysctl -n hw.ncpu 2>/dev/null || echo 4)
buildmanual:
python3 util/build_manual.py