Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help


example

Our example is a C project that we want to compile. You will find the sources of the project in sources of the C project.

To build this project, instead of writing a Makefile, we write our own tool, using the yamake crate. You will find the sources of this tool in sources of the demo tool


running the example

cargo run --example project_C -- -s demo_projects -b sandbox

This will:

  1. Copy source files from demo_projects to sandbox
  2. Scan C files for #include directives and add dependency edges
  3. Build all targets in parallel where possible

node statuses

After a build, each node has one of these statuses:

  • Initial: Not processed yet
  • Mounted: Source file copied to sandbox
  • MountedFailed: Failed to copy source
  • Running: Build in progress
  • Build: Successfully built
  • BuildFailed: Build failed
  • AncestorFailed: Skipped because a dependency failed

error handling

When a build fails:

  • The failing node gets BuildFailed status
  • All dependent nodes get AncestorFailed status
  • make() returns false