summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKonAki <konaki@anokonaki.org>2026-10-17 17:37:22 +0800
committerKonAki <konaki@anokonaki.org>2026-10-17 17:37:22 +0800
commit2ff1bea93fe0fa69b57337ab6bb31e4ea5b60647 (patch)
treeb71a22d442546b0bf96ae41297211f9b6a392d61
parent39f9944e9fde1dbeb3576f7fea16c0f70ef05b8a (diff)
readme: build.c, -j and -v
-rw-r--r--README.md10
1 files changed, 5 insertions, 5 deletions
diff --git a/README.md b/README.md
index 238c648..aaa6682 100644
--- a/README.md
+++ b/README.md
@@ -86,7 +86,7 @@ yes, it's just that. If a module needs another one it adds it for you, so `debug
<summary>All the build options</summary>
```
-./build.sh [-d] [-D] [-p platform] [-m module,...] [-o objdir] [target ...]
+./build.sh [-d] [-D] [-v] [-j jobs] [-p platform] [-m module,...] [-o objdir] [target ...]
```
- `-d` is a debug build. It also turns on the developer build.
@@ -94,21 +94,21 @@ yes, it's just that. If a module needs another one it adds it for you, so `debug
- `-p` is `linux`, `bsd` or `windows`. It finds your own if you leave it out.
- `-m` is the list of modules from the table above.
- `-o` is where the objects go, `obj` by default.
+- `-j` is how many files to compile at once, one for each processor if you leave it out.
+- `-v` shows the compiler commands as they run.
targets are `all`, `run`, `clean`, `tools`, `pack` and `examples`.
</details>
-If you'd rather use make directly, the [Makefile](Makefile) is a normal one. The script just sets the flags and calls it. It was made to stay as POSIX as I can.
-
-No sh or make, for example on Windows? [build.c](build.c) does the same job with only a C compiler. It takes the same options and targets, and rebuilds itself when it changes:
+build.sh is only a bootstrap. It compiles [build.c](build.c) with your C compiler once and runs it. build.c does the real work, and all it needs is a C compiler, so it is the same on Windows where there is no sh and no make:
```sh
cc -o build build.c
./build -m font,assets,image,audio
```
-It uses [konbuild.h](kon/konbuild.h), a small single header for build programs written in C. build.sh and build.c are kept to the same module list, so when you add a module add it in both.
+The compiler that built it is the one it builds the engine with, set `CC` to use another. It compiles several files at once and only rebuilds what includes a header that changed. It rebuilds itself when build.c changes. `make` works as well, the [Makefile](Makefile) only calls it: `make ARGS="-d -m font,ui" run`. The build program is made with [konbuild.h](kon/konbuild.h), a small single header for build programs written in C.
### Your own program