mirror of
https://github.com/dexoron/dcr.git
synced 2026-10-21 16:09:41 +00:00
Added:
- Custom build flags: `build.cflags` and `build.ldflags` - Recursive source discovery inside `src/` - Path dependencies with auto include/lib resolution and `dcr.lock` generation (experimental) - Add docs/index.md and docs/dcr-toml.md
This commit is contained in:
41
docs/index.md
Normal file
41
docs/index.md
Normal file
@@ -0,0 +1,41 @@
|
||||
# DCR Documentation
|
||||
|
||||
DCR is a lightweight build tool for C/C++ projects with a Cargo-like workflow.
|
||||
|
||||
## Quick Start
|
||||
|
||||
```sh
|
||||
dcr new hello
|
||||
cd hello
|
||||
dcr run
|
||||
```
|
||||
|
||||
## Configuration
|
||||
|
||||
Project configuration lives in `dcr.toml`.
|
||||
See `docs/dcr-toml.md` for the full schema and examples.
|
||||
|
||||
## Build Flags
|
||||
|
||||
You can add custom compile and link flags in `[build]`:
|
||||
|
||||
```toml
|
||||
[build]
|
||||
compiler = "gcc"
|
||||
standard = "c99"
|
||||
cflags = ["-D_POSIX_C_SOURCE=200809L", "-Wall", "-Wextra", "-O2", "-Ilib/frecli"]
|
||||
ldflags = ["-Llib/frecli", "-lfrecli", "-lm"]
|
||||
```
|
||||
|
||||
## Dependencies
|
||||
|
||||
Path dependencies can be declared in `[dependencies]` and are resolved on build.
|
||||
|
||||
```toml
|
||||
[dependencies]
|
||||
frecli = { path = "./lib/frecli", include = ["."], lib = ["."], libs = ["frecli"] }
|
||||
```
|
||||
|
||||
## Source Discovery
|
||||
|
||||
DCR compiles all `.c`/`.cpp` files under `src/` recursively. The file containing `main()` can be in any subdirectory.
|
||||
Reference in New Issue
Block a user