xref: /freebsd/usr.bin/mkdep/mkdep.1 (revision 17ee9d00bc1ae1e598c38f25826f861e4bc6c3ce)
1.\" Copyright (c) 1987, 1990, 1993
2.\"	The Regents of the University of California.  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	8.1 (Berkeley) 6/6/93
33.\"
34.Dd June 6, 1993
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
48takes a set of flags for the C compiler and a list
49of C source files as arguments and constructs a set of include
50file dependencies which are written into the file ``.depend''.
51An example of its use in a Makefile might be:
52.Bd -literal -offset indent
53CFLAGS= -O -I../include
54SRCS= file1.c file2.c
55
56depend:
57	mkdep ${CFLAGS} ${SRCS}
58.Ed
59.Pp
60where the macro SRCS is the list of C source files and the macro
61CFLAGS is the list of flags for the C compiler.
62.Pp
63The options are as follows:
64.Bl -tag -width Ds
65.It Fl a
66Append to the output file,
67so that multiple
68.Nm mkdep Ns 's
69may be run from a single Makefile.
70.It Fl f
71Write the include file dependencies to
72.Ar file ,
73instead of the default ``.depend''.
74.It Fl p
75Cause
76.Nm mkdep
77to produce dependencies of the form:
78.Bd -literal -offset indent
79program: program.c
80.Ed
81.Pp
82so that subsequent makes will produce
83.Ar program
84directly from its C module rather than using an intermediate
85.Pa \&.o
86module.
87This is useful for programs whose source is contained in a single
88module.
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
97File containing list of dependencies.
98.El
99.Sh HISTORY
100The
101.Nm mkdep
102command appeared in
103.Bx 4.3 Tahoe .
104