summaryrefslogtreecommitdiff
path: root/man/coqdep.1
blob: 5a6cd609e68c25abaa6a3361bdbc748a56df4bbb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
.TH COQ 1 "28 March 1995" "Coq tools"

.SH NAME
coqdep \- Compute inter-module dependencies for Coq and Caml programs

.SH SYNOPSIS
.B coqdep
[
.BI \-w
]
[
.BI \-I \ directory
]
[
.BI \-coqlib \ directory
]
[
.BI \-c
]
[
.BI \-i
]
[
.BI \-D
]
[
.BI \-slash
]
.I filename ...
.I directory ...

.SH DESCRIPTION

.B coqdep
compute inter-module dependencies for Coq and Caml programs,
and prints the dependencies on the standard output in a format
readable by make.
When a directory is given as argument, it is recursively looked at.

Dependencies of Coq modules are computed by looking at
.IR Require \&
commands (Require, Require Export, Require Import),
.IR Declare \& 
.IR ML \& 
.IR Module \&
commands and
.IR Load \&
commands. Dependencies relative to modules from the Coq library are not
printed.

Dependencies of Caml modules are computed by looking at
.IR open \&
directives and the dot notation
.IR module.value \&.

.SH OPTIONS

.TP
.BI \-c
Prints the dependencies of Caml modules.
(On Caml modules, the behaviour is exactly the same as ocamldep).
.TP
.BI \-w
Prints a warning if a Coq command
.IR Declare \& 
.IR ML \& 
.IR Module \&
is incorrect. (For instance, you wrote `Declare ML Module "A".',
but the module A contains #open "B"). The correct command is printed
(see option \-D). The warning is printed on standard error.
.TP
.BI \-D
This commands looks for every command
.IR Declare \& 
.IR ML \& 
.IR Module \&
of each Coq file given as argument and complete (if needed)
the list of Caml modules. The new command is printed on
the standard output. No dependency is computed with this option.
.TP 
.BI \-I \ directory
The files .v .ml .mli of the directory
.IR directory \&
are taken into account during the calculus of dependencies,
but their own dependencies are not printed.
.TP 
.BI \-coqlib \ directory
Indicates where is the Coq library. The default value has been
determined at installation time, and therefore this option should not
be used under normal circumstances.


.SH SEE ALSO

.BR ocamlc (1),
.BR coqc (1),
.BR make (1).
.br

.SH NOTES

Lexers (for Coq and Caml) correctly handle nested comments
and strings.

The treatment of symbolic links is primitive.

If two files have the same name, in two different directories,
a warning is printed on standard error.

There is no way to limit the scope of the recursive search for
directories.

.SH EXAMPLES

.LP
Consider the files (in the same directory):

	A.ml B.ml C.ml D.ml X.v Y.v and Z.v

where
.TP
.BI \+ 
D.ml contains the commands `open A', `open B' and `type t = C.t' ;
.TP
.BI \+
Y.v contains the command `Require X' ;
.TP
.BI \+
Z.v contains the commands `Require X' and `Declare ML Module "D"'.
.LP
To get the dependencies of the Coq files:
.IP
.B
example% coqdep \-I . *.v
.RS
.sp .5
.nf
.B Z.vo: Z.v ./X.vo ./D.cmo
.B Y.vo: Y.v ./X.vo
.B X.vo: X.v
.fi
.RE
.br
.ne 7
.LP
With a warning:
.IP
.B
example% coqdep \-w \-I . *.v
.RS
.sp .5
.nf
.B Z.vo: Z.v ./X.vo ./D.cmo
.B Y.vo: Y.v ./X.vo
.B X.vo: X.v
### Warning : In file Z.v, the ML modules declaration should be
### Declare ML Module "A" "B" "C" "D".
.fi
.RE
.br
.ne 7
.LP
To get only the Caml dependencies:
.IP
.B
example% coqdep \-c \-I . *.ml
.RS
.sp .5
.nf
.B D.cmo: D.ml ./A.cmo ./B.cmo ./C.cmo
.B D.cmx: D.ml ./A.cmx ./B.cmx ./C.cmx
.B C.cmo: C.ml
.B C.cmx: C.ml
.B B.cmo: B.ml
.B B.cmx: B.ml
.B A.cmo: A.ml
.B A.cmx: A.ml
.fi
.RE
.br
.ne 7

.SH BUGS

Please report any bug to
.B coq\-bugs@pauillac.inria.fr