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