1 .\" $NetBSD: mkdep.1,v 1.15 2010/10/15 05:46:48 dholland 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
48 takes a set of flags for the C compiler and a list
49 of C source files as arguments and constructs a set of include
50 file dependencies which are written into the file ``.depend''.
51 An example of its use in a Makefile might be:
52 .Bd -literal -offset indent
53 CFLAGS= -O -I../include
57 mkdep -- ${CFLAGS} ${SRCS}
60 where the macro SRCS is the list of C source files and the macro
61 CFLAGS is the list of flags for the C compiler.
63 The options are as follows:
66 Append to the output file,
69 may be run from a single Makefile.
73 but read the list of filenames from stdin.
75 Post process and merge previously created (for example by
77 depend files into a single file.
79 Write the include file dependencies to
81 instead of the default ``.depend''.
83 Add an additional .OPTIONAL line for each dependant file.
87 to produce dependencies of the form:
88 .Bd -literal -offset indent
92 so that subsequent makes will produce
94 directly from its C module rather than using an intermediate
97 This is useful for programs whose source is contained in a single
100 is equivalent to specifying a null suffix with
103 Do not print a warning for inaccessible files when
107 Expand each target filename to a list, replacing the
109 suffix with each element of
111 The list of suffixes may be space or comma separated.
114 .Bl -tag -width .depend -compact
116 File containing list of dependencies.
128 Some characters special to
130 most notably the comment character, are not escaped correctly if they
131 appear in file names.
132 This can lead to unparseable output or silently cause dependencies to
134 .\" (This problem is actually in gcc -M.)