coqdep - Man Page

Compute inter-module dependencies for Coq programs

Synopsis

coqdep [ -I directory ] [ -coqlib directory ] [ -i ] [ -slash ] filename ... directory ...

Description

coqdep compute inter-module dependencies for Coq 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 Require commands (Require, Require Export, Require Import), Declare ML Module commands and Load commands. Dependencies relative to modules from the Coq library are not printed except if -boot is given.

Options

-f file

Read filenames and options -I, -R and -Q from a _CoqProject FILE.

-I/-Q/-R options

Have the same effects on load path and modules names as for other coq commands (coqtop, coqc).

-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.

-exclude-dir dir

Skips subdirectory dir during -R/-Q search.

-sort

Output the given file name ordered by dependencies.

-vos

Output dependencies for .vos files (this is not the default as it breaks dune's Coq mode)

-boot

For coq developers, prints dependencies over coq library files (omitted by default).

-noinit

Currently no effect.

Exit Status

1

A file given on the command line cannot be found or some file cannot be opened.

0

In all other cases. In particular, when a dependency cannot be found or an invalid option is encountered, coqdep prints a warning and exits with status 0.

See Also

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

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.

Examples

Consider the files (in the same directory):

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

where

To get the dependencies of the Coq files:

example% coqdep -I . *.v

Z.vo: Z.v ./X.vo ./D.cmo
Y.vo: Y.v ./X.vo
X.vo: X.v

With a warning:

example% coqdep -I . *.v

Z.vo: Z.v ./X.vo ./D.cmo
Y.vo: Y.v ./X.vo
X.vo: X.v
### Warning : In file Z.v, the ML modules declaration should be
### Declare ML Module "A" "B" "C" "D".

Bugs

Please report any bug to https://github.com/coq/coq/issues

Referenced By

coqc(1), coqchk(1), coqide(1), coq_makefile(1), coqnative(1), coqtop(1).