Mllib

From Gallium

Jump to: navigation, search

A .cma or .cmxa file is an archive of .cmo or .cmx files. It can contain any list of .cmo or .cmx, with or without their dependencies. Thus, Ocamlbuild cannot guess which files you want in your library. To make Ocamlbuild build .cma or .cmxa files you have to write a .mllib file with the list of Modules to link. For instance:

$ cat parse.mllib
Parser
Lexer

Now, if you call Ocamlbuild using the following command:

ocamlbuild parse.cma

You will get your .cma file in your "_build" directory and a link to it from your main directory.

If you want to use your library inside your project with one single call to Ocamlbuild, you have to make a plugin. See using internal libraries.

Personal tools
Espace privé