1*5eacfe93Sschwarze.\" $OpenBSD: mkdep.1,v 1.9 2011/07/31 11:17:43 schwarze Exp $ 2df930be7Sderaadt.\" $NetBSD: mkdep.1,v 1.3 1994/12/23 07:34:56 jtc Exp $ 3df930be7Sderaadt.\" 4df930be7Sderaadt.\" Copyright (c) 1987, 1990, 1993 5df930be7Sderaadt.\" The Regents of the University of California. All rights reserved. 6df930be7Sderaadt.\" 7df930be7Sderaadt.\" Redistribution and use in source and binary forms, with or without 8df930be7Sderaadt.\" modification, are permitted provided that the following conditions 9df930be7Sderaadt.\" are met: 10df930be7Sderaadt.\" 1. Redistributions of source code must retain the above copyright 11df930be7Sderaadt.\" notice, this list of conditions and the following disclaimer. 12df930be7Sderaadt.\" 2. Redistributions in binary form must reproduce the above copyright 13df930be7Sderaadt.\" notice, this list of conditions and the following disclaimer in the 14df930be7Sderaadt.\" documentation and/or other materials provided with the distribution. 15f75387cbSmillert.\" 3. Neither the name of the University nor the names of its contributors 16df930be7Sderaadt.\" may be used to endorse or promote products derived from this software 17df930be7Sderaadt.\" without specific prior written permission. 18df930be7Sderaadt.\" 19df930be7Sderaadt.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 20df930be7Sderaadt.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 21df930be7Sderaadt.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 22df930be7Sderaadt.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 23df930be7Sderaadt.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 24df930be7Sderaadt.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 25df930be7Sderaadt.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 26df930be7Sderaadt.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 27df930be7Sderaadt.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 28df930be7Sderaadt.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 29df930be7Sderaadt.\" SUCH DAMAGE. 30df930be7Sderaadt.\" 31df930be7Sderaadt.\" @(#)mkdep.1 8.1 (Berkeley) 6/6/93 32df930be7Sderaadt.\" 33*5eacfe93Sschwarze.Dd $Mdocdate: July 31 2011 $ 34df930be7Sderaadt.Dt MKDEP 1 352e0eb34fSaaron.Os 36df930be7Sderaadt.Sh NAME 37df930be7Sderaadt.Nm mkdep 38df930be7Sderaadt.Nd construct Makefile dependency list 39df930be7Sderaadt.Sh SYNOPSIS 40df930be7Sderaadt.Nm mkdep 41df930be7Sderaadt.Op Fl ap 42df930be7Sderaadt.Op Fl f Ar file 43df930be7Sderaadt.Op Ar flags 4403cb09c0Ssobrado.Ar 45df930be7Sderaadt.Sh DESCRIPTION 462e0eb34fSaaron.Nm 47df930be7Sderaadttakes a set of flags for the C compiler and a list 48df930be7Sderaadtof C source files as arguments and constructs a set of include 492e0eb34fSaaronfile dependencies which are written into the file 50*5eacfe93Sschwarze.Pa .depend , 51*5eacfe93Sschwarzefor use by 52*5eacfe93Sschwarze.Xr make 1 . 53df930be7SderaadtAn example of its use in a Makefile might be: 54df930be7Sderaadt.Bd -literal -offset indent 55df930be7SderaadtCFLAGS= -O -I../include 56df930be7SderaadtSRCS= file1.c file2.c 57df930be7Sderaadt 58df930be7Sderaadtdepend: 59df930be7Sderaadt mkdep ${CFLAGS} ${SRCS} 60df930be7Sderaadt.Ed 61df930be7Sderaadt.Pp 62df930be7Sderaadtwhere the macro SRCS is the list of C source files and the macro 63df930be7SderaadtCFLAGS is the list of flags for the C compiler. 64df930be7Sderaadt.Pp 65df930be7SderaadtThe options are as follows: 66df930be7Sderaadt.Bl -tag -width Ds 67df930be7Sderaadt.It Fl a 68df930be7SderaadtAppend to the output file, 69df930be7Sderaadtso that multiple 70df930be7Sderaadt.Nm mkdep Ns 's 71df930be7Sderaadtmay be run from a single Makefile. 72aea1524aSaaron.It Fl f Ar file 73df930be7SderaadtWrite the include file dependencies to 74df930be7Sderaadt.Ar file , 752e0eb34fSaaroninstead of the default 762e0eb34fSaaron.Pa .depend . 77df930be7Sderaadt.It Fl p 78df930be7SderaadtCause 792e0eb34fSaaron.Nm 80df930be7Sderaadtto produce dependencies of the form: 81df930be7Sderaadt.Bd -literal -offset indent 82df930be7Sderaadtprogram: program.c 83df930be7Sderaadt.Ed 84df930be7Sderaadt.Pp 85df930be7Sderaadtso that subsequent makes will produce 86df930be7Sderaadt.Ar program 87df930be7Sderaadtdirectly from its C module rather than using an intermediate 88df930be7Sderaadt.Pa \&.o 89df930be7Sderaadtmodule. 90df930be7SderaadtThis is useful for programs whose source is contained in a single 91df930be7Sderaadtmodule. 92df930be7Sderaadt.El 93df930be7Sderaadt.Sh FILES 94df930be7Sderaadt.Bl -tag -width .depend -compact 95df930be7Sderaadt.It Pa .depend 96aea1524aSaaronfile containing list of dependencies 97df930be7Sderaadt.El 983746a816Saaron.Sh SEE ALSO 993746a816Saaron.Xr cc 1 , 1003746a816Saaron.Xr cpp 1 , 1013746a816Saaron.Xr make 1 102df930be7Sderaadt.Sh HISTORY 103df930be7SderaadtThe 1042e0eb34fSaaron.Nm 105df930be7Sderaadtcommand appeared in 106df930be7Sderaadt.Bx 4.3 Tahoe . 107