m

mkmf(1)

mkmf(1)

NAME

mkmf - make a make®le

SYNOPSIS

mkmf [-acdeil] [-fmake®le ] [-Ftemplate ] [-Mlanguage ] [ macroname=value ... ]

DESCRIPTION

The mkmf command creates a make®le that informs the make command how to construct and maintain programs and libraries (see make(1)). After gathering up all source code ®le names in the current working directory and inserting them into the make®le, mkmf scans source code ®les for included ®les and generates dependency information that is appended to the make®le. Source code ®les are identi®ed by their ®le name suf®xes. mkmf recognizes the following suf®xes:

.c

C

.C

C++

.f

FORTRAN

.h

Include ®les

.i

Pascal include ®les

.l

Lex or Lisp

.o

Object ®les

.p

Pascal

.r

Ratfor

.s

Assembler

.y

Yacc

The mkmf command checks for an existing make®le before creating one. If no -foption is present, mkmf tries the make®les makefile and Makefile, respectively.

After the make®le has been created, arbitrary changes can be made using a text editor. mkmf can also be used to re-edit the macro de®nitions in the make®le, regardless of changes that may have been made since it was created.

By default, mkmf creates a program make®le. To create a make®le that handles libraries, the -loption must be used.

Make Requests

Given a make®le created by mkmf, make recognizes the following requests:

all

Compile and load a program or library.

clean

Remove all object and core ®les.

clobber

Remove all ®les that can be regenerated.

depend

Update included ®le dependencies in a make®le.

echo

List the names of the source code ®les on standard output.

extract

Extract all object ®les from the library and place them in the same directory as the

 

source code ®les. The library is not altered.

index

Print an index of functions on standard output.

install

Compile and load the program or library and move it to its destination directory.

print

Print source code ®les on standard output.

tags

Create a tags ®le for the ex editor (see ex(1) and ctags(1)), for C, Pascal, and Fortran

 

source code ®les.

update

Recompile only if there are source code ®les that are newer than the program or library,

 

link and install the program or library.

Several 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 ®les, use:

make install clean

Macro De®nitions

mkmf understands the following macro de®nitions:

Section 1532

− 1 −

HP-UX Release 11i: December 2000