imake(1X) imake(1X)NAME imake - generates a make description file SYNOPSIS imake [-Ddefine] [-Idir] [-Ttemplate] [-finput-file] [-sdescription-file] [-e] [-v] DESCRIPTION imake generates a make(1) description file from a template, a set of cpp(1) macro functions, and a per-directory input file named Imakefile. These files allow machine dependen- cies, such has compiler options, alternate command names, and special make rules, to be kept separate from the descriptions of the various items to be built. Options The imake command accepts these options: -Ddefine Sets directory-specific variables that are passedTMdirectly to cpp. For example, the X Window Systemuses this option to set TOPDIR to the name of the directory containing the top of the core distribu- tion and CURDIR to the name of the current directo- ry, relative to the top. -e Causes imake to run make using the make description file generated by imake. If this option is not specified, the user must run make manually. -f input-file Specifies the name of the per-directory input file. The default is Imakefile. -Idirectory Indicates the directory in which the imake template and configuration files may be found. This option is passed directly to cpp. -Ttemplate Specifies the name of the master template file, which is usually located in the directory specified with the -I option used by cpp. The default is Imake.tmpl. -s description-file Specifies the name of the make description file to be generated but does not run make. If description-file is a hyphen (-), output is written to standard output. If this option is not specified, imake by default generates a file named Makefile but does not run make. November, 1990 1
imake(1X) imake(1X)-v Causes imake to display the cpp command line that it is using to generate Makefile. How imake works The imake command runs cpp and passes to it all the -I and -D options given on the imake command line. The imake com- mand also passes the following three lines to cpp: #define IMAKE_TEMPLATE "Imake.tmpl" #define INCLUDE_IMAKEFILE "Imakefile" #include IMAKE_TEMPLATE where Imake.tmpl and Imakefile may be overridden by the -T and -f options, respectively. If Imakefile contains any lines beginning with a number sign (#) that are not followed by a cpp directive (#include, #define, #undef, #ifdef, #else, #endif, or #if), imake makes a temporary description file in which the # lines are prepended with the string /**/, so that cpp copies the line into Makefile as a com- ment. The Imakefile reads a file containing machine-dependent parameters (specified as cpp symbols), a site-specific parameters file, a file containing cpp macro functions for generating make rules, and Imakefile (as 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. The rules file (usually named Imake.rules) contains a variety of cpp macro functions that are configured according to the current platform. The imake command replaces any oc- currences 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) @@\ program: objlist @@\ $(CC) -o $@ objlist $(LDFLAGS) when called with program_target(foo, foo1.o foo2.o) expands 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 for compatibility with make. For this reason, colons (:) in 2 November, 1990
imake(1X) imake(1X)command lines must be preceded by a backslash (\). Using imake with the X Window System The X Window System uses imake extensively, for full builds within the source tree and for external software. As men- tioned previously, two special variables, TOPDIR and CURDIR, are set to make referencing files that use relative path- names easier. For example, the following command is gen- erated automatically to build the Makefile in the directory lib/X/ (relative to the top of the sources): ../.././config/imake -I../.././config \ -DTOPDIR=../../. -DCURDIR=./lib/X When building X client applications outside the source tree, a special symbol UseInstalled is defined, and TOPDIR and CURDIR are omitted. If the configuration files have been properly installed, you can use the script xmkmf(1X) with no arguments to specify the proper options. The command make Makefiles can then be used to generate Makefiles in any subdirectories. Environment variables The environment variables for imake are the same as for xmkmf(1X). Setting these environment variables is not recommended because they introduce dependencies that are not readily apparent. IMAKECPP Specifies a valid path to a preprocessor program, such as /usr/local/cpp. By default, imake uses /lib/cpp. IMAKEINCLUDE Specifies a valid include argument for the C prepro- cessor, such as -I/usr/include/local. Actually, you can set any valid cpp argument. IMAKEMAKE Specifies a valid path to a ``make'' command, such as /usr/local/make. By default, imake uses whatever make command is found using execvp(2). LIMITATIONS Comments have to be preceded by /**/# to protect them from cpp. NOTES Copyright 1988, Massachusetts Institute of Technology. See X(1X) for a full statement of rights and permissions. November, 1990 3
imake(1X) imake(1X)Authors: Todd Brunhoff, Tektronix and MIT Project Athena, and Jim Fulton, MIT X Consortium FILES /usr/tmp/tmp-imake.nnnnnn Used as a temporary input file for cpp. /usr/tmp/tmp-make.nnnnnn Used as a temporary input file for make. /lib/cpp Default C preprocessor. SEE ALSO cpp(1), make(1) in A/UX Command Reference Chapter 16, ``make Reference,'' in A/UX Programming Languages and Tools 4 November, 1990