version 1.17, 1999/03/17 17:35:01 |
version 1.18, 1999/05/16 21:53:31 |
|
|
.Nm make |
.Nm make |
.Nd maintain program dependencies |
.Nd maintain program dependencies |
.Sh SYNOPSIS |
.Sh SYNOPSIS |
.Nm make |
.Nm |
.Op Fl BPSeiknqrst |
.Op Fl BPSeiknqrst |
.Op Fl D Ar variable |
.Op Fl D Ar variable |
.Op Fl d Ar flags |
.Op Fl d Ar flags |
|
|
.Xr mkdep 1) . |
.Xr mkdep 1) . |
.Pp |
.Pp |
This manual page is intended as a reference document only. |
This manual page is intended as a reference document only. |
For a more thorough description of |
For a more thorough introduction to |
.Nm make |
.Nm make |
and makefiles, please refer to |
and makefiles, please refer to |
.%T "Make \- A Tutorial" . |
.%T "Make \- A Tutorial" . |
|
|
.Nm make |
.Nm make |
searches for an alternate directory to place target files -- it |
searches for an alternate directory to place target files -- it |
will attempt to change into this special directory. |
will attempt to change into this special directory. |
|
First, if |
|
.Ev MAKEOBJDIRPREFIX |
|
is defined, |
.Nm make |
.Nm make |
first tries to change into the prepend the path named by the environment |
prepends its contents to the current directory name and tries for |
variable |
the resulting directory. If that fails, |
|
.Nm make |
|
remains in the current directory. |
|
If |
.Ev MAKEOBJDIRPREFIX |
.Ev MAKEOBJDIRPREFIX |
to |
is not defined, |
.Va .CURDIR . |
.Nm make |
If that fails, it then |
checks |
tries to change into the directory named by the environment |
.Ev MAKEOBJDIR |
variable |
and tries to change into that directory. Should that fail, |
.Ev MAKEOBJDIR . |
|
If that fails, it tries to change into the directory named |
|
.Pa obj.$MACHINE |
|
(if the environment variable |
|
.Ev MACHINE |
|
is not set, |
|
.Nm make |
.Nm make |
calls |
remains in the current directory. If |
.Xr uname 2 |
.Ev MAKEOBJDIR |
to determine the type of machine). If it still has found no special |
is not defined, it tries to change into the directory named |
directory, it next tries the directory named |
.Pa obj.${MACHINE} |
|
(see |
|
.Va MACHINE |
|
variable). If it still has found no special directory, |
|
.Nm make |
|
next tries the directory named |
.Pa obj . |
.Pa obj . |
Finally, if none of the above directories are available |
If this fails, |
.Nm make |
.Nm make |
|
tries to prepend /usr/obj to the current directory name. |
|
Finally, if none of these directories are available |
|
.Nm make |
will settle for and use the current directory. |
will settle for and use the current directory. |
.It Va .MAKEFLAGS |
.It Va .MAKEFLAGS |
The environment variable |
The environment variable |
|
|
.Nm make |
.Nm make |
executes. |
executes. |
.It Va .TARGETS |
.It Va .TARGETS |
todo |
List of targets |
|
.Nm make |
|
is currently building. |
.It Va .INCLUDES |
.It Va .INCLUDES |
todo |
See |
|
.Ic .INCLUDES |
|
special target |
.It Va .LIBS |
.It Va .LIBS |
todo |
See |
|
.Ic .LIBS |
|
special target |
.It Va MACHINE |
.It Va MACHINE |
todo |
Name of the machine architecture |
|
.Nm make |
|
is running on, obtained from the |
|
.Ev MACHINE |
|
environment variable, or through |
|
.Xr uname 2 |
|
if not defined. |
.It Va MACHINE_ARCH |
.It Va MACHINE_ARCH |
todo |
Name of the machine architecture |
|
.Nm make |
|
was compiled for, obtained from the |
|
.Ev MACHINE_ARCH |
|
environment variable, or defined at compilation time. |
.El |
.El |
.Pp |
.Pp |
Variable expansion may be modified to select or modify each word of the |
Variable expansion may be modified to select or modify each word of the |
|
|
If no sources are specified, this is the equivalent of specifying the |
If no sources are specified, this is the equivalent of specifying the |
.Fl i |
.Fl i |
option. |
option. |
|
.It Ic .INCLUDES |
|
A list of suffixes that indicate files that can be included in a source |
|
file. The suffix must have already been declared with |
|
.Ic .SUFFIXES , |
|
any suffix so declared will have the directories on its search path (see |
|
.Ic .PATH ) |
|
placed in the |
|
.Va .INCLUDES |
|
special variable, each preceded by a |
|
.Fl I |
|
flag. |
.It Ic .INTERRUPT |
.It Ic .INTERRUPT |
If |
If |
.Nm make |
.Nm make |
is interrupted, the commands for this target will be executed. |
is interrupted, the commands for this target will be executed. |
|
.It Ic .LIBS |
|
This does for libraries what |
|
.Ic .INCLUDES |
|
does for include files, except that the flag used is |
|
.Fl L . |
.It Ic .MAIN |
.It Ic .MAIN |
If no target is specified when |
If no target is specified when |
.Nm make |
.Nm make |
|
|
found in the current directory. |
found in the current directory. |
If no sources are specified, any previously specified directories are |
If no sources are specified, any previously specified directories are |
deleted. |
deleted. |
|
.It Ic .PATH\fIsuffix\fR |
|
The sources are directories which are to be searched for suffixed files |
|
not found in the current directory. |
|
.Nm make |
|
first searches the suffixed search path, before reverting to the default |
|
path if the file is not found there. |
.It Ic .PHONY |
.It Ic .PHONY |
Apply the |
Apply the |
.Ic .PHONY |
.Ic .PHONY |
|
|
is set to the same value as |
is set to the same value as |
.Va .MAKE , |
.Va .MAKE , |
support for this may be removed in the future. |
support for this may be removed in the future. |
|
.Pp |
|
Most of the more esoteric features of |
|
.Nm make |
|
should probably be avoided for greater compatibility. |
.Sh ENVIRONMENT |
.Sh ENVIRONMENT |
.Nm make |
.Nm make |
uses the following environment variables, if they exist: |
uses the following environment variables, if they exist: |
|
|
.Ev MAKEOBJDIRPREFIX directory. |
.Ev MAKEOBJDIRPREFIX directory. |
.El |
.El |
.Sh BUGS |
.Sh BUGS |
|
The determination of |
|
.Va .OBJDIR |
|
is contorted to the point of absurdity. |
|
.Pp |
|
In the presence of several |
|
.Ic .MAIN |
|
special targets, |
|
.Nm make |
|
silently ignores all but the first. |
|
.Pp |
|
.Va .TARGETS |
|
is not set to the default target when |
|
.Nm make |
|
is invoked without a target name and no |
|
.Ic MAIN |
|
special target exists. |
|
.Pp |
The evaluation of |
The evaluation of |
.Ar expression |
.Ar expression |
in a test is very simple-minded. Currently, the only form that works is |
in a test is very simple-minded. Currently, the only form that works is |