8 -Ddefine This option is passed directly to cpp. It is typically used to set directory-specific variables. For example, the X Window System uses this flag to set TOPDIR to the name of the directory containing the top of the core distribution and CURDIR to the name of the current directory, relative to the top.
8 -Idirectory This option is passed directly to cpp. It is typically used to indicate the directory in which the imake template and configuration files may be found.
8 -Ttemplate This option specifies the name of the master template file (which is usually located in the directory specified with -I) used by cpp. The default is Imake.tmpl.
8 -f filename This option specifies the name of the per-directory input file. The default is Imakefile.
8 -s filename This option specifies the name of the make description file to be generated but make should not be invoked. If the filename is a dash (-), the output is written to stdout. The default is to generate, but not execute, a Makefile.
8 -e This option indicates the imake should execute the generated Makefile. The default is to leave this to the user.
8 -v This option indicates that imake should print the cpp command line that it is using to generate the Makefile.
#define IMAKE_TEMPLATE "Imake.tmpl" #define INCLUDE_IMAKEFILE "Imakefile" #include IMAKE_TEMPLATEwhere Imake.tmpl and Imakefile may be overridden by the -T and -f command options, respectively.
The IMAKE_TEMPLATE typically reads in a file containing machine-dependent parameters (specified as cpp symbols), a site-specific parameters file, a file defining variables, a file containing cpp macro functions for generating make rules, and finally the Imakefile (specified by INCLUDE_IMAKEFILE) in the current directory. The Imakefile uses the macro functions to indicate what targets should be built; imake takes care of generating the appropriate rules.
Imake configuration files contain two types of variables, imake variables and make variables. The imake variables are interpreted by cpp when imake is run. By convention they are mixed case. The make variables are written into the Makefile for later interpretation by make. By convention make variables are upper case.
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. Imake replaces any occurrences of the string ``@@'' with a newline to allow macros that generate more than one line of make rules. For example, the macro
#define program_target(program, objlist) @@\e program: objlist @@\e $(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, imake attempts to put back any necessary tabs (make is very picky about the difference between tabs and spaces). For this reason, colons (:) in command lines must be preceded by a backslash (\\).
% ../.././config/imake -I../.././config \\ -DTOPDIR=../../. -DCURDIR=./lib/XWhen building X programs outside the source tree, a special symbol UseInstalled is defined and TOPDIR and CURDIR are omitted. If the configuration files have been properly installed, the script xmkmf(1) may be used.
Imake.tmpl generic variables site.def site-specific, BeforeVendorCF defined *.cf machine-specific *Lib.rules shared library rules site.def site-specific, AfterVendorCF defined Project.tmpl X-specific variables *Lib.tmpl shared library variables Imake.rules rules Imakefile Library.tmpl library rules Server.tmpl server rules
Note that site.def gets included twice, once before the *.cf file and once after. Although most site customizations should be 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 site.def is included, the variable BeforeVendorCF is defined, and the second time, the variable AfterVendorCF is defined. All code in site.def should be inside an #ifdef for one of these symbols.
/usr/tmp/tmp-make.nnnnnn temporary input file for make
/lib/cpp default C preprocessor
S. I. Feldman, Make \(em A Program for Maintaining Computer Programs
5 IMAKEINCLUDE If defined, this should be a valid include argument for the C preprocessor. E.g., ``-I/usr/include/local''. Actually, any valid cpp argument will work here.
5 IMAKECPP If defined, this should be a valid path to a preprocessor program. E.g. ``/usr/local/cpp''. By default, imake will use /lib/cpp.
5 IMAKEMAKE If defined, this should be a valid path to a make program, such as ``/usr/local/make''. By default, imake will use whatever make program is found using execvp(3). This variable is only used if the ``-e'' option is specified.