📄 mkmf.man
字号:
.\" Copyright (c) 1983, 1985, 1991, 1993 Peter J. Nicklin..\" Copyright (c) 1991, 1993 Version Technology..\" All Rights Reserved..\".\" $License: VT.1.1 $.\" Redistribution and use in source and binary forms, with or without.\" modification, are permitted provided that the following conditions.\" are met: (1) Redistributions of source code must retain the above.\" copyright notice, this list of conditions and the following.\" disclaimer. (2) Redistributions in binary form must reproduce the.\" above copyright notice, this list of conditions and the following.\" disclaimer in the documentation and/or other materials provided.\" with the distribution. (3) All advertising materials mentioning.\" features or use of this software must display the following.\" acknowledgement: ``This product includes software developed by.\" Version Technology.'' Neither the name of Version Technology nor.\" the name of Peter J. Nicklin may be used to endorse or promote.\" products derived from this software without specific prior written.\" permission..\".\" THIS SOFTWARE IS PROVIDED BY VERSION TECHNOLOGY ``AS IS'' AND ANY.\" EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL VERSION TECHNOLOGY BE.\" LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,.\" OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,.\" PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR.\" PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY.\" OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE.\" USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH.\" DAMAGE..\".\" Report problems and direct questions to nicklin@netcom.com.\".\" $Header: mkmf.man,v 4.14 93/05/26 00:10:12 nicklin Exp $.TH MKMF 1.SH NAMEmkmf \- make a makefile.SH SYNOPSIS.B mkmf.RB [ \|\-acdeilLS\| ].RB [ \|\-f.IR makefile\| ].RB [ \|\-F.IR template\| ].RB [ \|\-M.IR language\| ].RI [ \|macroname=value \ \|.\|.\|.\|].SH DESCRIPTION.I mkmfcreates a makefile that informs the.IR make (1)command how to construct and maintain programs and libraries.After gathering up all source code file names in the current workingdirectory and inserting them into the makefile,.I mkmfscans source code files for included filesand generates dependency information that is appended to the makefile.Source code files are identified by their file name suffixes..I mkmfrecognizes the following suffixes:.RS.TP 8.B .cC.PD 0.TP.B .CC+\h'-.1v'+.TP.B .fFortran.TP.B .hInclude files.TP.B .iPascal include files.TP.B .lLex or Lisp.TP.B .oObject files.TP.B .pPascal.TP.B .rRatfor.TP.B .sAssembler.TP.B .yYacc.PD.RE.PP.I mkmfchecks for an existing makefile before creating one. If no.B \-foption is present,.I mkmftries the makefiles.BR makefileand.BR Makefile ,respectively..PPAfter the makefile has been created,arbitrary changes can be made using a text editor..I mkmfcan also be used to re-edit the macro definitions in the makefile,regardless of changes that may have been made since it was created..PPBy default,.I mkmfcreates a program makefile.To create a makefile that handles libraries, either the.B \-lor.B \-Loptions must be used..PP.SS Make RequestsGiven a makefile created by.I mkmf,.I makerecognizes the following requests:.RS.TP 12.B allCompile and load a program or library..TP.B cleanRemove all object and core files..TP.B clobberRemove all files that can be regenerated..TP.B dependUpdate included file dependencies in a makefile..TP.B echoList the names of the source code files on standard output..TP.B extractExtract all object files from the library and place them in thesame directory as the source code files. The library is not altered..TP.B indexPrint an index of functions on standard output..TP.B installCompile and load the program or libraryand move it to its destination directory..TP.B printPrint source code files on standard output..TP.B tagsCreate a tags file for the.IR ex (1)editor, for C, Pascal, and Fortran source code files..RE.PPSeveral requests can be given simultaneously.For example, to (1) compile and link a program,(2) move the program to its destination directory,and (3) remove any unnecessary object files, use:.IP.B make install clean.SS Macro Definitions.I mkmfunderstands the following macro definitions:.TP 15.SM CFLAGSC compiler flags.After searching for included files in the directory currently being processed,.I mkmfsearches in directories named in.B \-Icompiler options and then in the.B /usr/includedirectory..TP.SM COMPILESYSTYPELocation of.BR /usr/include .If the .SM COMPILESYSTYPEmacro or environment variable is defined,.I mkmfsearches for included files in.BI / \s-1$COMPILESYSTYPE\s0 /usr/includeinstead of.BR /usr/include ..TP.SM CXXFLAGSC+\h'-.1v'+ compiler flags.After searching for included files in the directorycurrently being processed,.I mkmfsearches in directories named in.B \-Icompiler options and then in the.B /usr/include/\s-1CC\s0directory, followed by the.B /usr/includedirectory..TP.SM C+\h'-.1v'+FLAGSC+\h'-.1v'+ compiler flags.After searching for included files in the directorycurrently being processed,.I mkmfsearches in directories named in.B \-Icompiler options and then in the.B /usr/include/\s-1CC\s0directory, followed by the.B /usr/includedirectory..TP.SM CCFLAGSC+\h'-.1v'+ compiler flags.After searching for included files in the directorycurrently being processed,.I mkmfsearches in directories named in.B \-Icompiler options and then in the.B /usr/include/\s-1CC\s0directory, followed by the.B /usr/includedirectory..TP.SM DESTDirectory where the program or library is to be installed..TP.SM EXTHDRSList of included files external to the current directory..I mkmfautomatically updates this macro definition in the makefileif dependency information is being generated..TP.SM FFLAGSFortran compiler flags.After searching for included files in the directory currently being processed,.I mkmfsearches in directories named in.B \-Icompiler options, then in the.B /usr/includedirectory..TP.SM HDRSList of included files in the current directory..I mkmfautomatically updates this macro definition in the makefile..TP.SM INSTALLInstallation program name..TP.SM LDLink editor name..TP.SM LDFLAGSLink editor flags. Before searching for libraries in the.B /liband.B /usr/libdirectories,.I mkmfsearches for libraries in directories named by.B \-Llink editor options..TP.SM LIBRARYLibrary name. This macro also implies the.B \-loption..TP.SM LIBSList of libraries needed by the link editor to resolve external references.Since executable files depend on libraries,.I mkmfexpands each library.BI \-l \^xoption to.BI /lib/lib \^x .aor.BI /usr/lib/lib \^x .a .If the.SM LPATHenvironment variable is defined, it should contain a colon-separated listof directories to search instead of the default library directories..TP.SM MAKEFILEMakefile name..TP.SM OBJSList of object files..I mkmfautomatically updates this macro definition in the makefile..TP.SM PROGRAMProgram name..TP.SM SRCSList of source code files..I mkmfautomatically updates this macro definition in the makefile..TP.SM SUFFIXList of additional file name suffixes for.I mkmfto know about..TP.SM SYSHDRSList of included files found in the.B /usr/includedirectory hierarchy..I mkmfautomatically updates this macro definition in the makefileif dependency information is being generated.If.SM SYSHDRSis omitted from the makefile,.I mkmfdoes not generate.B /usr/includedependencies..TP.SM VPATHList of source code directories separated by colons or spaces..I mkmfwill search for files in the current directory, and then ineach of the directories defined by.SM VPATH..PPBoth these and any other macro definitions already within the makefilecan be replaced by definitions on the command line in the form.IB macroname = value\fR.For example, to change the C compiler flags and the program name,type the following line:.IP\fB mkmf "\s-1CFLAGS\s0=\-I../include \-O" \s-1PROGRAM\s0=mkmf\fR.PPNote that macro definitions such as.SM CFLAGSwith blanks in them must be enclosed in double quote (\fB"\fR) marks..SS EnvironmentThe environment is read by.IR mkmf .All variables are assumed to be macro definitions with the exception of.SM HDRS,.SM EXTHDRS,.SM SRCS,and.SM OBJS.Environment variables are processed after command line macro definitionsand the macro definitions in a.IR makefile .The.B \-eoption forces the environment to override the macro definitions in a.IR makefile ..SS File Name Suffixes.I mkmfcan recognize additional file name suffixes or ignore onesthat it already recognizes by specifying suffix descriptions in the.SM SUFFIXmacro definition.Each suffix description takes the form.BI . suffix : tIwhere.I tis a character indicating the contents of the file.RB ( \|s= source file,.B o= object file,.B h= header file,.B x= executable file) and.I Iis an optional character indicating the include syntax for header files.RB ( C= C syntax,.B C+\h'-.1v'+= C syntax plus the addition of.B /usr/include/\s-1CC\s0as a standard search directory,.B F= Fortran and Ratfor syntax,.B P= Pascal syntax).The following list shows the default configuration for.I mkmf:.RS.TP 12.B .c:sCC.PD 0.TP.B .C:sC+\h'-.1v'+C+\h'-.1v'+.TP.B .f:sFFortran.TP.B .h:hInclude files.TP.B .i:hPascal include files.TP.B .l:sCLex or Lisp.TP.B .o:oObject files.TP.B .p:sPPascal.TP.B .r:sFRatfor.TP.B .s:sAssembler.TP.B .y:sCYacc.PD.RE.PPFor example, to change the object file suffix to.BR .obj ,undefine the Pascal include file suffix,and prevent Fortran files from being scanned for included files, the.SM SUFFIXmacro definition could be:.IP.B\&\s-1SUFFIX\s0 = .obj:o .i: .f:s.SS Include Statement SyntaxThe syntax of include statements for C, C+\h'-.1v'+,Fortran, and Pascal source code are of the form:.TP.B C/C+\h'-.1v'+:.br#include "\fIfilename\fR".br#include <\fIfilename\fR>.brwhere.B #must be the first non-white space character in the line..TP.B Fortran:.br#include "\fIfilename\fR".br#include <\fIfilename\fR>.br$include '\fIfilename\fR'$.br$\s-1INCLUDE\s0 '\fIfilename\fR'$.brwhere.B $must be the first non-white space character in the line.Alternatively, the.B $can be omitted if the include statement starts in column 7.In either case the trailing.B $can be omitted..TP.B Pascal:.br#include "\fIfilename\fR".br#include <\fIfilename\fR>.br$include '\fIfilename\fR'$.br$INCLUDE '\fIfilename\fR'$.brwhere.B $must be the first non-white space character in the line and the trailing.B $is optional..SS User-Defined Templates.PPIf.I mkmfcannot find a makefile within the current directory,it normally uses one of the standard makefile templates,.BR C.p ,.BR C.l ,or.BR C.L ,in.B INSTALLDIR/lib/mkmfunless the user has alternative.BR C.p ,.BR C.l ,or.B C.Ltemplate files in a directory.SM.B $PROJECT\s0/lib/mkmfwhere.B.SM $PROJECTis the absolute path name of the directory assigned to the.SM PROJECTenvironment variable..SS Options.I mkmfrecognizes the following options:.TP 15.B \-aInclude source files beginning with a.B \&.in the makefile..TP.B \-cSuppress `creating.I makefilefrom .\|.\|.'message..TP.B \-dTurn off scanning of source code for.B includefiles.Old dependency information is left untouched in the makefile..TP.B \-eEnvironment variables override macro definitions within.IR makefile s..TP.BI \-f \|makefileSpecify an alternative.I makefilefile name.The default file name is.BR Makefile ..TP.B \-iPrompt the user for the name of the program or libraryand the directory where it is to be installed.If a carriage-return is typed in response to each of these queries,.I mkmfassumes that the default program name is.B a.outor the default library name is.BR lib.a ,and the destination directory is the current directory..TP.B \-lForce the makefile to be a library makefile..TP.B \-LForce the makefile to be a library makefile containing object file namesdefined as library members..TP.BI \-F \|templateSpecify an alternative makefile template path name.The path name can be relative or absolute..TP.BI \-M \|languageSpecify an alternative.IR language -specificmakefile template.The default language is C and the corresponding programand library makefile templates are.BR C.p ,and.B C.lor.BR C.L ,respectively..I mkmflooks for these templates in.B INSTALLDIR/lib/mkmfor.SM.BR $PROJECT\s0/lib/mkmf ..TP.B \-SSymbolically link source code files found in directories listed inthe VPATH macro into the current directory. Additionally, if the.B \-Soption is repeated, remove any symbolic links to files in directoriesnot listed in the VPATH macro..SH DIAGNOSTICSExit status 0 is normal. Exit status 1 indicates an error..SH WARNINGSThe name of the makefile is included as a macro definitionwithin the makefile and must be changed if the makefile is renamed..PPGenerated dependency information appears after a line in the makefilebeginning with.BR ### .This line must not be removed,nor must any other information be inserted in the makefile below this line..PPThe name of a program or library must not conflict with any predefinedtarget names in a makefile..SH AUTHORPeter J. Nicklin.SH FILES.TP 25INSTALLDIR/lib/mkmf/C.pStandard program template.PD 0.TPINSTALLDIR/lib/mkmf/C.lStandard library template.TPINSTALLDIR/lib/mkmf/C.LAlternative library template.TP\s-1$PROJECT\s0/lib/mkmf/C.pUser-defined program template.TP\s-1$PROJECT\s0/lib/mkmf/C.lUser-defined library template.TP\s-1$PROJECT\s0/lib/mkmf/C.LAlternative user-defined library template.PD.SH SEE ALSOar(1), ctags(1), ld(1), make(1)..PP"Make \- A Program for Maintaining Computer Programs",\fISoftware\-Practice and Experience\fP, Feldman, S.I., vol. 9, no. 4,pp. 255-265, April 1979..PP"Automatic Generation of Make Dependencies",\fISoftware\-Practice and Experience\fP, Walden, K., vol. 14, no. 6,pp. 575-585, June 1984.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -