mkdepend - compute header file dependencies
mkdepend [-c compiler] [-e sedprog] [-f force] [-i] [-p count] [-r] [-s
sentinel] depfile [file ...]
Mkdepend infers make(1) dependencies from source containing C #include
directives. It invokes cc(1) with the -M option to compile dependencies
given a list of source files, and edits the generated dependency
information into depfile, which may be a makefile or a make include file.
The -c option substitutes compiler, which may be an elaborate, quoted
invocation of a compiler, for the default cc -M. This option is useful
in an environment where the -D and -I options of cc are used to govern
header file inclusion.
The -e option passes an editing program to sed(1), which is applied to
raw dependency information of the following form:
Thus one may substitute pathname prefixes with envariable parameters, or
rewrite the conventional .o object suffix.
The -f option causes mkdepend to add a dependent named force to each
target file's dependency list. Using -f '$(FORCE)' and setting
FORCE=FORCE in a make's environment, one may rebuild certain objects
without first removing them. This example assumes that no file named
FORCE exists in any of make's current working directories.
Normally, existing dependencies are deleted from the makefile. The -i
option causes mkdepend to preserve old dependencies, replacing only those
involving targets based on the file arguments. The following rule
incrementally updates a dependency file named Makedepend:
mkdepend -c "$(CC) $(CFLAGS) -M" -i $@ $?
The -r option causes mkdepend to read raw dependencies from its file
arguments, or from standard input if no file arguments are given. The -p
option is like -r, but also collapses dependencies of targets in
subdirectories where possible. The count argument specifies the number
of subdirectories. For example,
would be rewritten by mkdepend -p 3 as
-p is useful in conjunction with make's VPATH variable.
The -c, -p, and -r options override one another.
The -s option inserts its sentinel argument in the comment lines which
delimit dependencies in depfile. This option is useful for maintaining
multiple sets of dependencies in a single file.
This command will be removed from the next major release. Use cc
cc(1), cpp(1), make(1), sed(1)
PPPPaaaaggggeeee 2222 [ Back ]