C preprocessor interface to the make command.
imake [ -DDefine ] [ -IDirectory ] [ -TTemplate ] [ -f FileName ] [ -C FileName ] [ -s FileName ] [ -e ] [ -v ]
The imake command generates Makefiles from a template, a set of cpp macro functions, and a per-directory input file called Imakefile. This command keeps machine dependencies (such as compiler options, alternate command names, and special make command rules) separate from the descriptions of the items to build.
imake invokes cpp with any -I or -D flags passed on the command line and passes to it the following three lines:
#define IMAKE_TEMPLATE "Imake.tmpl" #define INCLUDE_MAKEFILE "Imakefile" #include IMAKE_TEMPLATE
Override Imake.tmpl and Imakefile by using the -T and -f flags, respectively.
The IMAKE_TEMPLATE typically reads the following files:
The Imakefile file uses the macro functions to indicate what targets to build and the imake command generates the appropriate rules.
Imake configuration files contain two types of variables, imake variables and make variables. The imake variables are interpreted by cpp when the imake command is run. By convention, they are not case-sensitive. The make variables are written into the Makefile for later interpretation by the make command. By convention, make variables are uppercase.
The rules file (usually named Imake.rules in the configuration directory) contains a variety of cpp macro functions that are configured according to the current platform. The imake command replaces any occurrences of the string ``@@'' with a newline ( carriage return ) to support macros that generate more than one line of make rules. For example, the macro:
#define program_target(program, objlist) @@\ program: objlist @@\ $(CC) -o $@ objlist $(LDFLAGS)
when called with program_target(foo,foo1.o foo2.o) will expand to:
foo: foo1.o foo2.o $(CC) -o $@ foo1.o foo2.o $(LDFLAGS)
On systems whose cpp reduces multiple tabs and spaces to a single space, the imake command attempts to put back any necessary tabs (the make command distinguishes between tabs and spaces). For this reason, precede all colons (:) in command lines by a backslash (\).
AIXwindows uses the imake command extensively for both full builds within the source tree and builds of external software. Two special variables, TOPDIR and CURDIR, are set to make referencing files using relative path names easier. For example, the following command is generated automatically to build the Makefile in the lib/X directory (relative to the top of the sources):
% ../.././config/imake -I../.././config \ -DTOPDIR=../../. -DCURDIR=./lib/X
To build AIXwindows programs outside the source tree, a special symbol, UseInstalled, is defined and the TOPDIR and CURDIR variables are omitted. If the configuration files are properly installed, you can use the xmkmf command.
The imake command reads the following files as used by AIXwindows.
Note: The indented format indicates files that include other files.
Imake.tmpl generic variables site.def site-specific, BeforeVendorCF defined *.cf machine-specific *Lib.rules shared library site.def site-specific, AfterVendorCF defined Imake.rules rules Project.tmpl X-specific variables *Lib.tmpl shared library variables Imakefile Library.tmpl library rules Server.tmpl server rules Threads.tmpl multi-thread rules
Note: The site.def file is included twice, both before and after the *.cf file. Although most site customizations are specified after the *.cf file, some, such as the choice of compiler, need to be specified before, because other variable settings may depend on them.The first time the site.def file is included, the BeforeVendorCF variable is defined, and the second time, the AfterVendorCF variable is defined. All code in the site.def file should be placed inside a #ifdef macro for one of these symbols.
Note: The following environment variables may be set, but their use is not recommended because they introduce dependencies that are not readily apparent when the imake command is run.
imake -I/usr/lib/X11/config -DTOPDIR=/usr/lpp/X11/Xamples
/usr/tmp/tmp-imake.nnnnnn | Specifies the temporary input file for the cpp preprocessor. |
/usr/tmp/tmp-make.nnnnnn | Specifies the temporary input file for make. |
/lib/cpp | The default C preprocessor. |
The make command, xmkmf command.