- Workspace support (`[workspace]` with deps ordering)
- `clean --all` for workspace members
Changed:
- Project root discovery for `build/run/clean` (searches parent dirs)
- Workspace paths are excluded from root source scan
- Build output now uses a Cargo-style `Compiling <name> v<version>` line
- Build time now reports total time for the whole build stage (workspace included)
- Cache hits are silent (no compile line when nothing is rebuilt)
- Safer build cache: fingerprints include headers and resolved library files
This commit is contained in:
2026-03-06 21:58:54 +08:00
parent 617ba85442
commit 4ea6267a88
26 changed files with 1123 additions and 213 deletions

View File

@@ -113,6 +113,7 @@ Run manually:
### `dcr clean`
Removes the `target` directory in the project root.
Use `dcr clean --all` in a workspace root to clean all member projects.
## Build Profiles
Two profiles are supported:
@@ -157,6 +158,15 @@ ldflags = ["-lm"]
[dependencies]
```
Workspace example:
```toml
[workspace]
kernel = { path = "src/kernel", deps = ["core", "userspace"] }
core = { path = "src/core", deps = ["userspace"] }
userspace = { path = "src/userspace" }
```
Path dependencies are supported. DCR will resolve them on build and generate `dcr.lock`.
Incremental build note: object files are rebuilt when source `.c/.cpp` files change. Header dependency tracking is not implemented yet.