Commit | Line | Data |
---|---|---|
15637ed4 RG |
1 | .\" Copyright (c) 1987, 1990 The Regents of the University of California. |
2 | .\" All rights reserved. | |
3 | .\" | |
4 | .\" Redistribution and use in source and binary forms, with or without | |
5 | .\" modification, are permitted provided that the following conditions | |
6 | .\" are met: | |
7 | .\" 1. Redistributions of source code must retain the above copyright | |
8 | .\" notice, this list of conditions and the following disclaimer. | |
9 | .\" 2. Redistributions in binary form must reproduce the above copyright | |
10 | .\" notice, this list of conditions and the following disclaimer in the | |
11 | .\" documentation and/or other materials provided with the distribution. | |
12 | .\" 3. All advertising materials mentioning features or use of this software | |
13 | .\" must display the following acknowledgement: | |
14 | .\" This product includes software developed by the University of | |
15 | .\" California, Berkeley and its contributors. | |
16 | .\" 4. Neither the name of the University nor the names of its contributors | |
17 | .\" may be used to endorse or promote products derived from this software | |
18 | .\" without specific prior written permission. | |
19 | .\" | |
20 | .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND | |
21 | .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | |
22 | .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | |
23 | .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE | |
24 | .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | |
25 | .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | |
26 | .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | |
27 | .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | |
28 | .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | |
29 | .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | |
30 | .\" SUCH DAMAGE. | |
31 | .\" | |
32 | .\" @(#)mkdep.1 5.13 (Berkeley) 6/2/91 | |
33 | .\" | |
34 | .Dd June 2, 1991 | |
35 | .Dt MKDEP 1 | |
36 | .Os BSD 4.2 | |
37 | .Sh NAME | |
38 | .Nm mkdep | |
39 | .Nd construct Makefile dependency list | |
40 | .Sh SYNOPSIS | |
41 | .Nm mkdep | |
42 | .Op Fl ap | |
43 | .Op Fl f Ar file | |
44 | .Op Ar flags | |
45 | .Ar file ... | |
46 | .Sh DESCRIPTION | |
47 | .Nm Mkdep | |
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 | |
54 | SRCS= file1.c file2.c | |
55 | ||
56 | depend: | |
57 | mkdep ${CFLAGS} ${SRCS} | |
58 | .Ed | |
59 | .Pp | |
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. | |
62 | .Pp | |
63 | The options are as follows: | |
64 | .Bl -tag -width Ds | |
65 | .It Fl a | |
66 | Append to the output file, | |
67 | so that multiple | |
68 | .Nm mkdep Ns 's | |
69 | may be run from a single Makefile. | |
70 | .It Fl f | |
71 | Write the include file dependencies to | |
72 | .Ar file , | |
73 | instead of the default ``.depend''. | |
74 | .It Fl p | |
75 | Cause | |
76 | .Nm mkdep | |
77 | to produce dependencies of the form: | |
78 | .Bd -literal -offset indent | |
79 | program: program.c | |
80 | .Ed | |
81 | .Pp | |
82 | so that subsequent makes will produce | |
83 | .Ar program | |
84 | directly from its C module rather than using an intermediate | |
85 | .Pa \&.o | |
86 | module. | |
87 | This is useful for programs whose source is contained in a single | |
88 | module. | |
89 | .El | |
90 | .Sh SEE ALSO | |
91 | .Xr cc 1 , | |
92 | .Xr cpp 1 , | |
93 | .Xr make 1 | |
94 | .Sh FILES | |
95 | .Bl -tag -width .depend -compact | |
96 | .It Pa .depend | |
97 | File containing list of dependencies. | |
98 | .El | |
99 | .Sh HISTORY | |
100 | The | |
101 | .Nm mkdep | |
102 | command appeared in | |
103 | .Bx 4.3 Tahoe . |