|
version 1.1.1.1, 1994/04/27 07:07:36
|
version 1.1.1.2, 1996/01/03 06:47:02
|
|
|
|
| .\" $XConsortium: mkdepend.man,v 1.15 94/04/17 20:10:37 gildea Exp $ |
.\" $XConsortium: mkdepend.man /main/18 1995/12/15 14:00:41 gildea $ |
| .\" Copyright (c) 1993, 1994 X Consortium | .\" Copyright (c) 1993, 1994 X Consortium |
| .\" | .\" |
| .\" Permission is hereby granted, free of charge, to any person obtaining a | .\" Permission is hereby granted, free of charge, to any person obtaining a |
|
|
|
| .\" be used in advertising or otherwise to promote the sale, use or other | .\" be used in advertising or otherwise to promote the sale, use or other |
| .\" dealing in this Software without prior written authorization from the | .\" dealing in this Software without prior written authorization from the |
| .\" X Consortium. | .\" X Consortium. |
| .TH MAKEDEPEND 1 "Release 6" "X Version 11" |
.TH MAKEDEPEND 1 "Release 6.1" "X Version 11" |
| .UC 4 | .UC 4 |
| .SH NAME | .SH NAME |
| makedepend \- create dependencies in makefiles | makedepend \- create dependencies in makefiles |
| .SH SYNOPSIS | .SH SYNOPSIS |
| .B makedepend | .B makedepend |
| [ | [ |
| .B \-Dname=def |
.BI \-D name\fB=\fPdef |
| ] [ | ] [ |
| .B \-Dname |
.BI \-D name |
| ] [ | ] [ |
| .B \-Iincludedir |
.BI \-I includedir |
| ] [ | ] [ |
| .B \-Yincludedir |
.BI \-Y includedir |
| ] [ | ] [ |
| .B \-a | .B \-a |
| ] [ | ] [ |
| .B \-fmakefile |
.BI \-f makefile |
| ] [ | ] [ |
| .B \-oobjsuffix |
.BI \-o objsuffix |
| ] [ | ] [ |
| .B \-pobjprefix |
.BI \-p objprefix |
| ] [ | ] [ |
| .B \-sstring |
.BI \-s string |
| ] [ | ] [ |
| .B \-wwidth |
.BI \-w width |
| ] [ | ] [ |
| .B \-v | .B \-v |
| ] [ | ] [ |
| .B \-m | .B \-m |
| ] [ | ] [ |
| \-\^\- | \-\^\- |
| .B otheroptions |
.I otheroptions |
| \-\^\- | \-\^\- |
| ] | ] |
| sourcefile .\|.\|. |
.I sourcefile |
| |
\&.\|.\|. |
| .br | .br |
| .SH DESCRIPTION | .SH DESCRIPTION |
| .B Makedepend |
The |
| reads each |
.B makedepend |
| |
program reads each |
| .I sourcefile | .I sourcefile |
| in sequence and parses it like a C-preprocessor, | in sequence and parses it like a C-preprocessor, |
| processing all | processing all |
|
|
|
| .I #ifdef, | .I #ifdef, |
| .I #ifndef, | .I #ifndef, |
| .I #endif, | .I #endif, |
| .I #if |
.I #if, |
| |
.I #elif |
| and | and |
| .I #else | .I #else |
| directives so that it can correctly tell which | directives so that it can correctly tell which |
|
|
|
| directly or indirectly, | directly or indirectly, |
| is what | is what |
| .B makedepend | .B makedepend |
| calls a "dependency". |
calls a \fIdependency.\fP |
| These dependencies are then written to a | These dependencies are then written to a |
| .I makefile | .I makefile |
| in such a way that | in such a way that |
|
|
|
| .sp | .sp |
| sourcefile.o:\0dfile .\|.\|. | sourcefile.o:\0dfile .\|.\|. |
| .sp | .sp |
| Where "sourcefile.o" is the name from the command |
Where \fIsourcefile.o\fP is the name from the command |
| line with its suffix replaced with ".o", |
line with its suffix replaced with ``.o'', |
| and "dfile" is a dependency discovered in a |
and \fIdfile\fP is a dependency discovered in a |
| .I #include | .I #include |
| directive while parsing | directive while parsing |
| .I sourcefile | .I sourcefile |
|
|
|
| .SH EXAMPLE | .SH EXAMPLE |
| Normally, | Normally, |
| .B makedepend | .B makedepend |
| will be used in a makefile target so that typing "make depend" will |
will be used in a makefile target so that typing ``make depend'' will |
| bring the dependencies up to date for the makefile. | bring the dependencies up to date for the makefile. |
| For example, | For example, |
| .nf | .nf |
|
|
|
| makedepend\0\-\^\-\0$(CFLAGS)\0\-\^\-\0$(SRCS) | makedepend\0\-\^\-\0$(CFLAGS)\0\-\^\-\0$(SRCS) |
| .fi | .fi |
| .SH OPTIONS | .SH OPTIONS |
| .B Makedepend |
The program |
| will ignore any option that it does not understand so that you may use | will ignore any option that it does not understand so that you may use |
| the same arguments that you would for | the same arguments that you would for |
| .B cc(1). | .B cc(1). |
| .TP 5 | .TP 5 |
| .B \-Dname=def or \-Dname |
.B \-D\fIname\fP=\fIdef\fP \fRor\fP \-D\fIname\fP |
| Define. | Define. |
| This places a definition for | This places a definition for |
| .I name | .I name |
|
|
|
| .B makedepend's | .B makedepend's |
| symbol table. | symbol table. |
| Without | Without |
| .I =def |
.I =def\| |
| the symbol becomes defined as "1". |
the symbol becomes defined as ``1''. |
| .TP 5 | .TP 5 |
| .B \-Iincludedir |
.B \-I\fIincludedir\fP |
| Include directory. | Include directory. |
| This option tells | This option tells |
| .B makedepend | .B makedepend |
|
|
|
| only searches the standard include directories (usually /usr/include | only searches the standard include directories (usually /usr/include |
| and possibly a compiler-dependent directory). | and possibly a compiler-dependent directory). |
| .TP 5 | .TP 5 |
| .B \-Yincludedir |
.B \-Y\fIincludedir\fP |
| Replace all of the standard include directories with the single specified | Replace all of the standard include directories with the single specified |
| include directory; you can omit the | include directory; you can omit the |
| .I includedir | .I includedir |
|
|
|
| .B \-a | .B \-a |
| Append the dependencies to the end of the file instead of replacing them. | Append the dependencies to the end of the file instead of replacing them. |
| .TP 5 | .TP 5 |
| .B \-fmakefile |
.B \-f\fImakefile\fP |
| Filename. | Filename. |
| This allows you to specify an alternate makefile in which | This allows you to specify an alternate makefile in which |
| .B makedepend | .B makedepend |
| can place its output. | can place its output. |
| |
Specifying ``\-'' as the file name (i.e., \fB\-f\-\fP) sends the |
| |
output to standard output instead of modifying an existing file. |
| .TP 5 | .TP 5 |
| .B \-oobjsuffix |
.B \-o\fIobjsuffix\fP |
| Object file suffix. | Object file suffix. |
| Some systems may have object files whose suffix is something other | Some systems may have object files whose suffix is something other |
| than ".o". |
than ``.o''. |
| This option allows you to specify another suffix, such as | This option allows you to specify another suffix, such as |
| ".b" with |
``.b'' with |
| .I -o.b |
.I \-o.b |
| or ":obj" |
or ``:obj'' |
| with | with |
| .I -o:obj |
.I \-o:obj |
| and so forth. | and so forth. |
| .TP 5 | .TP 5 |
| .B \-pobjprefix |
.B \-p\fIobjprefix\fP |
| Object file prefix. | Object file prefix. |
| The prefix is prepended to the name of the object file. This is | The prefix is prepended to the name of the object file. This is |
| usually used to designate a different directory for the object file. | usually used to designate a different directory for the object file. |
| The default is the empty string. | The default is the empty string. |
| .TP 5 | .TP 5 |
| .B \-sstring |
.B \-s\fIstring\fP |
| Starting string delimiter. | Starting string delimiter. |
| This option permits you to specify | This option permits you to specify |
| a different string for | a different string for |
| .B makedepend | .B makedepend |
| to look for in the makefile. | to look for in the makefile. |
| .TP 5 | .TP 5 |
| .B \-wwidth |
.B \-w\fIwidth\fP |
| Line width. | Line width. |
| Normally, | Normally, |
| .B makedepend | .B makedepend |
|
|
|
| compatibility, and to aid in debugging problems related to multiple | compatibility, and to aid in debugging problems related to multiple |
| inclusion. | inclusion. |
| .TP 5 | .TP 5 |
| .B "\-\^\- options \-\^\-" |
.B "\-\^\- \fIoptions\fP \-\^\-" |
| If | If |
| .B makedepend | .B makedepend |
| encounters a double hyphen (\-\^\-) in the argument list, | encounters a double hyphen (\-\^\-) in the argument list, |
|
|
|
| are processed normally. | are processed normally. |
| .SH ALGORITHM | .SH ALGORITHM |
| The approach used in this program enables it to run an order of magnitude | The approach used in this program enables it to run an order of magnitude |
| faster than any other "dependency generator" I have ever seen. |
faster than any other ``dependency generator'' I have ever seen. |
| Central to this performance are two assumptions: | Central to this performance are two assumptions: |
| that all files compiled by a single | that all files compiled by a single |
| makefile will be compiled with roughly the same | makefile will be compiled with roughly the same |
| .I -I |
.I \-I |
| and | and |
| .I -D |
.I \-D |
| options; | options; |
| and that most files in a single directory will include largely the | and that most files in a single directory will include largely the |
| same files. | same files. |
|
|
|
| for each. | for each. |
| Thus, the first file on the command line will take an amount of time | Thus, the first file on the command line will take an amount of time |
| proportional to the amount of time that a normal C preprocessor takes. | proportional to the amount of time that a normal C preprocessor takes. |
| But on subsequent files, if it encounter's an include file |
But on subsequent files, if it encounters an include file |
| that it has already parsed, it does not parse it again. | that it has already parsed, it does not parse it again. |
| .PP | .PP |
| For example, | For example, |