package b0

  1. Overview
  2. Docs
Software construction and deployment kit

Install

dune-project
 Dependency

Authors

Maintainers

Sources

b0-0.0.6.tbz
sha512=e9aa779e66c08fc763019f16d4706f465d16c05d6400b58fbd0313317ef33ddea51952e2b058db28e65f7ddb7012f328c8bf02d8f1da17bb543348541a2587f0

doc/b0.file/B0_ocaml/index.html

Module B0_ocamlSource

ocaml support.

Toolchain

Sourcemodule Tool : sig ... end

OCaml toolchain tools.

Sourcemodule Code : sig ... end

OCaml compiler code generation specification.

Sourcemodule Conf : sig ... end

Toolchain configuration.

Modules

Sourcemodule Modname : sig ... end

Module names

Sourcemodule Modref : sig ... end

Module digested references.

Sourcemodule Modsrc : sig ... end

Module sources.

Libraries

Sourcemodule Libname : sig ... end

Library names.

Sourceval libname : string -> Libname.t

libname n is n as an OCaml library name. This is a shortcut for Libname.v and should be used in B0.ml files

Sourcemodule Lib : sig ... end

Library information.

Sourcemodule Libresolver : sig ... end

Library resolvers.

Build units

Executables

Sourceval exe : ?wrap:(B0_unit.build_proc -> B0_unit.build_proc) -> ?doc:string -> ?meta:B0_meta.t -> ?c_requires:B0_std.Cmd.t -> ?requires:Libname.t list -> ?public:bool -> ?name:string -> string -> srcs:B0_srcs.sels -> B0_unit.t

exe tool_name is a build unit for an executable tool named tool_name (without the platform specific extension).

  • public indicates whether the bare name is made available unscoped outside the unit definition scope (defaults to false).
  • doc is the unit doc string.
  • meta is the initial metadata.
  • c_requires FIXME hack, something more sensitive should be done. This each of these options are passed as -cclib options.
  • requires are the OCaml libraries required to compile the executable.
  • name is the name of the unit (defaults to n).
  • srcs are the executable sources. All files with extension .ml, .mli, .c and .h are considered for compiling and linking the executable.
  • wrap allows to extend the build procedure you must call the given build procedure. TODO maybe remove once we have good Build fragments.
Sourceval script : ?wrap:(B0_unit.build_proc -> B0_unit.build_proc) -> ?doc:string -> ?meta:B0_meta.t -> ?public:bool -> ?name:string -> B0_std.Fpath.t -> B0_unit.t

script file is a build unit for an OCaml script in file. The build unit simply checks that it typechecks and is runnable. Due to upstream limitations this is a hack. You should invoke your main as:

let () = if !Sys.interactive then () else main ()
  • public indicates whether the basename of file is made available unscoped outside the unit definition scope (defaults to false).
  • doc is the unit doc string
  • meta is the initial metadata
  • wrap allows to extend the build procedure. You must call the given build procedure.

FIXME file should become a src so that it can be generated.

Sourceval test : ?wrap:(B0_unit.build_proc -> B0_unit.build_proc) -> ?doc:string -> ?meta:B0_meta.t -> ?requires:Libname.t list -> ?name:string -> ?run:bool -> ?long:bool -> ?srcs:B0_srcs.sel list -> B0_std.Fpath.t -> B0_unit.t

test file is a test for an OCaml .ml file (and additional srcs if specified). This is just exe with added metadata predefined for a test and a name derived from the basename of file if unspecified:

Libraries

Sourceval lib : ?wrap:(B0_unit.build_proc -> B0_unit.build_proc) -> ?doc:string -> ?meta:B0_meta.t -> ?c_requires:B0_std.Cmd.t -> ?requires:Libname.t list -> ?exports:Libname.t list -> ?public:bool -> ?name:string -> Libname.t -> srcs:B0_srcs.sels -> B0_unit.t

lib n ~srcs is a built unit for a library named n made of sources srcs.

  • public indicates whether the library name n is made available unscoped outside the scope of the unit definition (defaults to true)
  • doc is the unit doc string.
  • meta is the initial metadata.
  • c_requires FIXME hack, something more sensitive should be done. This each of these options are passed as -cclib options.
  • requires are the OCaml libraries required to compile the library.
  • exports are the OCaml libraries represented by this library.
  • name is the name of the build unit (default to n with . substituted by -)
  • srcs are the library sources. extension .ml, .mli, .c and .h are considered for compiling and linking the executable.
  • wrap allows to extend the build procedure you must call the given build procedure. TODO maybe remove once we have good Build fragments.
Sourceval deprecated_lib : ?wrap:(B0_unit.build_proc -> B0_unit.build_proc) -> ?doc:string -> ?meta:B0_meta.t -> ?exports:Libname.t list -> ?warning:string -> ?public:bool -> ?name:string -> Libname.t -> B0_unit.t

deprecated_lib n is an empty build unit for a deprecated library named n. Most arguments are like in lib.

Metadata

This is mostly needed if you need to process units or define your own. OCaml units set these key appropriately.

Sourceval tag : bool B0_meta.key

tag indicates the entity is related to OCaml. For example this can be used to select OCaml build units.

c_requires hack for now this simply passes these options as -cclib options.

library on a unit specifies that the unit defines the library with the given name.

FIXME quick hack this should not be in meta, or not.

Sourceval requires : Libname.t list B0_meta.key

requires on a unit specifies the OCaml libraries needed to compile a unit.

Sourceval exports : Libname.t list B0_meta.key

exports on a library build unit specifies that the library exports these libraries.

Build fragments

See TODO.

Toolchain operations

Sourcemodule Compile : sig ... end

Compiling.

Sourcemodule Archive : sig ... end

Archiving.

Linking.

Compiled object information

Sourcemodule Cobj : sig ... end

Compiled object information.

Crunching

Sourcemodule Crunch : sig ... end

Crunching data into OCaml values.

Units

Sourceval unit : B0_unit.t

unit is the .ocaml unit.

See b0 -- .ocaml --help for more information.

Sourceval unit_repl : B0_unit.t

unit_repl is the .ocaml.repl action. The action of this unit forces a byte code build and loads the resulting build in the ocaml toplevel.

See b0 -- .ocaml.repl --help for more information.