OS Manuals

/usr/bin/ocamldep

The core OCaml system: compilers, runtime system, base libraries

From ocaml 5.5.2-r0 (os), captured 2026-11-05 by running ocamldep --help (exit 0). permalink

Usage: ocamldep <options> <files>
Options are:

  -absname  Show absolute filenames in error messages
  -no-absname  Do not try to show absolute filenames in error messages (default)
  -all  Generate dependencies on all files
  -allow-approx  Fallback to a lexer-based approximation on unparsable files
  -as-map  Omit delayed dependencies for module aliases (-no-alias-deps -w -49)
  -debug-map  Dump the delayed dependency map for each map file
  -I <dir>  Add <dir> to the list of include directories
  -H <dir>  Add <dir> to the list of include directories
  -nocwd  Do not add current working directory to the list of include directories
  -impl <f>  Process <f> as a .ml file
  -intf <f>  Process <f> as a .mli file
  -keywords <version+list>  set keywords following the <version+list> spec (see ocamlc)
  -map <f>  Read <f> and propagate delayed dependencies to following files
  -ml-synonym <e>  Consider <e> as a synonym of the .ml extension
  -mli-synonym <e>  Consider <e> as a synonym of the .mli extension
  -modules  Print module dependencies in raw form (not suitable for make)
  -native  Generate dependencies for native-code only (no .cmo files)
  -bytecode  Generate dependencies for bytecode-code only (no .cmx files)
  -one-line  Output one line per file, regardless of the length
  -open <module>  Opens the module <module> before typing
  -plugin <plugin>  (no longer supported)
  -pp <cmd>  Pipe sources through preprocessor <cmd>
  -ppx <cmd>  Pipe abstract syntax trees through preprocessor <cmd>
  -shared  Generate dependencies for native plugin files (.cmxs targets)
  -slash  (Windows) Use forward slash / instead of backslash \ in file paths
  -no-slash  (Windows) Preserve any backslash \ in file paths
  -sort  Sort files according to their dependencies
  -version  Print version and exit
  -vnum  Print version number and exit
  -args <file> Read additional newline separated command line arguments
      from <file>
  -args0 <file> Read additional NUL separated command line arguments from
      <file>
  -help  Display this list of options
  --help  Display this list of options
Options (33)
OptionDescriptionSource
-absnameShow absolute filenames in error messages.help + man
-no-absnameDo not try to show absolute filenames in error messages (default).help + man
-allGenerate dependencies on all required files, rather than assuming implicit dependencies.help + man
-allow-approxAllow falling back on a lexer-based approximation when parsing fails.help + man
-as-mapFor the following files, do not include delayed dependencies for module aliases.help + man
-debug-mapDump the delayed dependency map for each map file.help + man
-I dirAdd the given directory to the list of directories searched for source files.help + man
-H dirAdd <dir> to the list of include directorieshelp
-nocwdDo not add current working directory to the list of include directories.help + man
-impl fProcess file as a .ml file.help + man
-intf fProcess file as a .mli file.help + man
-keywords version+listset keywords following the <version+list> spec (see ocamlc)help + man
-map fRead an propagate the delayed dependencies for module aliases in file, so that the following files will depend on the exported aliased modules if they use them.help + man
-ml-synonym eConsider the given extension (with leading dot) to be a synonym for .ml.help + man
-mli-synonym eConsider the given extension (with leading dot) to be a synonym for .mli.help + man
-modulesOutput raw dependencies of the form filename: Module1 Module2 ...help + man
-nativeGenerate dependencies for a pure native-code program (no bytecode version).help + man
-bytecodeGenerate dependencies for bytecode-code only (no .cmx files)help
-one-lineOutput one line per file, regardless of the length.help + man
-open moduleAssume that module module is opened before parsing each of the following files.help + man
-plugin plugin(no longer supported)help
-pp cmdCause ocamldep(1) to call the given command as a preprocessor for each source file.help + man
-ppx cmdPipe abstract syntax tree through preprocessor command.help + man
-sharedGenerate dependencies for native plugin files (.cmxs) in addition to native compiled files (.cmx).help + man
-slash(Windows) Use forward slash / instead of backslash \ in file pathshelp + man
-no-slash(Windows) Preserve any backslash \ in file pathshelp + man
-sortSort files according to their dependencies.help + man
-versionPrint version string and exit.help + man
-vnumPrint short version number and exit.help + man
-helpDisplay a short usage summary and exit.help + man
--helpDisplay this list of optionshelp
-args fileRead additional newline separated command line arguments from file. (in the manual page but not in --help)man
-args0 fileRead additional NUL separated command line arguments from file. (in the manual page but not in --help)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.