.TH xmkmf "" "" "X Utility"
.PC "Control the building of a Makefile"
\fBxmkmf [\-a] [\fItopdir\^\fB [\fIcurdir\^\fB] ]\fR
.PP
The X utility
.B xmkmf
is a script that invokes the utility
.B imake
to build a
.B Makefile 
from an
.BR Imakefile .
.PP
When invoked with no arguments and in a directory that contains an
.BR Imakefile ,
.B xmkmf
reads the
.B Imakefile
and the configuration files designed for X Windows for \*(CO,
and generates a
.BR Makefile .
.PP
When invoked with the option
.BR \-a ,
.B xmkmf
builds the
.B Makefile
in the current directory, then automatically executes the commands
.DM
	make Makefiles
.DE
.PP
(in case there are subdirectories),
.DM
	make includes
.DE
.PP
and:
.DM
	make depends
.DE
.PP
This is the normal way to configure software that is outside
the MIT X build tree.
.PP
If you are working within the MIT X build tree
specify the argument
.I topdir
as the relative path name from the current directory to the top
of the build tree.
You can also specify
.I curdir
as a relative path name from the top of the build
tree to the current directory.
You must supply
.I curdir
if the current directory has subdirectories, or if the
.I Makefile
cannot build the subdirectories.
If you give
.B xmkfm
a
.IR topdir ,
it assumes that nothing is installed on your system, and looks for files in
the build tree instead of using the installed versions.
Note that it is unlikely that you will ever need to do this
unless you are an X developer,
and even then this option is seldom used.
.PP
For a complete description of what
.B xmkmf
does, read the script
.BR /usr/X11/bin/xmkmf .
.SH "See Also"
.B
imake,
X utilities
.R
.SH Notes
.BR Makefile s
generated by
.B xmkmf
must be processed through
.BR gmake ,
not the default \*(CO implementation of
.BR make .
If you attempt to use \*(CO
.B make
with such a
.BR Makefile ,
the compilation will fail with a number of mysterious errors.
