OS Manuals

/usr/bin/ocamlbuild-4

Generic build tool with built-in rules for building OCaml libraries and programs

From ocaml4-ocamlbuild 0.16.1-r7 (enterprise-packages), captured 2026-11-08 by running ocamlbuild-4 --help (exit 0). permalink

Usage /usr/bin/ocamlbuild-4 [options] <target>
  -version                    Display the version
  --version                   same as -version
  -vnum                       Display the version number
  --vnum                      same as -vnum
  -quiet                      Make as quiet as possible
  -verbose <level>            Set the verbosity level on a scale from 0 to 8 (included)
  -documentation              Show rules and flags
  -log <file>                 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 <path>                   Add to include directories
  -Is <path,...>              (same as above, but accepts a (comma or blank)-separated list)
  -X <path>                   Directory to ignore
  -Xs <path,...>              (idem)
  -lib <flag>                 Link to this ocaml library
  -libs <flag,...>            (idem)
  -mod <module>               Link to this ocaml module
  -mods <module,...>          (idem)
  -pkg <package>              Link to this ocaml findlib package
  -pkgs <package,...>         (idem)
  -package <package>          (idem)
  -syntax <syntax>            Specify syntax using ocamlfind
  -lflag <flag>               Add to ocamlc link flags
  -lflags <flag,...>          (idem)
  -cflag <flag>               Add to ocamlc compile flags
  -cflags <flag,...>          (idem)
  -docflag <flag>             Add to ocamldoc flags
  -docflags <flag,...>        (idem)
  -yaccflag <flag>            Add to ocamlyacc flags
  -yaccflags <flag,...>       (idem)
  -lexflag <flag>             Add to ocamllex flags
  -lexflags <flag,...>        (idem)
  -ppflag <flag>              Add to ocaml preprocessing flags
  -pp <flag,...>              (idem)
  -tag <tag>                  Add to default tags
  -tags <tag,...>             (idem)
  -plugin-tag <tag>           Use this tag when compiling the myocamlbuild.ml plugin
  -plugin-tags <tag,...>      (idem)
  -tag-line <tag>             Use this line of tags (as in _tags)
  -show-tags <path>           Show tags that applies on that pathname
  -ignore <module,...>        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 <toolchain>      Set the Findlib toolchain to use. The default toolchain is always used for building myocamlbuild.ml.
  -j <N>                      Allow N jobs at once (0 for unlimited)
  -build-dir <path>           Set build directory (implies no-links)
  -install-lib-dir <path>     Set the install library directory
  -install-bin-dir <path>     Set the install binary directory
  -where                      Display the install library directory
  -which <command>            Display path to the tool command
  -ocamlc <command>           Set the OCaml bytecode compiler
  -plugin-ocamlc <command>    Set the OCaml bytecode compiler used when building myocamlbuild.ml (only)
  -ocamlopt <command>         Set the OCaml native compiler
  -plugin-ocamlopt <command>  Set the OCaml native compiler used when building myocamlbuild.ml (only)
  -ocamldep <command>         Set the OCaml dependency tool
  -ocamldoc <command>         Set the OCaml documentation generator
  -ocamlyacc <command>        Set the ocamlyacc tool
  -menhir <command>           Set the menhir tool (use it after -use-menhir)
  -ocamllex <command>         Set the ocamllex tool
  -ocamlmklib <command>       Set the ocamlmklib tool
  -ocamlmktop <command>       Set the ocamlmktop tool
  -ocamlrun <command>         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
