294 lines
7.1 KiB
HTML
294 lines
7.1 KiB
HTML
|
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
|
<HTML><HEAD><TITLE>Man page of OCAMLDEP</TITLE>
|
|
</HEAD><BODY>
|
|
<H1>OCAMLDEP</H1>
|
|
Section: User Commands (1)<BR><A HREF="#index">Index</A>
|
|
<A HREF="/cgi-bin/man/man2html">Return to Main Contents</A><HR>
|
|
|
|
<P>
|
|
<A NAME="lbAB"> </A>
|
|
<H2>NAME</H2>
|
|
|
|
ocamldep - Dependency generator for OCaml
|
|
<P>
|
|
<A NAME="lbAC"> </A>
|
|
<H2>SYNOPSIS</H2>
|
|
|
|
<B>ocamldep</B>
|
|
|
|
[
|
|
<I>options</I>
|
|
|
|
]
|
|
<I>filename ...</I>
|
|
|
|
<P>
|
|
<A NAME="lbAD"> </A>
|
|
<H2>DESCRIPTION</H2>
|
|
|
|
<P>
|
|
The
|
|
<B><A HREF="/cgi-bin/man/man2html?1+ocamldep">ocamldep</A></B>(1)
|
|
|
|
command scans a set of OCaml source files
|
|
(.ml and .mli files) for references to external compilation units,
|
|
and outputs dependency lines in a format suitable for the
|
|
<B><A HREF="/cgi-bin/man/man2html?1+make">make</A></B>(1)
|
|
|
|
utility. This ensures that make will compile the source files in the
|
|
correct order, and recompile those files that need to when a source
|
|
file is modified.
|
|
<P>
|
|
The typical usage is:
|
|
<P>
|
|
|
|
ocamldep
|
|
<I>options</I>
|
|
|
|
*.mli *.ml > .depend
|
|
<P>
|
|
|
|
where .depend is the file that should contain the
|
|
dependencies.
|
|
<P>
|
|
Dependencies are generated both for compiling with the bytecode
|
|
compiler
|
|
<B><A HREF="/cgi-bin/man/man2html?1+ocamlc">ocamlc</A></B>(1)
|
|
|
|
and with the native-code compiler
|
|
<B><A HREF="/cgi-bin/man/man2html?1+ocamlopt">ocamlopt</A></B>(1).
|
|
|
|
<P>
|
|
<A NAME="lbAE"> </A>
|
|
<H2>OPTIONS</H2>
|
|
|
|
<P>
|
|
The following command-line options are recognized by
|
|
<B><A HREF="/cgi-bin/man/man2html?1+ocamldep">ocamldep</A></B>(1).
|
|
|
|
<DL COMPACT>
|
|
<DT id="1"><B>-absname</B>
|
|
|
|
<DD>
|
|
Show absolute filenames in error messages.
|
|
<DT id="2"><B>-all</B>
|
|
|
|
<DD>
|
|
Generate dependencies on all required files, rather than assuming
|
|
implicit dependencies.
|
|
<DT id="3"><B>-allow-approx</B>
|
|
|
|
<DD>
|
|
Allow falling back on a lexer-based approximation when parsing fails.
|
|
<DT id="4"><B>-as-map</B>
|
|
|
|
<DD>
|
|
For the following files, do not include delayed dependencies for
|
|
module aliases.
|
|
This option assumes that they are compiled using options
|
|
"-no-alias-deps -w -49", and that those files or their interface are
|
|
passed with the "-map" option when computing dependencies for other
|
|
files. Note also that for dependencies to be correct in the
|
|
implementation of a map file, its interface should not coerce any of
|
|
the aliases it contains.
|
|
<DT id="5"><B>-debug-map</B>
|
|
|
|
<DD>
|
|
Dump the delayed dependency map for each map file.
|
|
<DT id="6"><B>-I</B><I> directory</I>
|
|
|
|
<DD>
|
|
Add the given directory to the list of directories searched for
|
|
source files. If a source file foo.ml mentions an external
|
|
compilation unit Bar, a dependency on that unit's interface
|
|
bar.cmi is generated only if the source for bar is found in the
|
|
current directory or in one of the directories specified with
|
|
<B>-I</B>.
|
|
|
|
Otherwise, Bar is assumed to be a module from the standard library,
|
|
and no dependencies are generated. For programs that span multiple
|
|
directories, it is recommended to pass
|
|
<B><A HREF="/cgi-bin/man/man2html?1+ocamldep">ocamldep</A></B>(1)
|
|
|
|
the same
|
|
<B>-I</B>
|
|
|
|
options that are passed to the compiler.
|
|
<DT id="7"><B>-impl</B><I> file</I>
|
|
|
|
<DD>
|
|
Process
|
|
<I>file</I>
|
|
|
|
as a .ml file.
|
|
<DT id="8"><B>-intf</B><I> file</I>
|
|
|
|
<DD>
|
|
Process
|
|
<I>file</I>
|
|
|
|
as a .mli file.
|
|
<DT id="9"><B>-map</B><I> file</I>
|
|
|
|
<DD>
|
|
Read an propagate the delayed dependencies for module aliases in
|
|
<I>file</I>,
|
|
|
|
so that the following files will depend on the
|
|
exported aliased modules if they use them.
|
|
<DT id="10"><B>-ml-synonym</B><I> .ext</I>
|
|
|
|
<DD>
|
|
Consider the given extension (with leading dot) to be a synonym for .ml.
|
|
<DT id="11"><B>-mli-synonym</B><I> .ext</I>
|
|
|
|
<DD>
|
|
Consider the given extension (with leading dot) to be a synonym for .mli.
|
|
<DT id="12"><B>-modules</B>
|
|
|
|
<DD>
|
|
Output raw dependencies of the form
|
|
<I>filename</I>:<I> Module1 Module2</I> ...<I> ModuleN</I>
|
|
|
|
where
|
|
<I>Module1</I>, ...,<I> ModuleN</I>
|
|
|
|
are the names of the compilation
|
|
units referenced within the file
|
|
<I>filename</I>,
|
|
|
|
but these names are not
|
|
resolved to source file names. Such raw dependencies cannot be used
|
|
by
|
|
<B><A HREF="/cgi-bin/man/man2html?1+make">make</A></B>(1),
|
|
|
|
but can be post-processed by other tools such as
|
|
<B><A HREF="/cgi-bin/man/man2html?1+Omake">Omake</A></B>(1).
|
|
|
|
<DT id="13"><B>-native</B>
|
|
|
|
<DD>
|
|
Generate dependencies for a pure native-code program (no bytecode
|
|
version). When an implementation file (.ml file) has no explicit
|
|
interface file (.mli file),
|
|
<B><A HREF="/cgi-bin/man/man2html?1+ocamldep">ocamldep</A></B>(1)
|
|
|
|
generates dependencies on the
|
|
bytecode compiled file (.cmo file) to reflect interface changes.
|
|
This can cause unnecessary bytecode recompilations for programs that
|
|
are compiled to native-code only. The flag
|
|
<B>-native</B>
|
|
|
|
causes dependencies on native compiled files (.cmx) to be generated instead
|
|
of on .cmo files. (This flag makes no difference if all source files
|
|
have explicit .mli interface files.)
|
|
<DT id="14"><B>-one-line</B>
|
|
|
|
<DD>
|
|
Output one line per file, regardless of the length.
|
|
<DT id="15"><B>-open</B><I> module</I>
|
|
|
|
<DD>
|
|
Assume that module
|
|
<I>module</I>
|
|
|
|
is opened before parsing each of the
|
|
following files.
|
|
<DT id="16"><B>-plugin</B><I> plugin</I>
|
|
|
|
<DD>
|
|
Dynamically load the code of the given
|
|
<I>plugin</I>
|
|
|
|
(a .cmo, .cma or .cmxs file) in
|
|
<B><A HREF="/cgi-bin/man/man2html?1+ocamldep">ocamldep</A></B>(1).
|
|
|
|
The plugin must exist in
|
|
the same kind of code as the tool (
|
|
<B>ocamldep.byte</B>
|
|
|
|
must load bytecode
|
|
plugins, while
|
|
<B>ocamldep.opt</B>
|
|
|
|
must load native code plugins), and
|
|
extension adaptation is done automatically for .cma files (to .cmxs files
|
|
if
|
|
<B><A HREF="/cgi-bin/man/man2html?1+ocamldep">ocamldep</A></B>(1)
|
|
|
|
is compiled in native code).
|
|
<DT id="17"><B>-pp</B><I> command</I>
|
|
|
|
<DD>
|
|
Cause
|
|
<B><A HREF="/cgi-bin/man/man2html?1+ocamldep">ocamldep</A></B>(1)
|
|
|
|
to call the given
|
|
<I>command</I>
|
|
|
|
as a preprocessor for each source file.
|
|
<DT id="18"><B>-ppx</B><I> command</I>
|
|
|
|
<DD>
|
|
Pipe abstract syntax tree through preprocessor
|
|
<I>command</I>.
|
|
|
|
<DT id="19"><B>-shared</B>
|
|
|
|
<DD>
|
|
Generate dependencies for native plugin files (.cmxs) in addition to
|
|
native compiled files (.cmx).
|
|
<DT id="20"><B>-slash</B>
|
|
|
|
<DD>
|
|
Under Unix, this option does nothing.
|
|
<DT id="21"><B>-sort</B>
|
|
|
|
<DD>
|
|
Sort files according to their dependencies.
|
|
<DT id="22"><B>-version</B>
|
|
|
|
<DD>
|
|
Print version string and exit.
|
|
<DT id="23"><B>-vnum</B>
|
|
|
|
<DD>
|
|
Print short version number and exit.
|
|
<DT id="24"><B>-help</B> or<B> --help</B>
|
|
|
|
<DD>
|
|
Display a short usage summary and exit.
|
|
<P>
|
|
</DL>
|
|
<A NAME="lbAF"> </A>
|
|
<H2>SEE ALSO</H2>
|
|
|
|
<B><A HREF="/cgi-bin/man/man2html?1+ocamlc">ocamlc</A></B>(1),
|
|
|
|
<B><A HREF="/cgi-bin/man/man2html?1+ocamlopt">ocamlopt</A></B>(1).
|
|
|
|
<BR>
|
|
|
|
<I>The OCaml user's manual</I>,
|
|
|
|
chapter "Dependency generator".
|
|
<P>
|
|
|
|
<HR>
|
|
<A NAME="index"> </A><H2>Index</H2>
|
|
<DL>
|
|
<DT id="25"><A HREF="#lbAB">NAME</A><DD>
|
|
<DT id="26"><A HREF="#lbAC">SYNOPSIS</A><DD>
|
|
<DT id="27"><A HREF="#lbAD">DESCRIPTION</A><DD>
|
|
<DT id="28"><A HREF="#lbAE">OPTIONS</A><DD>
|
|
<DT id="29"><A HREF="#lbAF">SEE ALSO</A><DD>
|
|
</DL>
|
|
<HR>
|
|
This document was created by
|
|
<A HREF="/cgi-bin/man/man2html">man2html</A>,
|
|
using the manual pages.<BR>
|
|
Time: 00:05:20 GMT, March 31, 2021
|
|
</BODY>
|
|
</HTML>
|