|
Packit |
9ee409 |
# OCamlbuild #
|
|
Packit |
9ee409 |
|
|
Packit |
9ee409 |
OCamlbuild is a generic build tool, that has built-in rules for
|
|
Packit |
9ee409 |
building OCaml library and programs.
|
|
Packit |
9ee409 |
|
|
Packit |
9ee409 |
OCamlbuild was distributed as part of the OCaml distribution for OCaml
|
|
Packit |
9ee409 |
versions between 3.10.0 and 4.02.3. Starting from OCaml 4.03, it is
|
|
Packit |
9ee409 |
now released separately.
|
|
Packit |
9ee409 |
|
|
Packit |
9ee409 |
Your should refer to the [OCambuild
|
|
Packit |
9ee409 |
manual](https://github.com/ocaml/ocamlbuild/blob/master/manual/manual.adoc)
|
|
Packit |
9ee409 |
for more informations on how to use ocamlbuild.
|
|
Packit |
9ee409 |
|
|
Packit |
9ee409 |
## Automatic Installation ##
|
|
Packit |
9ee409 |
|
|
Packit |
9ee409 |
With [opam](https://opam.ocaml.org/):
|
|
Packit |
9ee409 |
|
|
Packit |
9ee409 |
```
|
|
Packit |
9ee409 |
opam install ocamlbuild
|
|
Packit |
9ee409 |
```
|
|
Packit |
9ee409 |
|
|
Packit |
9ee409 |
If you are testing a not yet released version of OCaml, you may need
|
|
Packit |
9ee409 |
to use the development version of OCamlbuild. With opam:
|
|
Packit |
9ee409 |
|
|
Packit |
9ee409 |
```
|
|
Packit |
9ee409 |
opam pin add ocamlbuild --kind=git "https://github.com/ocaml/ocamlbuild.git#master"
|
|
Packit |
9ee409 |
```
|
|
Packit |
9ee409 |
|
|
Packit |
9ee409 |
## Compilation from source ##
|
|
Packit |
9ee409 |
|
|
Packit |
9ee409 |
We assume GNU make, which may be named `gmake` on your system.
|
|
Packit |
9ee409 |
|
|
Packit |
9ee409 |
1. Configure.
|
|
Packit |
9ee409 |
```
|
|
Packit |
9ee409 |
make configure
|
|
Packit |
9ee409 |
```
|
|
Packit |
9ee409 |
|
|
Packit |
9ee409 |
The installation location is determined by the installation location
|
|
Packit |
9ee409 |
of the ocaml compiler. You can set the following configuration
|
|
Packit |
9ee409 |
variables (`make configure VAR=foo`):
|
|
Packit |
9ee409 |
|
|
Packit |
9ee409 |
- `OCAMLBUILD_{PREFIX,BINDIR,LIBDIR}` will use opam or
|
|
Packit |
9ee409 |
ocaml/ocamlfind's settings by default; see `configure.make` for the
|
|
Packit |
9ee409 |
precise initialization logic.
|
|
Packit |
9ee409 |
|
|
Packit |
9ee409 |
- `OCAML_NATIVE`: should be `true` if native compilation is available
|
|
Packit |
9ee409 |
on your machine, `false` otherwise
|
|
Packit |
9ee409 |
|
|
Packit |
9ee409 |
2. Compile the sources.
|
|
Packit |
9ee409 |
```
|
|
Packit |
9ee409 |
make
|
|
Packit |
9ee409 |
```
|
|
Packit |
9ee409 |
|
|
Packit |
9ee409 |
3. Install.
|
|
Packit |
9ee409 |
```
|
|
Packit |
9ee409 |
make install
|
|
Packit |
9ee409 |
```
|
|
Packit |
9ee409 |
|
|
Packit |
9ee409 |
You can also clean the compilation results with `make clean`, and
|
|
Packit |
9ee409 |
uninstall a manually-installed OCamlbuild with `make uninstall`.
|