- Clang/LLVM (wasm32)
- GNU Make
- Bear (compile_commands.json) (for LSP, optional)
- Python 3 (for local static server, optional)
Install commands:
- macOS:
brew install llvm bear - Ubuntu/Debian:
sudo apt-get install clang make bear python3 - Arch (btw):
sudo pacman -S clang make bear python3
/include/ # public headers (e.g., base.h, heap.h)
/src/ # .c files (e.g., main.c, heap.c)
/build/ # artifacts (generated)
Makefile
index.html
main.js
main.css
renderer.js # WebGL2 render pipeline
shader-program.js # WebGL2 shader program utility
frame-view.js # DataView for framebuffermake # -> build/app.wasm
make cleanNotes:
- Target:
wasm32 -nostdlibwith--allow-undefinedfor host imports. - If JS must call a C function annotated with the definition:
WASM_EXPORT(my_func)
void my_func(void) { /* ... */ }Run when you add/remove .c files or change flags/includes.
make compdb # full rebuild with BearServe repo root:
python3 -m http.server 8000 --bind 127.0.0.1