📄 imake.man
字号:
.\" $XConsortium: imake.man /main/29 1996/09/28 16:14:42 rws $.\" Copyright (c) 1993, 1994 X Consortium.\" .\" Permission is hereby granted, free of charge, to any person obtaining.\" a copy of this software and associated documentation files (the.\" "Software"), to deal in the Software without restriction, including.\" without limitation the rights to use, copy, modify, merge, publish,.\" distribute, sublicense, and/or sell copies of the Software, and to.\" permit persons to whom the Software is furnished to do so, subject to.\" the following conditions:.\" .\" The above copyright notice and this permission notice shall be included.\" in all copies or substantial portions of the Software..\" .\" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS.\" OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF.\" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT..\" IN NO EVENT SHALL THE X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR.\" OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,.\" ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR.\" OTHER DEALINGS IN THE SOFTWARE..\" .\" Except as contained in this notice, the name of the X Consortium shall.\" not be used in advertising or otherwise to promote the sale, use or.\" other dealings in this Software without prior written authorization.\" from the X Consortium..TH IMAKE 1 "Release 6.1" "X Version 11".SH NAMEimake \- C preprocessor interface to the make utility.SH SYNOPSIS\fBimake\fP [ \fB\-D\fP\fIdefine\fP ] [ \fB\-I\fP\fIdir\fP ][ \fB\-T\fP\fItemplate\fP ][ \fB\-f\fP \fIfilename\fP ] [ \fB\-C\fP \fIfilename\fP ][ \fB\-s\fP \fIfilename\fP ] [ \fB\-e\fP ][ \fB\-v\fP ].SH DESCRIPTION.I Imakeis used to generate \fIMakefiles\fP from a template, a set of \fIcpp\fP macro functions,and a per-directory input file called an \fIImakefile\fP. This allows machinedependencies (such as compiler options, alternate command names, and special\fImake\fP rules) to be kept separate from the descriptions of thevarious items to be built..SH OPTIONSThe following command line options may be passed to \fIimake\fP:.TP 8.B \-D\fIdefine\fPThis option is passed directly to \fIcpp\fP. It is typically used to setdirectory-specific variables. For example, the X Window System uses thisflag to set \fITOPDIR\fP to the name of the directory containing the topof the core distribution and \fICURDIR\fP to the name of the current directory, relative to the top..TP 8.B \-I\fIdirectory\fPThis option is passed directly to \fIcpp\fP. It is typically used to indicate the directory in which the \fIimake\fP template and configurationfiles may be found..TP 8.B \-T\fItemplate\fPThis option specifies the name of the master template file (which is usuallylocated in the directory specified with \fI\-I\fP) used by \fIcpp\fP.The default is \fIImake.tmpl\fP..TP 8.B \-f \fIfilename\fPThis option specifies the name of the per-directory input file. The defaultis \fIImakefile\fP..TP 8.B \-C \fIfilename\fPThis option specifies the name of the .c file that is constructed in thecurrent directory. The default is \fIImakefile.c\fP..TP 8.B \-s \fIfilename\fPThis option specifies the name of the \fImake\fP description file to be generated but \fImake\fP should not be invoked.If the \fIfilename\fP is a dash (\-), the output is written to \fIstdout\fP. The default is to generate, butnot execute, a \fIMakefile\fP..TP 8.B \-eThis option indicates the \fIimake\fP should execute the generated\fIMakefile\fP. The default is to leave this to the user..TP 8.B \-vThis option indicates that \fIimake\fP should print the \fIcpp\fP command line that it is using to generate the \fIMakefile\fP..SH "HOW IT WORKS"\fIImake\fP invokes \fIcpp\fP with any \fI\-I\fP or \fI\-D\fP flags passedon the command line and passes the name of a file containing thefollowing 3 lines:.sp.nf #define IMAKE_TEMPLATE "Imake.tmpl" #define INCLUDE_IMAKEFILE <Imakefile> #include IMAKE_TEMPLATE.fi.spwhere \fIImake.tmpl\fP and \fIImakefile\fP may be overridden by the \fI\-T\fP and \fI\-f\fP command options, respectively..PPThe IMAKE_TEMPLATE typicallyreads in a file containing machine-dependent parameters (specified as \fIcpp\fP symbols), a site-specific parameters file,a file defining variables,a filecontaining \fIcpp\fP macro functions for generating \fImake\fP rules, andfinally the \fIImakefile\fP (specified by INCLUDE_IMAKEFILE) in the current directory. The \fIImakefile\fP uses the macro functions to indicate whattargets should be built; \fIimake\fP takes care of generating the appropriaterules..PP.I Imakeconfiguration files contain two types of variables, imake variablesand make variables. The imake variables are interpreted by cpp when.I imakeis run. By convention they are mixed case. The make variables arewritten into the.I Makefilefor later interpretation by.I make.By convention make variables are upper case..PPThe rules file (usually named \fIImake.rules\fP in the configurationdirectory) contains a variety of \fIcpp\fP macro functions that areconfigured according to the current platform. \fIImake\fP replaces any occurrences of the string ``@@'' with a newline to allow macros thatgenerate more than one line of \fImake\fP rules. For example, the macro.ta 1i 1.6i 5i.nf#define program_target(program, objlist) @@\eprogram: objlist @@\e $(CC) \-o $@ objlist $(LDFLAGS).fiwhen called with.I "program_target(foo, foo1.o foo2.o)"will expand to.nffoo: foo1.o foo2.o $(CC) \-o $@ foo1.o foo2.o $(LDFLAGS).fi.PP\fIImake\fP also replaces any occurrences of the word ``XCOMM'' withthe character ``#'' to permit placing comments in the Makefile withoutcausing ``invalid directive'' errors from the preprocessor..PPSome complex \fIimake\fP macros require generated \fImake\fP variableslocal to each invocation of the macro, often because their valuedepends on parameters passed to the macro.Such variables can be created by using an \fIimake\fP variableof the form \fBXVARdef\fP\fIn\fP, where \fIn\fP is a single digit.A unique \fImake\fP variable will be substituted. Later occurrencesof the variable \fBXVARuse\fP\fIn\fP willbe replaced by the variable created by the corresponding\fBXVARdef\fP\fIn\fP..PPOn systems whose \fIcpp\fP reduces multiple tabs and spaces to a singlespace, \fIimake\fP attempts to put back any necessary tabs (\fImake\fP isvery picky about the difference between tabs and spaces). For this reason,colons (:) in command lines must be preceded by a backslash (\\)..SH "USE WITH THE X WINDOW SYSTEM"The X Window System uses \fIimake\fP extensively, for both full builds withinthe source tree and external software. As mentioned above, two specialvariables, \fITOPDIR\fP and \fICURDIR,\fP are set to make referencing filesusing relative path names easier. For example, the following command isgenerated automatically to build the \fIMakefile\fP in the directory\fIlib/X/\fP (relative to the top of the sources):.sp.nf % ../.././config/imake \-I../.././config \\ \-DTOPDIR=../../. \-DCURDIR=./lib/X.fi.spWhen building X programs outside the source tree, a special symbol\fIUseInstalled\fP is defined and \fITOPDIR\fP and\fICURDIR\fP are omitted. If the configuration files have beenproperly installed, the script \fIxmkmf\fP(1) may be used..SH "INPUT FILES"Here is a summary of the files read by.I imakeas used by X.The indentation shows what files include what other files..nf.sp.ta 3i Imake.tmpl generic variables site.def site-specific, BeforeVendorCF defined *.cf machine-specific *Lib.rules shared library rules site.def site-specific, AfterVendorCF defined Imake.rules rules Project.tmpl X-specific variables *Lib.tmpl shared library variables Imakefile Library.tmpl library rules Server.tmpl server rules Threads.tmpl multi-threaded rules.fi.LPNote that \fIsite.def\fP gets included twice, once before the\fI*.cf\fP file and once after. Although most site customizationsshould be specified after the \fI*.cf\fP file, some, such as thechoice of compiler, need to be specified before, because othervariable settings may depend on them..LPThe first time \fIsite.def\fP is included, the variable BeforeVendorCFis defined, and the second time, the variable AfterVendorCF isdefined. All code in \fIsite.def\fP should be inside an #ifdef forone of these symbols..SH FILES.ta 3iImakefile.c temporary input file for cpp.br/tmp/Imf.XXXXXX temporary Makefile for -s.br/tmp/IIf.XXXXXX temporary Imakefile if specified Imakefile uses # comments.br/lib/cpp default C preprocessor.DT.SH "SEE ALSO"make(1), xmkmf(1).brS. I. Feldman,.IMake \(em A Program for Maintaining Computer Programs.SH "ENVIRONMENT VARIABLES"The following environment variables may be set, however their use is notrecommended as they introduce dependencies that are not readily apparentwhen \fIimake\fP is run:.TP 5.B IMAKEINCLUDEIf defined, this specifies a ``\-I'' include argument to pass to theC preprocessor. E.g., ``\-I/usr/X11/config''..TP 5.B IMAKECPPIf defined, this should be a valid path to a preprocessor program.E.g., ``/usr/local/cpp''.By default,.I imakewill use /lib/cpp..TP 5.B IMAKEMAKEIf defined, this should be a valid path to a make program,such as ``/usr/local/make''.By default,.I imakewill use whatever.I makeprogram is found using.I execvp(3).This variable is only used if the ``\-e'' option is specified..SH "AUTHOR"Todd Brunhoff, Tektronix and MIT Project Athena; Jim Fulton, MIT X Consortium
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -