Commit | Line | Data |
---|---|---|
ef1f0408 | 1 | .\" Copyright (c) 1987, 1990 The Regents of the University of California. |
d4e520ea | 2 | .\" All rights reserved. |
d9e5e4a9 | 3 | .\" |
ef1f0408 | 4 | .\" %sccs.include.redist.man% |
d4e520ea | 5 | .\" |
1e94aeb2 | 6 | .\" @(#)mkdep.1 5.13 (Berkeley) %G% |
d9e5e4a9 | 7 | .\" |
5325ced3 CL |
8 | .Dd |
9 | .Dt MKDEP 1 | |
10 | .Os BSD 4.2 | |
11 | .Sh NAME | |
12 | .Nm mkdep | |
13 | .Nd construct Makefile dependency list | |
14 | .Sh SYNOPSIS | |
15 | .Nm mkdep | |
16 | .Op Fl ap | |
7b5fff7f | 17 | .Op Fl f Ar file |
5325ced3 CL |
18 | .Op Ar flags |
19 | .Ar file ... | |
20 | .Sh DESCRIPTION | |
21 | .Nm Mkdep | |
22 | takes a set of flags for the C compiler and a list | |
69a6ba39 | 23 | of C source files as arguments and constructs a set of include |
7b5fff7f KB |
24 | file dependencies which are written into the file ``.depend''. |
25 | An example of its use in a Makefile might be: | |
1e94aeb2 | 26 | .Bd -literal -offset indent |
7b5fff7f | 27 | CFLAGS= -O -I../include |
d9e5e4a9 KB |
28 | SRCS= file1.c file2.c |
29 | ||
30 | depend: | |
31 | mkdep ${CFLAGS} ${SRCS} | |
1e94aeb2 | 32 | .Ed |
5325ced3 | 33 | .Pp |
d9e5e4a9 | 34 | where the macro SRCS is the list of C source files and the macro |
b9310b53 | 35 | CFLAGS is the list of flags for the C compiler. |
5325ced3 | 36 | .Pp |
7b5fff7f | 37 | The options are as follows: |
1e94aeb2 CL |
38 | .Bl -tag -width Ds |
39 | .It Fl a | |
7b5fff7f KB |
40 | Append to the output file, |
41 | so that multiple | |
1e94aeb2 | 42 | .Nm mkdep Ns 's |
7b5fff7f | 43 | may be run from a single Makefile. |
1e94aeb2 | 44 | .It Fl f |
7b5fff7f KB |
45 | Write the include file dependencies to |
46 | .Ar file , | |
47 | instead of the default ``.depend''. | |
1e94aeb2 | 48 | .It Fl p |
7b5fff7f | 49 | Cause |
5325ced3 | 50 | .Nm mkdep |
7b5fff7f | 51 | to produce dependencies of the form: |
1e94aeb2 | 52 | .Bd -literal -offset indent |
7b5fff7f | 53 | program: program.c |
1e94aeb2 | 54 | .Ed |
7b5fff7f | 55 | .Pp |
5325ced3 CL |
56 | so that subsequent makes will produce |
57 | .Ar program | |
58 | directly from its C module rather than using an intermediate | |
59 | .Pa \&.o | |
7b5fff7f KB |
60 | module. |
61 | This is useful for programs whose source is contained in a single | |
62 | module. | |
1e94aeb2 | 63 | .El |
5325ced3 CL |
64 | .Sh SEE ALSO |
65 | .Xr cc 1 , | |
66 | .Xr cpp 1 , | |
67 | .Xr make 1 | |
7b5fff7f | 68 | .Sh FILES |
1e94aeb2 CL |
69 | .Bl -tag -width .depend -compact |
70 | .It Pa .depend | |
71 | File containing list of dependencies. | |
72 | .El | |
5325ced3 | 73 | .Sh HISTORY |
1e94aeb2 CL |
74 | The |
75 | .Nm mkdep | |
76 | command appeared in | |
77 | .Bx 4.3 Tahoe . |