Skip to content

Commit 264616b

Browse files
committed
💄 format build docs
1 parent a44b553 commit 264616b

2 files changed

Lines changed: 25 additions & 7 deletions

File tree

BUILD.md

Lines changed: 23 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
This guide is for maintainers and builders working on clayterm itself.
44

55
It covers:
6+
67
- cloning the repo correctly,
78
- initializing the `clay` git submodule,
89
- installing the toolchain needed to compile the C sources to WebAssembly,
@@ -16,6 +17,7 @@ It does **not** cover npm/JSR packaging or publishing.
1617
The local source build is driven by `make`.
1718

1819
It generates:
20+
1921
- `clayterm.wasm` — the compiled WebAssembly module built from the C sources
2022
- `wasm.ts` — a generated TypeScript file derived from `clayterm.wasm`
2123

@@ -44,11 +46,13 @@ Quick check:
4446
git submodule status --recursive
4547
```
4648

47-
You should also see a populated `clay/` directory. If `clay/` is missing or empty, fix the submodule state before building.
49+
You should also see a populated `clay/` directory. If `clay/` is missing or
50+
empty, fix the submodule state before building.
4851

4952
## Required tools
5053

5154
You need:
55+
5256
- `git`
5357
- `make`
5458
- `clang` with wasm32-capable support
@@ -60,7 +64,8 @@ Equivalent packages are fine if your package manager uses different names.
6064

6165
### macOS
6266

63-
Install Apple's command line tools first. They provide the base developer tools, including `git` and `make`.
67+
Install Apple's command line tools first. They provide the base developer tools,
68+
including `git` and `make`.
6469

6570
```sh
6671
xcode-select --install
@@ -79,7 +84,8 @@ echo 'export PATH="$(brew --prefix llvm)/bin:$PATH"' >> ~/.zshrc
7984
source ~/.zshrc
8085
```
8186

82-
If you do not already have `git` available after installing the command line tools, install it with Homebrew:
87+
If you do not already have `git` available after installing the command line
88+
tools, install it with Homebrew:
8389

8490
```sh
8591
brew install git
@@ -138,9 +144,11 @@ From an elevated PowerShell prompt:
138144
wsl --install -d Ubuntu
139145
```
140146

141-
Then open the Ubuntu environment and follow the **Debian / Ubuntu** instructions above.
147+
Then open the Ubuntu environment and follow the **Debian / Ubuntu** instructions
148+
above.
142149

143-
The build host runs inside WSL2, but the resulting WebAssembly artifacts are intended to run on **native Windows** at runtime.
150+
The build host runs inside WSL2, but the resulting WebAssembly artifacts are
151+
intended to run on **native Windows** at runtime.
144152

145153
## Verify the toolchain
146154

@@ -160,7 +168,9 @@ clang --target=wasm32 -c -x c /dev/null -o /tmp/clayterm-wasm-test.o
160168
rm -f /tmp/clayterm-wasm-test.o
161169
```
162170

163-
On macOS, if `which clang` still points to `/usr/bin/clang` and the wasm test fails, make sure the Homebrew LLVM `bin/` directory is at the front of your `PATH`.
171+
On macOS, if `which clang` still points to `/usr/bin/clang` and the wasm test
172+
fails, make sure the Homebrew LLVM `bin/` directory is at the front of your
173+
`PATH`.
164174

165175
## Build from source
166176

@@ -171,6 +181,7 @@ make
171181
```
172182

173183
This should produce:
184+
174185
- `clayterm.wasm`
175186
- `wasm.ts`
176187

@@ -183,6 +194,7 @@ make clean && make
183194
## When to rebuild
184195

185196
Re-run `make` when:
197+
186198
- you change files under `src/`
187199
- you update the `clay` submodule
188200
- `clayterm.wasm` or `wasm.ts` is missing
@@ -214,6 +226,7 @@ deno lint
214226
### `clay/` is missing or empty
215227

216228
Symptoms may include build failures such as:
229+
217230
- `fatal error: '../clay/clay.h' file not found`
218231

219232
Recovery:
@@ -232,10 +245,12 @@ make clean && make
232245
### `clang` cannot target `wasm32`
233246

234247
Symptoms may include:
248+
235249
- target-related `clang` errors mentioning `wasm32`
236250
- linker failures while producing `clayterm.wasm`
237251

238252
Recovery:
253+
239254
- make sure you are using an LLVM/Clang build with wasm support
240255
- on macOS, prefer the Homebrew `llvm` toolchain over `/usr/bin/clang`
241256
- on Linux/WSL2, make sure both `clang` and `lld` are installed
@@ -251,6 +266,7 @@ If the smoke test fails, fix the toolchain first and only then rerun `make`.
251266
### Generated artifacts are missing or stale
252267

253268
Symptoms may include:
269+
254270
- `clayterm.wasm` is missing
255271
- `wasm.ts` is missing
256272
- you changed `src/` or updated `clay/`, but the generated outputs do not match
@@ -272,6 +288,7 @@ deno task test
272288
This document is intentionally limited to local source builds for development.
273289

274290
Out of scope:
291+
275292
- `deno task build:npm`
276293
- `deno task build:jsr`
277294
- `npm publish`

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,8 @@ process.stdin.on("data", (buf) => {
212212

213213
## Development
214214

215-
For local source builds, toolchain setup, and `clay` submodule instructions, see [BUILD.md](BUILD.md).
215+
For local source builds, toolchain setup, and `clay` submodule instructions, see
216+
[BUILD.md](BUILD.md).
216217

217218
Quick local validation:
218219

0 commit comments

Comments
 (0)