1 .\" $NetBSD: mkdep.1,v 1.18 2013/03/05 01:59:56 christos Exp $
3 .\" Copyright (c) 1987, 1990, 1993
4 .\" The Regents of the University of California. All rights reserved.
6 .\" Redistribution and use in source and binary forms, with or without
7 .\" modification, are permitted provided that the following conditions
9 .\" 1. Redistributions of source code must retain the above copyright
10 .\" notice, this list of conditions and the following disclaimer.
11 .\" 2. Redistributions in binary form must reproduce the above copyright
12 .\" notice, this list of conditions and the following disclaimer in the
13 .\" documentation and/or other materials provided with the distribution.
14 .\" 3. Neither the name of the University nor the names of its contributors
15 .\" may be used to endorse or promote products derived from this software
16 .\" without specific prior written permission.
18 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
19 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
22 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
24 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
25 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
26 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
27 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30 .\" @(#)mkdep.1 8.1 (Berkeley) 6/6/93
37 .Nd construct Makefile dependency list
49 takes a set of flags for the C compiler and a list
50 of C source files as arguments and constructs a set of include
51 file dependencies which are written into the file ``.depend''.
52 An example of its use in a Makefile might be:
53 .Bd -literal -offset indent
54 CFLAGS= -O -I../include
58 mkdep -- ${CFLAGS} ${SRCS}
61 where the macro SRCS is the list of C source files and the macro
62 CFLAGS is the list of flags for the C compiler.
64 The options are as follows:
67 Append to the output file,
70 may be run from a single Makefile.
74 but read the list of filenames from stdin.
76 Post process and merge previously created (for example by
78 depend files into a single file.
80 Write the include file dependencies to
82 instead of the default ``.depend''.
88 is used, instead of inlining the contents of the files to the resulting
89 depend file, use include statements to include the source dependency files.
91 Add an additional .OPTIONAL line for each dependent file.
93 Prepend the string given in
95 to every target filename.
96 This is useful for programs that have source files in multiple subdirectories
97 and a single Makefile that references all of them explicitly (without using
98 the VPATH functionality because there can be files with the same name in
103 to produce dependencies of the form:
104 .Bd -literal -offset indent
108 so that subsequent makes will produce
110 directly from its C module rather than using an intermediate
113 This is useful for programs whose source is contained in a single
116 is equivalent to specifying a null suffix with
119 Do not print a warning for inaccessible files when
123 Expand each target filename to a list, replacing the
125 suffix with each element of
127 The list of suffixes may be space or comma separated.
129 print debugging output.
132 .Bl -tag -width .depend -compact
134 File containing list of dependencies.
146 Some characters special to
148 most notably the comment character, are not escaped correctly if they
149 appear in file names.
150 This can lead to unparseable output or silently cause dependencies to
152 .\" (This problem is actually in gcc -M.)