19b50d902SRodney W. Grimes.\" Copyright (c) 1987, 1990, 1993 29b50d902SRodney W. Grimes.\" The Regents of the University of California. All rights reserved. 39b50d902SRodney W. Grimes.\" 49b50d902SRodney W. Grimes.\" Redistribution and use in source and binary forms, with or without 59b50d902SRodney W. Grimes.\" modification, are permitted provided that the following conditions 69b50d902SRodney W. Grimes.\" are met: 79b50d902SRodney W. Grimes.\" 1. Redistributions of source code must retain the above copyright 89b50d902SRodney W. Grimes.\" notice, this list of conditions and the following disclaimer. 99b50d902SRodney W. Grimes.\" 2. Redistributions in binary form must reproduce the above copyright 109b50d902SRodney W. Grimes.\" notice, this list of conditions and the following disclaimer in the 119b50d902SRodney W. Grimes.\" documentation and/or other materials provided with the distribution. 12*fbbd9655SWarner Losh.\" 3. Neither the name of the University nor the names of its contributors 139b50d902SRodney W. Grimes.\" may be used to endorse or promote products derived from this software 149b50d902SRodney W. Grimes.\" without specific prior written permission. 159b50d902SRodney W. Grimes.\" 169b50d902SRodney W. Grimes.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 179b50d902SRodney W. Grimes.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 189b50d902SRodney W. Grimes.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 199b50d902SRodney W. Grimes.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 209b50d902SRodney W. Grimes.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 219b50d902SRodney W. Grimes.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 229b50d902SRodney W. Grimes.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 239b50d902SRodney W. Grimes.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 249b50d902SRodney W. Grimes.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 259b50d902SRodney W. Grimes.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 269b50d902SRodney W. Grimes.\" SUCH DAMAGE. 279b50d902SRodney W. Grimes.\" 28a1a3d6f4SBryan Drewery.Dd October 23, 2015 299b50d902SRodney W. Grimes.Dt MKDEP 1 3062500372SRuslan Ermilov.Os 319b50d902SRodney W. Grimes.Sh NAME 329b50d902SRodney W. Grimes.Nm mkdep 339b50d902SRodney W. Grimes.Nd construct Makefile dependency list 349b50d902SRodney W. Grimes.Sh SYNOPSIS 351988cbc5SPhilippe Charnier.Nm 362b147068SDavid E. O'Brien.Op Fl ap 379b50d902SRodney W. Grimes.Op Fl f Ar file 389b50d902SRodney W. Grimes.Op Ar flags 3947dec781SRuslan Ermilov.Ar 409b50d902SRodney W. Grimes.Sh DESCRIPTION 41e8937ba0SPhilippe CharnierThe 42e8937ba0SPhilippe Charnier.Nm 43e8937ba0SPhilippe Charnierutility takes a set of flags for the C compiler and a list 449b50d902SRodney W. Grimesof C source files as arguments and constructs a set of include 459b50d902SRodney W. Grimesfile dependencies which are written into the file ``.depend''. 469b50d902SRodney W. GrimesAn example of its use in a Makefile might be: 479b50d902SRodney W. Grimes.Bd -literal -offset indent 489b50d902SRodney W. GrimesCFLAGS= -O -I../include 499b50d902SRodney W. GrimesSRCS= file1.c file2.c 509b50d902SRodney W. Grimes 519b50d902SRodney W. Grimesdepend: 529b50d902SRodney W. Grimes mkdep ${CFLAGS} ${SRCS} 539b50d902SRodney W. Grimes.Ed 549b50d902SRodney W. Grimes.Pp 559b50d902SRodney W. Grimeswhere the macro SRCS is the list of C source files and the macro 569b50d902SRodney W. GrimesCFLAGS is the list of flags for the C compiler. 579b50d902SRodney W. Grimes.Pp 582b147068SDavid E. O'BrienThe user has the ability to change the preprocessor and preprocessor options 596a3e8b0aSRuslan Ermilovused. 60a1a3d6f4SBryan DreweryFor instance, to use 61a1a3d6f4SBryan Drewery.Sy cc 62a1a3d6f4SBryan Dreweryas the preprocessor and to ignore system 632b147068SDavid E. O'Brienheaders, one would use 642b147068SDavid E. O'Brien.Bd -literal -offset indent 652b147068SDavid E. O'Briendepend: 66a1a3d6f4SBryan Drewery env MKDEP_CPP="cc -E" MKDEP_CPP_OPTS=-MM mkdep \\ 672b147068SDavid E. O'Brien ${CFLAGS} ${SRCS} 682b147068SDavid E. O'Brien.Ed 692b147068SDavid E. O'Brien.Pp 709b50d902SRodney W. GrimesThe options are as follows: 719b50d902SRodney W. Grimes.Bl -tag -width Ds 729b50d902SRodney W. Grimes.It Fl a 739b50d902SRodney W. GrimesAppend to the output file, 749b50d902SRodney W. Grimesso that multiple 758fe908efSRuslan Ermilov.Nm Ns 's 769b50d902SRodney W. Grimesmay be run from a single Makefile. 779b50d902SRodney W. Grimes.It Fl f 789b50d902SRodney W. GrimesWrite the include file dependencies to 799b50d902SRodney W. Grimes.Ar file , 809b50d902SRodney W. Grimesinstead of the default ``.depend''. 819b50d902SRodney W. Grimes.It Fl p 829b50d902SRodney W. GrimesCause 831988cbc5SPhilippe Charnier.Nm 849b50d902SRodney W. Grimesto produce dependencies of the form: 859b50d902SRodney W. Grimes.Bd -literal -offset indent 869b50d902SRodney W. Grimesprogram: program.c 879b50d902SRodney W. Grimes.Ed 889b50d902SRodney W. Grimes.Pp 899b50d902SRodney W. Grimesso that subsequent makes will produce 909b50d902SRodney W. Grimes.Ar program 919b50d902SRodney W. Grimesdirectly from its C module rather than using an intermediate 929b50d902SRodney W. Grimes.Pa \&.o 939b50d902SRodney W. Grimesmodule. 949b50d902SRodney W. GrimesThis is useful for programs whose source is contained in a single 959b50d902SRodney W. Grimesmodule. 969b88faecSRuslan Ermilov.El 972b147068SDavid E. O'Brien.Sh ENVIRONMENT 982b147068SDavid E. O'Brien.Bl -tag -width MKDEP_CPP_OPTS 992b147068SDavid E. O'Brien.It Ev CC 1006a3e8b0aSRuslan ErmilovSpecifies the C compiler to use. 1016a3e8b0aSRuslan ErmilovThe specified compiler is expected to have 102eb24696bSChris Costellooptions consistent with the GNU C compiler. 103a1a3d6f4SBryan DreweryThe default is 104a1a3d6f4SBryan Drewery.Sy cc . 1052b147068SDavid E. O'Brien.It Ev MKDEP_CPP 1066a3e8b0aSRuslan ErmilovSpecifies the preprocessor to use. 1076a3e8b0aSRuslan ErmilovThe default is "${CC} -E". 1082b147068SDavid E. O'Brien.It Ev MKDEP_CPP_OPTS 1096a3e8b0aSRuslan ErmilovSpecifies the non-CFLAGS options for the preprocessor. 1106a3e8b0aSRuslan ErmilovThe default is 1112b147068SDavid E. O'Brien"-M". 1129b50d902SRodney W. Grimes.El 1139b50d902SRodney W. Grimes.Sh FILES 1149b50d902SRodney W. Grimes.Bl -tag -width .depend -compact 1159b50d902SRodney W. Grimes.It Pa .depend 1169b50d902SRodney W. GrimesFile containing list of dependencies. 1179b50d902SRodney W. Grimes.El 1186c7216dfSRuslan Ermilov.Sh SEE ALSO 1196c7216dfSRuslan Ermilov.Xr cc 1 , 1206c7216dfSRuslan Ermilov.Xr cpp 1 , 1216c7216dfSRuslan Ermilov.Xr make 1 1229b50d902SRodney W. Grimes.Sh HISTORY 1239b50d902SRodney W. GrimesThe 1241988cbc5SPhilippe Charnier.Nm 1259b50d902SRodney W. Grimescommand appeared in 1269b50d902SRodney W. Grimes.Bx 4.3 Tahoe . 127