fix -p and include SED in compile statement so user can set SED
[unix-history] / usr / src / usr.bin / mkdep / mkdep.1
CommitLineData
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
22takes a set of flags for the C compiler and a list
69a6ba39 23of C source files as arguments and constructs a set of include
7b5fff7f
KB
24file dependencies which are written into the file ``.depend''.
25An example of its use in a Makefile might be:
1e94aeb2 26.Bd -literal -offset indent
7b5fff7f 27CFLAGS= -O -I../include
d9e5e4a9
KB
28SRCS= file1.c file2.c
29
30depend:
31 mkdep ${CFLAGS} ${SRCS}
1e94aeb2 32.Ed
5325ced3 33.Pp
d9e5e4a9 34where the macro SRCS is the list of C source files and the macro
b9310b53 35CFLAGS is the list of flags for the C compiler.
5325ced3 36.Pp
7b5fff7f 37The options are as follows:
1e94aeb2
CL
38.Bl -tag -width Ds
39.It Fl a
7b5fff7f
KB
40Append to the output file,
41so that multiple
1e94aeb2 42.Nm mkdep Ns 's
7b5fff7f 43may be run from a single Makefile.
1e94aeb2 44.It Fl f
7b5fff7f
KB
45Write the include file dependencies to
46.Ar file ,
47instead of the default ``.depend''.
1e94aeb2 48.It Fl p
7b5fff7f 49Cause
5325ced3 50.Nm mkdep
7b5fff7f 51to produce dependencies of the form:
1e94aeb2 52.Bd -literal -offset indent
7b5fff7f 53program: program.c
1e94aeb2 54.Ed
7b5fff7f 55.Pp
5325ced3
CL
56so that subsequent makes will produce
57.Ar program
58directly from its C module rather than using an intermediate
59.Pa \&.o
7b5fff7f
KB
60module.
61This is useful for programs whose source is contained in a single
62module.
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
71File containing list of dependencies.
72.El
5325ced3 73.Sh HISTORY
1e94aeb2
CL
74The
75.Nm mkdep
76command appeared in
77.Bx 4.3 Tahoe .