module YaM: sig end
Environment / options
|
type
options_t = {
|
ocaml : |
(* | OCaml interpreter | *) |
|
ocamlc : |
(* | OCaml compiler | *) |
|
ocamlopt : |
(* | OCaml native compiler | *) |
|
ocamldep : |
(* | OCaml dependencies generator | *) |
|
ocamldoc : |
(* | OCaml documentation generator | *) |
|
ocamlyacc : |
(* | OCaml parser generator | *) |
|
ocamllex : |
(* | OCaml lexer generator | *) |
|
ocamlglade : |
(* | OCaml glade compiler | *) |
|
ocaml_P4 : |
(* | Preprocessor to use | *) |
|
ocaml_Flags : |
(* | Flags (c, byte, native and link modes) | *) |
|
ocaml_OptFlags : |
(* | Flags for `ocamlopt -c' | *) |
|
ocaml_ByteFlags : |
(* | Flags for `ocamlc -c' | *) |
|
ocaml_LinkFlags : |
(* | Flags for linking | *) |
|
ocaml_Includes : |
(* | Directories to include (with dependencies) | *) |
|
ocaml_ExtIncludes : |
(* | External directories to include (without dependencies) | *) |
|
ocaml_ExtLibraries : |
(* | External Libraries to use | *) |
val options : options_t ref
Initial compiler names (ocamlc, ocamldep...) are taken in the environment (OCAMLC, OCAMLDEP...), or defaults to standard values ("ocamlc", "ocamldep"...).
Initial flags are empty.
val new_scope : 'a Lazy.t -> 'a
Compilation units
|
The way to specify environment and flags is redundant:
?o
argument defaults to the current environment (!options
).type
unit_t
val ocaml_Module : ?o:options_t ->
?flags:string ->
?byte_flags:string ->
?opt_flags:string ->
?pp:string ->
?includes:string list -> ?ext_includes:string list -> string -> unit_t
val ocaml_IModule : ?o:options_t ->
?flags:string ->
?byte_flags:string ->
?opt_flags:string ->
?pp:string ->
?includes:string list -> ?ext_includes:string list -> string -> unit_t
val ocaml_Interface : ?o:options_t ->
?flags:string ->
?byte_flags:string ->
?opt_flags:string ->
?pp:string ->
?includes:string list -> ?ext_includes:string list -> string -> unit_t
val c_Module : ?o:options_t ->
?flags:string -> ?source_deps:string list -> string -> unit_t
source_deps
are the additional source dependencies.
val ocaml_Lexer : ?o:options_t ->
?flags:string ->
?byte_flags:string ->
?opt_flags:string ->
?lex_flags:string ->
?pp:string ->
?includes:string list -> ?ext_includes:string list -> string -> unit_t
val ocaml_Parser : ?o:options_t ->
?flags:string ->
?byte_flags:string ->
?opt_flags:string ->
?yacc_flags:string ->
?pp:string ->
?includes:string list -> ?ext_includes:string list -> string -> unit_t
val ocaml_Glade : ?o:options_t ->
?flags:string ->
?byte_flags:string ->
?opt_flags:string ->
?glade_flags:string ->
?pp:string ->
?includes:string list -> ?ext_includes:string list -> string -> unit_t
val ocaml_Package : ?o:options_t -> string -> unit_t list -> unit_t
The objects defined by the given list of units are packed together,
using the `-pack' OCaml option.
val ocaml_PackageDir : ?o:options_t -> string -> unit_t list Lazy.t -> unit_t
YaM.ocaml_Package
, but assumes that all the files reside in a directory.
ocaml_PackageDir name list
will add the `-I name' flag, and prepend each filename inside
`list' with `name/'.
val ocaml_Library : ?o:options_t ->
?flags:string ->
?byte_flags:string ->
?opt_flags:string ->
?includes:string list ->
?libraries:string list ->
?default:[ `Byte | `Native ] -> string -> unit_t list -> unit_t
val ocaml_Program : ?o:options_t ->
?flags:string ->
?byte_flags:string ->
?opt_flags:string ->
?includes:string list ->
?libraries:string list ->
?default:[ `Byte | `Native ] -> string -> unit_t list -> unit_t
val phony_unit : ?depends:string list -> ?command:string -> string -> unit_t
depends
, and is built with command
.
Entry point
|
val main : ?rebuild:string -> ?deps:string list -> unit_t list -> unit
rebuild
is the command to use in order to compile YaM whenever `Makefile.ml' changed.
(defaults to "ocaml build.ml")deps
is the set of files YaM depends on.
(defaults to "Makefile.ml"
)
Lower level functions
|
type
project_t
val project : ?rebuild:string -> ?deps:string list -> unit_t list -> project_t
rebuild
is the command to use in order to compile YaM whenever `Makefile.ml' changed.
(defaults to "ocaml build.ml")deps
is the set of files YaM depends on.
(defaults to "Makefile.ml"
)val print_deps : bool ref
val print_cmds : bool ref
val build : ?target:string -> project_t -> unit
val clean : project_t -> unit
val sources_of_project : project_t -> string list
val dir : string ref
val generic_unit : ?sources:string list ->
targets:string list ->
?trash:string list ->
?auto_targets:string list ->
?sub_units:unit_t list ->
?pregenerated:string list ->
?objects:string * string ->
dependencies:(native:bool -> string -> string list) ->
?dep_files:(string -> string list) ->
compile_cmd:(string -> string * string list) -> unit -> unit_t
sources
is the set of source filestargets
is the set of targets handled by the unittrash
is the set of trash files generated by the unitauto_targets
is the subset of targets whose building is done, when YaM is called without argumentssub_units
is a set of "encapsulated" unitspregenerated
is a set of file to "pre-create" automatically if they don't exists (useful for generated sources files and ocamldep)objects
are the objects to link when building an OCaml package/library/program. It is a pair since linking can be done
either in native mode or bytecode mode : (nat_obj, byte_obj)
.dependencies ~native target
must list the files target
depends on, in mode specified by native
.dep_files target
are the files the previous call depends on (for dependencies caching).compile_cmd target
must return a couple (cmd,out)
, where cmd
is the command to use for building target
, and out
is
the list of files that this command may create or modify.sources = auto_targets = sub_units = pregenerated = []
trash = targets
objects = None
(no object to link)depfiles = (fun _ -> [])
(no caching)ocaml_PackageDir
, you must set the current directory,
using Filename.concat !dir
.
Simple facilities
|
val (^^) : string -> string -> string
val (^=) : string ref -> string -> unit
YaM.(^^)
.val (+=) : 'a list ref -> 'a -> unit
val (@=) : 'a list ref -> 'a list -> unit
val string_of_list : ('a -> string) -> 'a list -> string
YaM.(^^)
.val flatten : string list -> string
YaM.(^^)
.