1OCAMLDEP(1) General Commands Manual OCAMLDEP(1)
2
3
4
6 ocamldep - Dependency generator for Objective Caml
7
8
10 ocamldep [ -I lib-dir ] filename ...
11
12
14 The ocamldep(1) command scans a set of Objective Caml source files (.ml
15 and .mli files) for references to external compilation units, and out‐
16 puts dependency lines in a format suitable for the make(1) utility.
17 This ensures that make will compile the source files in the correct
18 order, and recompile those files that need to when a source file is
19 modified.
20
21 The typical usage is:
22
23 ocamldep options *.mli *.ml > .depend
24
25 where .depend is the file that should contain the dependencies.
26
27 Dependencies are generated both for compiling with the bytecode com‐
28 piler ocamlc(1) and with the native-code compiler ocamlopt(1).
29
30
32 The following command-line option is recognized by ocamldep(1).
33
34
35 -I directory
36 Add the given directory to the list of directories searched for
37 source files. If a source file foo.ml mentions an external com‐
38 pilation unit Bar, a dependency on that unit's interface bar.cmi
39 is generated only if the source for bar is found in the current
40 directory or in one of the directories specified with -I. Oth‐
41 erwise, Bar is assumed to be a module form the standard library,
42 and no dependencies are generated. For programs that span multi‐
43 ple directories, it is recommended to pass ocamldep(1) the same
44 -I options that are passed to the compiler.
45
46
47 -native
48 Generate dependencies for a pure native-code program (no byte‐
49 code version). When an implementation file (.ml file) has no
50 explicit interface file (.mli file), ocamldep(1) generates
51 dependencies on the bytecode compiled file (.cmo file) to
52 reflect interface changes. This can cause unnecessary bytecode
53 recompilations for programs that are compiled to native-code
54 only. The flag -native causes dependencies on native compiled
55 files (.cmx) to be generated instead of on .cmo files. (This
56 flag makes no difference if all source files have explicit .mli
57 interface files.)
58
59
61 ocamlc(1), ocamlopt(1).
62 The Objective Caml user's manual, chapter "Dependency generator".
63
64
65
66 OCAMLDEP(1)