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