Files
wren/Makefile
T
retoor 04e467e09b 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
2026-01-26 04:12:14 +00:00

53 lines
1.5 KiB
Makefile

# retoor <retoor@molodetz.nl>
.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)
debug:
cd projects/make && $(MAKE) -f wren_cli.make config=debug_64bit -j $$(nproc 2>/dev/null || sysctl -n hw.ncpu 2>/dev/null || echo 4)
tests: build
python3 util/test.py
create_merge:
wren apps/merge_all_wren.wren
create_docs:
wren apps/merge_docs.wren
create_training_data:
python create_training_data.py --manual-html manual.md --out-train training_data.jsonl --out-val training_data_val.jsonl
install:
cp bin/wren_cli /usr/local/bin/wren
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