xref: /original-bsd/usr.bin/mkdep/mkdep.1 (revision c3e32dec)
1.\" Copyright (c) 1987, 1990, 1993
2.\"	The Regents of the University of California.  All rights reserved.
3.\"
4.\" %sccs.include.redist.man%
5.\"
6.\"     @(#)mkdep.1	8.1 (Berkeley) 06/06/93
7.\"
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
17.Op Fl f Ar file
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
23of C source files as arguments and constructs a set of include
24file dependencies which are written into the file ``.depend''.
25An example of its use in a Makefile might be:
26.Bd -literal -offset indent
27CFLAGS= -O -I../include
28SRCS= file1.c file2.c
29
30depend:
31	mkdep ${CFLAGS} ${SRCS}
32.Ed
33.Pp
34where the macro SRCS is the list of C source files and the macro
35CFLAGS is the list of flags for the C compiler.
36.Pp
37The options are as follows:
38.Bl -tag -width Ds
39.It Fl a
40Append to the output file,
41so that multiple
42.Nm mkdep Ns 's
43may be run from a single Makefile.
44.It Fl f
45Write the include file dependencies to
46.Ar file ,
47instead of the default ``.depend''.
48.It Fl p
49Cause
50.Nm mkdep
51to produce dependencies of the form:
52.Bd -literal -offset indent
53program: program.c
54.Ed
55.Pp
56so that subsequent makes will produce
57.Ar program
58directly from its C module rather than using an intermediate
59.Pa \&.o
60module.
61This is useful for programs whose source is contained in a single
62module.
63.El
64.Sh SEE ALSO
65.Xr cc 1 ,
66.Xr cpp 1 ,
67.Xr make 1
68.Sh FILES
69.Bl -tag -width .depend -compact
70.It Pa .depend
71File containing list of dependencies.
72.El
73.Sh HISTORY
74The
75.Nm mkdep
76command appeared in
77.Bx 4.3 Tahoe .
78