Annotation of 43BSDReno/share/doc/ucs/single/mkmf.n, revision 1.1.1.1

1.1       root        1: .TH MKMF 1 "28 June 1985"
                      2: .\" $Header: mkmf.n,v 1.8 86/01/12 00:53:14 lepreau Exp $
                      3: .UC 4
                      4: .SH NAME
                      5: mkmf \- makefile editor
                      6: .SH SYNOPSIS
                      7: .B mkmf
                      8: [\fB\-acdil\fR] [\fB\-f \fRmakefile] [\fB\-F \fRtemplate] [macroname=value ...]
                      9: .SH DESCRIPTION
                     10: .I Mkmf
                     11: creates a makefile that tells the
                     12: .I make
                     13: command how to construct and maintain programs and libraries.
                     14: After gathering up all the source code file names in the current working
                     15: directory and inserting them into the makefile,
                     16: .I mkmf
                     17: scans source code files for included
                     18: files and generates dependency information which is appended to the makefile.
                     19: Source code files are identified by their file name suffixes.
                     20: .I Mkmf
                     21: knows about the following suffixes:
                     22: .LP
                     23: .nf
                     24: .ta 1.5i +1i
                     25:        .c      C
                     26:        .e      Efl
                     27:        .F      Fortran
                     28:        .f      Fortran
                     29:        .h      Include files
                     30:        .i      Pascal include files
                     31:        .l      Lex or Lisp
                     32:        .o      Object files
                     33:        .p      Pascal
                     34:        .r      Ratfor
                     35:        .s      Assembler
                     36:        .y      Yacc
                     37: .fi
                     38: .DT
                     39: .LP
                     40: .I Mkmf
                     41: checks for an existing makefile before creating one. If no
                     42: .B \-f
                     43: option is present, the makefiles `makefile' and `Makefile' are tried
                     44: in order.
                     45: .LP
                     46: After the makefile has been created, arbitrary changes can be made using
                     47: a regular text editor.
                     48: .I Mkmf
                     49: can also be used to re-edit the macro definitions in the makefile, regardless
                     50: of changes that may have been made since it was created.
                     51: .LP
                     52: By default,
                     53: .I mkmf
                     54: creates a program makefile. To create a makefile that deals with libraries,
                     55: the
                     56: .B \-l
                     57: option must be used.
                     58: .LP
                     59: \fBMake Requests\fR
                     60: .LP
                     61: Given a makefile created by
                     62: .I mkmf,
                     63: .I make
                     64: recognizes the following requests:
                     65: .IP \fBall\fR 15
                     66: Compile and load a program or library.
                     67: .IP \fBclean\fR
                     68: Remove all unnecessary files.
                     69: .IP \fBdepend\fR
                     70: Edit the makefile and regenerate the dependency information.
                     71: .IP \fBextract\fR
                     72: Extract all the object files from the library and place them in the
                     73: same directory as the source code files. The library is not altered.
                     74: .IP \fBindex\fR
                     75: Print an index of functions on standard output.
                     76: .IP \fBinstall\fR
                     77: Compile and load the program or library and move it to its destination
                     78: directory.
                     79: .IP \fBlibrary\fR
                     80: Compile and load a library.
                     81: .IP \fBprint\fR
                     82: Print source code files on standard output.
                     83: .IP \fBtags\fR
                     84: Create a tags file for the
                     85: .I ex
                     86: editor, for C, Pascal, and Fortran source code files.
                     87: .IP \fBprogram\fR
                     88: Compile and link a program.
                     89: .IP \fBupdate\fR
                     90: Recompile only if there are source code files that are newer than the
                     91: program or library, link and install the program or library. In the case
                     92: of an out-of-date library, all the object files are extracted from the
                     93: library before any recompilation takes place.
                     94: .LP
                     95: Several requests may be given simultaneously. For example, to
                     96: compile and link a program,
                     97: move the program to its destination directory, and remove
                     98: any unnecessary object files:
                     99: .IP
                    100: make program install clean
                    101: .LP
                    102: \fBMacro Definitions\fR
                    103: .LP
                    104: .I Mkmf
                    105: understands the following macro definitions:
                    106: .IP CFLAGS 15
                    107: C compiler flags. After searching for included files in the directory
                    108: currently being processed,
                    109: .I mkmf
                    110: searchs in directories named in
                    111: .B \-I
                    112: compiler options, and then in the `/usr/include' directory.
                    113: .IP DEST
                    114: Directory where the program or library is to be installed.
                    115: .IP EXTHDRS
                    116: List of included files external to the current directory.
                    117: .I Mkmf
                    118: automatically updates this macro definition in the makefile if dependency
                    119: information is being generated.
                    120: .IP FFLAGS
                    121: Fortran compiler flags. After searching for included files in the directory
                    122: currently being processed,
                    123: .I mkmf
                    124: searchs in directories named in
                    125: .B \-I
                    126: compiler options, and then in the `/usr/include' directory.
                    127: .IP HDRS
                    128: List of included files in the current directory.
                    129: .I Mkmf
                    130: automatically updates this macro definition in the makefile.
                    131: .IP LIBRARY
                    132: Library name. This macro also implies the
                    133: .B \-l
                    134: option.
                    135: .IP LIBS
                    136: List of libraries needed by the link editor to resolve external references.
                    137: .IP MAKEFILE
                    138: Makefile name.
                    139: .IP OBJS
                    140: List of object files.
                    141: .I Mkmf
                    142: automatically updates this macro definition in the makefile.
                    143: .IP PROGRAM
                    144: Program name.
                    145: .IP SRCS
                    146: List of source code files.
                    147: .I Mkmf
                    148: automatically updates this macro definition in the makefile.
                    149: .IP SUFFIX
                    150: List of additional file name suffixes for
                    151: .I mkmf
                    152: to know about.
                    153: .LP
                    154: Both these and any other macro definitions already within the makefile may
                    155: be replaced by definitions on the command line in the form
                    156: .I "macroname=value".
                    157: For example, to change the C compiler flags, the program name, and the
                    158: destination directory in the makefile, the user might type the following line:
                    159: .LP
                    160: .nf
                    161:        mkmf  ``CFLAGS=\-I../include  \-O''  PROGRAM=mkmf  DEST=/usr/new
                    162: .fi
                    163: .LP
                    164: Note that macro definitions like CFLAGS with blanks in them
                    165: must be enclosed in double quote `"' marks.
                    166: .LP
                    167: \fBFile Name Suffixes\fR
                    168: .LP
                    169: .I Mkmf
                    170: can be instructed to recognize additional file name suffixes, or ignore ones
                    171: that it already knows about, by specifying suffix descriptions in
                    172: the SUFFIX macro definition. Each suffix description takes the
                    173: form `.\fIsuffix:tI\^\fR' where
                    174: .I t
                    175: is a character indicating the contents of the file (s = source file,
                    176: o = object file, h = header file, x = executable file) and
                    177: .I I
                    178: is an optional character indicating the include syntax for included
                    179: files (C = C syntax, F = Fortran, Efl, and Ratfor syntax, P = Pascal
                    180: syntax). The following table describes
                    181: the default configuration for
                    182: .I mkmf:
                    183: 
                    184: .nf
                    185: .ta 1.5i +1i
                    186:        .c:sC   C
                    187:        .e:sF   Efl
                    188:        .F:sF   Fortran
                    189:        .f:sF   Fortran
                    190:        .h:h    Include files
                    191:        .i:h    Pascal include files
                    192:        .l:sC   Lex or Lisp
                    193:        .o:o    Object files
                    194:        .p:sP   Pascal
                    195:        .r:sF   Ratfor
                    196:        .s:s    Assembler
                    197:        .y:sC   Yacc
                    198: .fi
                    199: .DT
                    200: .LP
                    201: For example, to change the object file suffix to .obj, undefine the Pascal
                    202: include file suffix, and prevent Fortran files from being scanned for
                    203: included files, the SUFFIX macro definition might look like:
                    204: .IP
                    205: \&"SUFFIX = .obj:o  .i:  .f:s"
                    206: .LP
                    207: \fBInclude Statement Syntax\fR
                    208: .LP
                    209: The syntax of include statements for C, Fortran, and Pascal source code are
                    210: of the form
                    211: .IP \fB\C:\fR
                    212: #include "\fIfilename\fR"
                    213: .RS
                    214: where # must be the first character in the line.
                    215: .RE
                    216: .IP \fB\Fortran:\fR
                    217: include '\fIfilename\fR'
                    218: .RS
                    219: INCLUDE '\fIfilename\fR'
                    220: .br
                    221: where the include statement starts in column 7.
                    222: .RE
                    223: .IP \fB\Pascal:\fR
                    224: #include "\fIfilename\fR"
                    225: .RS
                    226: #INCLUDE "\fIfilename\fR"
                    227: .br
                    228: where # must be the first character in the line.
                    229: .RE
                    230: .LP
                    231: \fBUser-Defined Templates\fR
                    232: .LP
                    233: If
                    234: .I mkmf
                    235: can not find a makefile within the current directory, it normally uses
                    236: one of the standard makefile templates, `p.Makefile' or `l.Makefile', in
                    237: /usr/new/lib unless the user has alternative `p.Makefile'
                    238: or `l.Makefile' template files in a directory $PROJECT/lib where
                    239: $PROJECT is the absolute pathname of the directory assigned to the PROJECT
                    240: environment variable.
                    241: .SH OPTIONS
                    242: .IP \fB\-a\fR
                    243: When searching a directory for source and include files, also consider files
                    244: which have names beginning with periods.  By default, 
                    245: .I mkmf
                    246: ignores
                    247: file names which have leading "dots," such as those of
                    248: backup files created by some
                    249: editors.
                    250: .IP \fB\-c\fR
                    251: Suppress `creating
                    252: .I makefile
                    253: from ...' message.
                    254: .IP \fB\-d\fR
                    255: Turn
                    256: .B off
                    257: scanning of source code for `include' files. Old dependency information
                    258: is left untouched in the makefile.
                    259: .IP "\fB\-f \fImakefile\fR"
                    260: Specify an alternative
                    261: .I makefile
                    262: file name. The default file name is `Makefile'.
                    263: .IP \fB\-i\fR
                    264: Cause
                    265: .I mkmf
                    266: to prompt the user for the name of the program or library, and the
                    267: directory where it is to be installed. If a carriage return is typed
                    268: in response to each of these queries,
                    269: .I mkmf
                    270: will assume that the default program name is
                    271: .I a.out
                    272: or the default library name is
                    273: .I lib.a,
                    274: and the destination directory is the current directory.
                    275: .IP \fB\-l\fR
                    276: Force the makefile to be a library makefile.
                    277: .IP "\fB\-F \fItemplate\fR"
                    278: Specify an alternative makefile
                    279: .I template
                    280: file name. The default program makefile template is `p.Makefile'
                    281: and the default library makefile template is `l.Makefile'.
                    282: .I Mkmf
                    283: normally looks for
                    284: .I template 
                    285: in /usr/new/lib or $PROJECT/lib. However,
                    286: .I template
                    287: can be specified as an absolute pathname.
                    288: .SH FILES
                    289: .nf
                    290: .ta \w'/usr/new/lib/p.Makefile'u+.5i
                    291: /usr/new/lib/p.Makefile        Standard program makefile template.
                    292: /usr/new/lib/l.Makefile        Standard library makefile template.
                    293: $PROJECT/lib/p.Makefile        User-defined program makefile template.
                    294: $PROJECT/lib/l.Makefile        User-defined library makefile template.
                    295: .fi
                    296: .DT
                    297: .SH "SEE ALSO"
                    298: ar(1), ctags(1), ex(1), ld(1), ls(1), make(1)
                    299: .sp
                    300: Feldman, S.I., "Make \- A Program for Maintaining Computer Programs"
                    301: .sp
                    302: Walden, K., "Automatic Generation of Make Dependencies", \fISoftware\-Practice
                    303: and Experience\fP, vol. 14, no. 6, pp. 575-585, June 1984.
                    304: .SH DIAGNOSTICS
                    305: Exit status 0 is normal. Exit status 1 indicates an error.
                    306: .SH AUTHOR
                    307: Peter J. Nicklin
                    308: .SH BUGS
                    309: The name of the makefile is included as a macro definition within the
                    310: makefile and must be changed if the makefile is renamed.
                    311: .LP
                    312: Since executable files are dependent on libraries, standard library
                    313: abbreviations must be expanded to full pathnames within the LIBS macro
                    314: definition in the makefile.
                    315: .LP
                    316: Generated dependency information appears after a line in the makefile
                    317: beginning with `###'. This line must
                    318: .B not
                    319: be removed, nor must any other information be inserted in the makefile
                    320: below this line.

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.