module MakeMake: sig end
A module for generating makefiles for ocaml projects.
The important targets provided by the generated makefile are:
all, byte, opt, doc, install, install-opt, clean, distclean, tar, bzip2, gzip
Misc Types
type dest_t = [ `bin | `findlib | `lib | `nowhere | `other of string ]
Where/how to install the target
type tool_t = [ `cc
| `ocamlc
| `ocamldoc
| `ocamllex
| `ocamlmklib
| `ocamlmktop
| `ocamlopt
| `ocamlyacc ]
The type of tools that have various control variables, to specify things such as flags
type target_t
The opaque type of a makefile 'target' containing all its metadata. All targets
either handle C code properly or ignore it if appropriate (such as for documentation)
The most important function in the module
val output : ?package:string ->
?version:string ->
?destdir:string ->
?prefix:string ->
?sources:string list ->
?findlibs:string list ->
?libs:string list ->
?includes:string list ->
?findlib_package:string ->
?findlib_installed_files:string list ->
?findlib_installs_opt:bool ->
?flags:(tool_t * string) list ->
?cleaned:string list -> ?debug:bool -> target_t list -> unit
Outputs a Makefile, (and in the futere, META file if applicable). If debug is set, then it
will just spit to stdout so you can peruse the results
Build Targets
val library : ?dest:dest_t ->
?shared:bool ->
?sources:string list ->
?findlibs:string list -> ?libs:string list -> string -> target_t
val executable : ?sources:string list ->
?findlibs:string list ->
?libs:string list -> ?dest:dest_t -> string -> target_t
val toplevel : ?sources:string list ->
?findlibs:string list ->
?libs:string list ->
?dest:dest_t -> ?findlibs:string list -> string -> target_t
A toplevel with the given sources pre-loaded
val documentation : ?findlibs:string list -> ?sources:string list -> string -> target_t
documentation name adds targets name ^ ".html", name ^ ".tex" etc for all
output formats of ocamldoc
val script : ?dest:dest_t -> string -> target_t
A script that is not built, but should be installed somewhere
Convenience functions
val split : string -> string list
Splits a string on whitespace; this is a very common thing to do in order to specify your sources
in a string rather than a list - save some typing :-)
val both : string list -> string list
Expands all file roots X in a list into X.mli and X.ml so you needn't specify both files
for each module
val prefix : string -> string list -> string list
Prefixes all sources files with a string, presumably something like "src/"