written by Eric Allman; add Berkeley specific header
[unix-history] / usr / src / usr.bin / mkdep / mkdep.1
CommitLineData
d9e5e4a9 1.\" Copyright (c) 1987 Regents of the University of California.
d4e520ea 2.\" All rights reserved.
d9e5e4a9 3.\"
d4e520ea
KB
4.\" Redistribution and use in source and binary forms are permitted
5.\" provided that this notice is preserved and that due credit is given
6.\" to the University of California at Berkeley. The name of the University
7.\" may not be used to endorse or promote products derived from this
8.\" software without specific prior written permission. This software
9.\" is provided ``as is'' without express or implied warranty.
10.\"
11.\" @(#)mkdep.1 5.5 (Berkeley) %G%
d9e5e4a9
KB
12.\"
13.TH MKDEP 1 ""
14.UC 5
15.SH NAME
16mkdep \- construct Makefile dependency list
17.SH SYNOPSIS
18.B mkdep
b08f0d07
KB
19[
20.B \-f makefile
21] [
22.B \-p
a41d2463 23] [ flags ] file ...
d9e5e4a9
KB
24.SH DESCRIPTION
25\fIMkdep\fP takes a set of flags for the C compiler and a list of C
b08f0d07
KB
26source files as arguments and constructs a set of include file dependencies.
27It attaches this dependency list to the end of the file ``Makefile''.
28An example of its use in a makefile might be:
d9e5e4a9 29.nf
99c6e987 30.RS
d9e5e4a9 31
b08f0d07 32CFLAGS= -O -I../include -I.
d9e5e4a9
KB
33SRCS= file1.c file2.c
34
35depend:
36 mkdep ${CFLAGS} ${SRCS}
99c6e987 37.RE
d9e5e4a9
KB
38.PP
39where the macro SRCS is the list of C source files and the macro
b08f0d07
KB
40CFLAGS is the list of flags for the C compiler. The \fB-f\fP option
41provides \fImkdep\fP with a name other than ``Makefile'' to be edited.
42If the \fB-p\fP option is provided, \fImkdep\fP produces dependencies
43of the form ``program: program.c'' so that subsequent makes will
44produce \fIprogram\fP directly from its C module rather than using an
45intermediate \fI.o\fP module. This is useful in directories that
46contain many programs, each of whose source is contained in a single
47C module.
d9e5e4a9
KB
48.SH "SEE ALSO"
49cc(1), make(1)