xref: /netbsd/usr.bin/mkdep/mkdep.1 (revision bf9ec67e)
1.\"	$NetBSD: mkdep.1,v 1.8 2001/12/01 20:40:44 wiz 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
39.Sh NAME
40.Nm mkdep
41.Nd construct Makefile dependency list
42.Sh SYNOPSIS
43.Nm
44.Op Fl a
45.Op Fl p
46.Op Fl f Ar file
47.Op Ar flags
48.Ar file ...
49.Sh DESCRIPTION
50.Nm
51takes a set of flags for the C compiler and a list
52of C source files as arguments and constructs a set of include
53file dependencies which are written into the file ``.depend''.
54An example of its use in a Makefile might be:
55.Bd -literal -offset indent
56CFLAGS= -O -I../include
57SRCS= file1.c file2.c
58
59depend:
60	mkdep ${CFLAGS} ${SRCS}
61.Ed
62.Pp
63where the macro SRCS is the list of C source files and the macro
64CFLAGS is the list of flags for the C compiler.
65.Pp
66The options are as follows:
67.Bl -tag -width Ds
68.It Fl a
69Append to the output file,
70so that multiple
71.Nm "" Ns 's
72may be run from a single Makefile.
73.It Fl f
74Write the include file dependencies to
75.Ar file ,
76instead of the default ``.depend''.
77.It Fl p
78Cause
79.Nm
80to produce dependencies of the form:
81.Bd -literal -offset indent
82program: program.c
83.Ed
84.Pp
85so that subsequent makes will produce
86.Ar program
87directly from its C module rather than using an intermediate
88.Pa \&.o
89module.
90This is useful for programs whose source is contained in a single
91module.
92.El
93.Sh FILES
94.Bl -tag -width .depend -compact
95.It Pa .depend
96File containing list of dependencies.
97.El
98.Sh SEE ALSO
99.Xr cc 1 ,
100.Xr cpp 1 ,
101.Xr make 1
102.Sh HISTORY
103The
104.Nm
105command appeared in
106.Bx 4.3 Tahoe .
107