package ninja_utils

  1. Overview
  2. Docs

This library contains the implementations of utility functions used to generate Ninja build files in OCaml with almost no dependencies -- it only depends on Re. It's currently developed to be used by Clerk, the Catala build system. Therefore, the library supports only very basic features required by Clerk.

What is Ninja?

Ninja is a low-level build system. It's designed to have its input files (build.ninja) generated by a higher-level build system, and to run builds as fast as possible by supporting native cross-platform (Windows and Unix) parallel builds.

See the manual for more details.

Ninja expressions

module Var : sig ... end

Ninja variable names, distinguishing binding name ("x") from references in expressions ("$x")

module Expr : sig ... end

Helper module to build ninja expressions.

module Binding : sig ... end

Ninja rules

module Rule : sig ... end

Helper module to build ninja rules.

Ninja builds

module Build : sig ... end

Helper module to build ninja build statements.

module Default : sig ... end
type def =
  1. | Comment of string
  2. | Binding of Binding.t
  3. | Rule of Rule.t
  4. | Build of Build.t
  5. | Default of Default.t
val comment : string -> def
val binding : Var.t -> Expr.t -> def
val rule : ?vars:Binding.t list -> string -> command:Expr.t -> description:Expr.t -> def
val build : ?inputs:Expr.t -> ?implicit_in:Expr.t -> outputs:Expr.t -> ?implicit_out:Expr.t -> ?vars:(Var.t * Expr.t) list -> string -> def
val default : Expr.t -> def
val format_def : Stdlib.Format.formatter -> def -> unit
type ninja = def Stdlib.Seq.t
val format : Stdlib.Format.formatter -> ninja -> unit
OCaml

Innovation. Community. Security.