# zexc.toml — build configuration
All **shared / static / standalone / feature** choices live in the project-root
file **`zexc.toml`**. The Makefile does not hard-code those decisions; it only
runs `scripts/zexc_config.py` and then `cargo`.
**License:** project is **GPL-3.0-only** — [`../LICENSE`](../LICENSE).
## Quick start
```bash
# 1) Edit config
$EDITOR zexc.toml
# 2) Apply to Cargo.toml + generate .zexc-build.mk
make configure
# or: python3 scripts/zexc_config.py --make
# 3) Build
make release
```
## Example: shared library only (no CLI)
```toml
[library]
shared = true
static = false
rlib = true
[binary]
standalone = false
[features]
std = true
simd = true
encryption = true
c-api = true
```
```bash
make release
# → target/release/libzexc.so (no zexc binary)
```
## Example: static + CLI, no .so
```toml
[library]
shared = false
static = true
rlib = true
[binary]
standalone = true
[features]
c-api = true
simd = true
encryption = false
```
## Example: CLI only (Rust rlib for linking tests)
```toml
[library]
shared = false
static = false
rlib = true
[binary]
standalone = true
```
## Keys
### `[library]`
| `shared` | Dynamic library | `cdylib` → `libzexc.so` |
| `static` | Static archive | `staticlib` → `libzexc.a` |
| `rlib` | Rust library | `rlib` (needed for tests / CLI) |
### `[binary]`
| `standalone` | Build CLI tool `zexc` (Cargo feature `cli`) |
### `[features]`
| `std` | `std` |
| `simd` | `simd` |
| `encryption` | `encryption` |
| `c-api` | `c-api` (C symbols in the lib) |
### `[profile]`
| `mode` | `"release"` or `"debug"` (Make uses this for install paths) |
| `rustflags` | Extra `RUSTFLAGS` (e.g. `-C target-cpu=native`) |
### `[paths]`
| `prefix` | Install root for `make install-local` (default `./dist`) |
## Commands
```bash
make show-config # print effective settings
make configure # apply crate-type + write .zexc-build.mk
python3 scripts/zexc_config.py --cargo-args # print cargo feature flags
```
## Notes
- Compressed **file extension** is always **`.zex`** (format), independent of this file.
- Package-manager binary name `zex` is unrelated; this tool is **`zexc`**.
- Prefer `rlib = true` unless you only ship a C `.so`/`.a` and never run `cargo test` in-tree.