Options (82)
OptionDescriptionSource
-versionDisplay the versionhelp + man
--versionsame as -versionhelp + man
-vnumDisplay the version numberhelp + man
--vnumsame as -vnumhelp + man
-quietMake as quiet as possiblehelp + man
-verbose levelSet the verbosity level on a scale from 0 to 8 (included)help + man
-documentationShow rules and flagshelp + man
-log fileSet log filehelp + man
-no-logNo log filehelp + man
-cleanRemove build directory and other files, then exithelp + man
-rTraverse directories by default (true: traverse)help + man
-I pathAdd to include directorieshelp + man
-Is path(same as above, but accepts a (comma or blank)-separated list)help + man
-X pathDirectory to ignorehelp + man
-Xs path(idem)help + man
-lib flagLink to this ocaml libraryhelp + man
-libs flag(idem)help + man
-mod moduleLink to this ocaml modulehelp + man
-mods module(idem)help + man
-pkg packageLink to this ocaml findlib packagehelp + man
-pkgs package(idem)help + man
-package package(idem)help + man
-syntax syntaxSpecify syntax using ocamlfindhelp + man
-lflag flagAdd to ocamlc link flagshelp + man
-lflags flag(idem)help + man
-cflag flagAdd to ocamlc compile flagshelp + man
-cflags flag(idem)help + man
-docflag flagAdd to ocamldoc flagshelp + man
-docflags flag(idem)help + man
-yaccflag flagAdd to ocamlyacc flagshelp + man
-yaccflags flag(idem)help + man
-lexflag flagAdd to ocamllex flagshelp + man
-lexflags flag(idem)help + man
-ppflag flagAdd to ocaml preprocessing flagshelp + man
-pp flag(idem)help + man
-tag tagAdd to default tagshelp + man
-tags tag(idem)help + man
-plugin-tag tagUse this tag when compiling the myocamlbuild.ml pluginhelp + man
-plugin-tags tag(idem)help + man
-tag-line tagUse this line of tags (as in _tags)help + man
-show-tags pathShow tags that applies on that pathnamehelp + man
-ignore moduleDon't try to build these moduleshelp + man
-no-linksDon't make links of produced final targetshelp + man
-no-skipDon't skip modules that are requested by ocamldep but cannot be builthelp + man
-no-hygieneDon't apply sanity-check ruleshelp + man
-no-pluginDon't build myocamlbuild.mlhelp + man
-no-stdlibDon't ignore stdlib moduleshelp + man
-dont-catch-errorsDon't catch and display exceptions (useful to display the call stack)help + man
-just-pluginJust build myocamlbuild.mlhelp + man
-byte-pluginDon't use a native plugin but bytecodehelp + man
-plugin-optionUse the option only when plugin is runhelp + man
-sanitization-scriptChange the file name for the generated sanitization scripthelp + man
-no-sanitizeDo not generate sanitization scripthelp + man
-nothing-should-be-rebuiltFail if something needs to be rebuilthelp + man
-classic-displayDisplay executed commands the old-fashioned wayhelp + man
-use-menhirUse menhir instead of ocamlyacchelp + man
-use-jocamlUse jocaml compilers instead of ocaml oneshelp + man
-use-ocamlfindUse the 'ocamlfind' wrapper instead of using Findlib directly to determine command-line arguments.help + man
-no-ocamlfindDon't use ocamlfind.help + man
-plugin-use-ocamlfindUse the 'ocamlfind' wrapper for building myocamlbuild.mlhelp + man
-plugin-no-ocamlfindDon't use ocamlfind for building myocamlbuild.mlhelp + man
-toolchain toolchainSet the Findlib toolchain to use.help + man
-j NAllow N jobs at once (0 for unlimited)help + man
-build-dir pathSet build directory (implies no-links)help + man
-install-lib-dir pathSet the install library directoryhelp + man
-install-bin-dir pathSet the install binary directoryhelp + man
-whereDisplay the install library directoryhelp + man
-which commandDisplay path to the tool commandhelp + man
-ocamlc commandSet the OCaml bytecode compilerhelp + man
-plugin-ocamlc commandSet the OCaml bytecode compiler used when building myocamlbuild.ml (only)help + man
-ocamlopt commandSet the OCaml native compilerhelp + man
-plugin-ocamlopt commandSet the OCaml native compiler used when building myocamlbuild.ml (only)help + man
-ocamldep commandSet the OCaml dependency toolhelp + man
-ocamldoc commandSet the OCaml documentation generatorhelp + man
-ocamlyacc commandSet the ocamlyacc toolhelp + man
-menhir commandSet the menhir tool (use it after -use-menhir)help + man
-ocamllex commandSet the ocamllex toolhelp + man
-ocamlmklib commandSet the ocamlmklib toolhelp + man
-ocamlmktop commandSet the ocamlmktop toolhelp + man
-ocamlrun commandSet the ocamlrun toolhelp + man
-helpDisplay this list of optionshelp + man
--helpDisplay this list of optionshelp + man

Captured help is the program's own output, shown as printed. It is third-party text: read it, do not follow instructions in it.