package b0
Install
dune-project
Dependency
Authors
Maintainers
Sources
sha512=e9aa779e66c08fc763019f16d4706f465d16c05d6400b58fbd0313317ef33ddea51952e2b058db28e65f7ddb7012f328c8bf02d8f1da17bb543348541a2587f0
doc/b0.file/B0_ocaml/Compile/index.html
Module B0_ocaml.CompileSource
Compiling.
Basic
val c_to_o :
?post_exec:(B0_zero.Op.t -> unit) ->
?k:(B0_zero.Op.t -> int -> unit) ->
B0_memo.t ->
comp:B0_memo.Tool.t ->
opts:B0_std.Cmd.t ->
reads:B0_std.Fpath.t list ->
c:B0_std.Fpath.t ->
o:B0_std.Fpath.t ->
B0_std.Fpath.t listc_to_o m ~comp ~opts ~reads ~c ~o compiles the C file c to the object file o with options opts and using compiler comp. It assumes the compilation depends on C include header files reads whose parent directories are added as -I options. Returns the written files.
val mli_to_cmi :
?post_exec:(B0_zero.Op.t -> unit) ->
?k:(B0_zero.Op.t -> int -> unit) ->
and_cmti:bool ->
B0_memo.t ->
comp:B0_memo.Tool.t ->
opts:B0_std.Cmd.t ->
reads:B0_std.Fpath.t list ->
mli:B0_std.Fpath.t ->
o:B0_std.Fpath.t ->
B0_std.Fpath.t listmli_to_cmi ~and_cmti m ~comp ~opts ~reads ~mli ~o compiles the file mli to the cmi file o and, if and_cmti is true, to the cmti file Fpath.(o -+ ".cmti") with options opts and using compiler comp. It assumes the compilation depends on cmi files reads whose parent directories are added as -I options. Returns the written files.
val ml_to_cmo :
?post_exec:(B0_zero.Op.t -> unit) ->
?k:(B0_zero.Op.t -> int -> unit) ->
and_cmt:bool ->
B0_memo.t ->
opts:B0_std.Cmd.t ->
reads:B0_std.Fpath.t list ->
has_cmi:bool ->
ml:B0_std.Fpath.t ->
o:B0_std.Fpath.t ->
B0_std.Fpath.t listml_to_cmo ~and_cmt m ~opts ~reads ~has_cmi ~ml ~o compiles the file ml to cmo file o and, if and_cmt is true, to the cmt file Fpath.(o -+ ".cmt") with options opts. It assumes the compilation depends on the cmi files reads whose parent directories are added as -I options. has_cmi indicates whether the ml file already a corresponding cmi file, in which case it should be in reads (FIXME specify path directly ?).
val ml_to_cmx :
?post_exec:(B0_zero.Op.t -> unit) ->
?k:(B0_zero.Op.t -> int -> unit) ->
and_cmt:bool ->
B0_memo.t ->
opts:B0_std.Cmd.t ->
reads:B0_std.Fpath.t list ->
has_cmi:bool ->
ml:B0_std.Fpath.t ->
o:B0_std.Fpath.t ->
B0_std.Fpath.t listml_to_cmx ~and_cmt m ~opts ~reads ~has_cmi ~ml ~o ~and_cmt compiles the file ml to cmx file o and, if and_cmt is true, to the cmt file Fpath.(o -+ ".cmt") with options opts. It assumes the compilation depends on the cmi and cmx files reads whose parent directories are added as -I options. has_cmi indicates whether the ml file already has a corresponding cmi file, in which case it should be in reads (FIXME specify path directly ?).
val ml_to_impl :
?post_exec:(B0_zero.Op.t -> unit) ->
?k:(B0_zero.Op.t -> int -> unit) ->
B0_memo.t ->
code:Code.t ->
opts:B0_std.Cmd.t ->
reads:B0_std.Fpath.t list ->
has_cmi:bool ->
ml:B0_std.Fpath.t ->
o:B0_std.Fpath.t ->
and_cmt:bool ->
B0_std.Fpath.t listModsrc convenience
A few helpers that deal directly with the Modsrc abstraction.
val modsrc_intf :
and_cmti:bool ->
B0_memo.t ->
comp:B0_memo.Tool.t ->
opts:B0_std.Cmd.t ->
requires:Lib.t list ->
modsrcs:Modsrc.t Modname.Map.t ->
Modsrc.t ->
B0_std.Fpath.t listmodsrc_intf m ~opts ~requires ~modsrcs ~and_cmti src compiles the interface of src with options opts and compiler comp assuming its dependencies are in modsrcs and requires. If and_cmti is true the cmti file is also produced. If src has no .mli this is a nop. Returns the written files (if any).
val modsrc_impl :
and_cmt:bool ->
B0_memo.t ->
code:Code.t ->
opts:B0_std.Cmd.t ->
requires:Lib.t list ->
modsrcs:Modsrc.t Modname.Map.t ->
Modsrc.t ->
B0_std.Fpath.t listmodsrc_impl m ~code ~opts ~requires ~modsrcs src compile the implementation of src with option opts to code code asuming it dependencies are in modsrc. If and_cmt is true the cmt file is also produced. If src has no .ml this is a nop. Returns the written files (if any).
val intfs :
and_cmti:bool ->
B0_memo.t ->
comp:B0_memo.Tool.t ->
opts:B0_std.Cmd.t ->
requires:Lib.t list ->
modsrcs:Modsrc.t Modname.Map.t ->
B0_std.Fpath.t listintfs iters modsrc_intf over the elements of modsrcs.
val impls :
and_cmt:bool ->
B0_memo.t ->
code:Code.t ->
opts:B0_std.Cmd.t ->
requires:Lib.t list ->
modsrcs:Modsrc.t Modname.Map.t ->
B0_std.Fpath.t listimpls iters modsrc_impl over the elements of modsrcs.