Did you know ... Search Documentation:
Pack ninja -- README.md

Ninja build system generator

This module contains helper dcg predicates to generate ninja build files akin to the ninja_syntax.py python module distributed by ninja. You can use these predicates if you want to generate your own build.ninja build file.

Example usage:

build_graph -->
  rule(cp, "cp $in $out"),
  build(["input.txt"], cp, ["output.txt"]).

main -->
  phrase(build_graph, L),
  open("build.ninja", write, Stream),
  string_codes(S, L),
  write(Stream, S),

Then build.ninja contains the following build specification:

rule cp
  command = cp $in $out

build input.txt: cp output.txt

See the ninja build format documentation for generating more complex build files.