.\"***********************************************************************) .\"* *) .\"* ocamlbuild *) .\"* *) .\"* Nicolas Pouillard, Berke Durak, projet Gallium, INRIA Rocquencourt *) .\"* *) .\"* Copyright 2007 Institut National de Recherche en Informatique et *) .\"* en Automatique. All rights reserved. This file is distributed *) .\"* under the terms of the Q Public License version 1.0. *) .\"* *) .\"***********************************************************************) .\" .TH OCAMLBUILD 1 .SH NAME ocamlbuild \- The OCaml project compilation tool .SH SYNOPSIS .B ocamlbuild [ .B \-Is \ dir1,... ] [ .BI \-libs \ lib1,... ] [ .BI \-lflags \ flag1,... ] [ .BI \-pp \ flags ] [ .BI \-tags \ tag1,... ] [ .B \-j \ parallel-jobs ] .I target.native [ .B \-\- arg1 arg2 ... ] .I (same options) .SH DESCRIPTION .BR ocamlbuild (1) orchestrates the compilation process of your OCaml project. It is similar in function to .BR make (1) except that it is tailor-made to automatically compile most OCaml projects with very little user input. .BR ocamlbuild should be invoked in the root of a clean project tree (e.g., with no leftover compilation files). Given one or more targets to compile, it scans the required subdirectories to gather information about the various files present, running tools such as .BR ocamldep (1) to extract dependency information, and gathering optional files that fine-tune its behaviour. Target names are very significant. .SH TARGET NAMES .BR ocamlbuild uses a set of target naming conventions to select the kind of objects to produce. Target names are of the form .BR base.extension where .BR base is usually the name of the underlying OCaml module and .BR extension denotes the kind of object to produce from that file -- a byte code executable, a native executable, documentation... Of course extensions such as .BR .cmo, .BR .cma, .BR .cmi... map to their usual counterparts. Here is a list of the most important .BR ocamlbuild \&-specific extensions: .TP 2i .B .native Native code executable .TP 2i .B .byte Byte code executable .TP 2i .B .inferred.mli Interface inferred with .BR ocamlc -i .TP 2i .B .docdir/index.html HTML documentation generated with .BR ocamldoc .PP .SH OPTIONS The following command-line options are recognized by .BR ocamlbuild (1). .TP \fB\-version\fR Display the version .TP \fB\-\-version\fR same as \-version .TP \fB\-vnum\fR Display the version number .TP \fB\-\-vnum\fR same as \-vnum .TP \fB\-quiet\fR Make as quiet as possible .TP \fB\-verbose\fR Set the verbosity level on a scale from 0 to 8 (included) .TP \fB\-documentation\fR Show rules and flags .TP \fB\-log\fR Set log file .TP \fB\-no\-log\fR No log file .TP \fB\-clean\fR Remove build directory and other files, then exit .TP \fB\-r\fR Traverse directories by default (true: traverse) .TP \fB\-I\fR Add to include directories .TP \fB\-Is\fR (same as above, but accepts a (comma or blank)\-separated list) .TP \fB\-X\fR Directory to ignore .TP \fB\-Xs\fR (idem) .TP \fB\-lib\fR Link to this ocaml library .TP \fB\-libs\fR (idem) .TP \fB\-mod\fR Link to this ocaml module .TP \fB\-mods\fR (idem) .TP \fB\-pkg\fR Link to this ocaml findlib package .TP \fB\-pkgs\fR (idem) .TP \fB\-package\fR (idem) .TP \fB\-syntax\fR Specify syntax using ocamlfind .TP \fB\-lflag\fR Add to ocamlc link flags .TP \fB\-lflags\fR (idem) .TP \fB\-cflag\fR Add to ocamlc compile flags .TP \fB\-cflags\fR (idem) .TP \fB\-docflag\fR Add to ocamldoc flags .TP \fB\-docflags\fR (idem) .TP \fB\-yaccflag\fR Add to ocamlyacc flags .TP \fB\-yaccflags\fR (idem) .TP \fB\-lexflag\fR Add to ocamllex flags .TP \fB\-lexflags\fR (idem) .TP \fB\-ppflag\fR Add to ocaml preprocessing flags .TP \fB\-pp\fR (idem) .TP \fB\-tag\fR Add to default tags .TP \fB\-tags\fR (idem) .TP \fB\-plugin\-tag\fR Use this tag when compiling the myocamlbuild.ml plugin .TP \fB\-plugin\-tags\fR (idem) .TP \fB\-tag\-line\fR Use this line of tags (as in _tags) .TP \fB\-show\-tags\fR Show tags that applies on that pathname .TP \fB\-ignore\fR Don't try to build these modules .TP \fB\-no\-links\fR Don't make links of produced final targets .TP \fB\-no\-skip\fR Don't skip modules that are requested by ocamldep but cannot be built .TP \fB\-no\-hygiene\fR Don't apply sanity\-check rules .TP \fB\-no\-plugin\fR Don't build myocamlbuild.ml .TP \fB\-no\-stdlib\fR Don't ignore stdlib modules .TP \fB\-dont\-catch\-errors\fR Don't catch and display exceptions (useful to display the call stack) .TP \fB\-just\-plugin\fR Just build myocamlbuild.ml .TP \fB\-byte\-plugin\fR Don't use a native plugin but bytecode .TP \fB\-plugin\-option\fR Use the option only when plugin is run .TP \fB\-sanitization\-script\fR Change the file name for the generated sanitization script .TP \fB\-no\-sanitize\fR Do not generate sanitization script .TP \fB\-nothing\-should\-be\-rebuilt\fR Fail if something needs to be rebuilt .TP \fB\-classic\-display\fR Display executed commands the old\-fashioned way .TP \fB\-use\-menhir\fR Use menhir instead of ocamlyacc .TP \fB\-use\-jocaml\fR Use jocaml compilers instead of ocaml ones .TP \fB\-use\-ocamlfind\fR Use the 'ocamlfind' wrapper instead of using Findlib directly to determine command\-line arguments. Use \-no\-ocamlfind to disable. Implies \-plugin\-use\-ocamlfind. .TP \fB\-no\-ocamlfind\fR Don't use ocamlfind. Implies \-plugin\-no\-ocamlfind. .TP \fB\-plugin\-use\-ocamlfind\fR Use the 'ocamlfind' wrapper for building myocamlbuild.ml .TP \fB\-plugin\-no\-ocamlfind\fR Don't use ocamlfind for building myocamlbuild.ml .TP \fB\-toolchain\fR Set the Findlib toolchain to use. The default toolchain is always used for building myocamlbuild.ml. .TP \fB\-j\fR Allow N jobs at once (0 for unlimited) .TP \fB\-build\-dir\fR Set build directory (implies no\-links) .TP \fB\-install\-lib\-dir\fR Set the install library directory .TP \fB\-install\-bin\-dir\fR Set the install binary directory .TP \fB\-where\fR Display the install library directory .TP \fB\-which\fR Display path to the tool command .TP \fB\-ocamlc\fR Set the OCaml bytecode compiler .TP \fB\-plugin\-ocamlc\fR Set the OCaml bytecode compiler used when building myocamlbuild.ml (only) .TP \fB\-ocamlopt\fR Set the OCaml native compiler .TP \fB\-plugin\-ocamlopt\fR Set the OCaml native compiler used when building myocamlbuild.ml (only) .TP \fB\-ocamldep\fR Set the OCaml dependency tool .TP \fB\-ocamldoc\fR Set the OCaml documentation generator .TP \fB\-ocamlyacc\fR Set the ocamlyacc tool .TP \fB\-menhir\fR Set the menhir tool (use it after \-use\-menhir) .TP \fB\-ocamllex\fR Set the ocamllex tool .TP \fB\-ocamlmklib\fR Set the ocamlmklib tool .TP \fB\-ocamlmktop\fR Set the ocamlmktop tool .TP \fB\-ocamlrun\fR Set the ocamlrun tool .TP \fB\-\-\fR Stop argument processing, remaining arguments are given to the user program .TP \fB\-help\fR Display this list of options .TP \fB\-\-help\fR Display this list of options .PP .SH SEE ALSO The .BR ocamlbuild manual, .BR ocaml (1), .BR make (1). .br .I The OCaml user's manual, chapter "Batch compilation".