.\" $Xorg: imake.man,v 1.3 2000/08/17 19:41:50 cpqbld Exp $ .\" Copyright (c) 1993, 1994, 1998 The Open Group .\" .\" All Rights Reserved. .\" .\" The above copyright notice and this permission notice shall be included .\" in all copies or substantial portions of the Software. .\" .\" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS .\" OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF .\" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. .\" IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR .\" OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, .\" ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR .\" OTHER DEALINGS IN THE SOFTWARE. .\" .\" Except as contained in this notice, the name of The Open Group shall .\" not be used in advertising or otherwise to promote the sale, use or .\" other dealings in this Software without prior written authorization .\" from The Open Group. .\" .\" Copyright (c) 1998, 2001 The X Japanese Documentation Project. .\" .\" Permission is hereby granted, free of charge, to any person obtaining a .\" copy of this software and associated documentation files (the .\" "Software"), to deal in the Software without restriction, including .\" without limitation the rights to use, copy, modify, merge, publish, dis- .\" tribute, sublicense, and/or sell copies of the Software, and to permit .\" persons to whom the Software is furnished to do so, subject to the fol- .\" lowing conditions: .\" .\" The above copyright notice and this permission notice shall be included .\" in all copies or substantial portions of the Software. .\" .\" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS .\" OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABIL- .\" ITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT .\" SHALL THE X JAPANESE DOCUMENTATION PROJECT BE LIABLE FOR ANY CLAIM, .\" DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR .\" OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR .\" THE USE OR OTHER DEALINGS IN THE SOFTWARE. .\" .\" Except as contained in this notice, the name of The X Japanese .\" Documentation Project shall not be used in advertising or otherwise to .\" promote the sale, use or other dealings in this Software without prior .\" written authorization from The X Japanese Documentation Project. .\" .\" X Window System is a trademark of The Open Group. .\" .\" Translated Fri Oct 16 20:48:25 JST 1998 .\" by FUJIWARA Teruyoshi .\" Updated Sun Oct 14 21:48:18 JST 2001 for XFree86 4.1.0 .\" by FUJIWARA Teruyoshi .\" .\" $XFree86: xc/config/imake/imake.man,v 1.7 2001/02/07 22:51:55 tsi Exp $ .\" .TH IMAKE 1 "Release 6.5" "X Version 11" .SH 名前 .\"0 imake \- C preprocessor interface to the make utility imake \- make ユーティリティに対する C プリプロセッサのインタフェース .SH 書式 \fBimake\fP [ \fB\-D\fP\fIdefine\fP ] [ \fB\-I\fP\fIdir\fP ] [ \fB\-U\fP\fIdefine\fP ] [ \fB\-T\fP\fItemplate\fP ] [ \fB\-f\fP \fIfilename\fP ] [ \fB\-C\fP \fIfilename\fP ] [ \fB\-s\fP \fIfilename\fP ] [ \fB\-e\fP ] [ \fB\-v\fP ] .SH 説明 .\"0 .I Imake .\"0 is used to .\"0 generate \fIMakefiles\fP from a template, a set of \fIcpp\fP macro functions, .\"0 and a per-directory input file called an \fIImakefile\fP. This allows machine .\"0 dependencies (such as compiler options, alternate command names, and special .\"0 \fImake\fP rules) to be kept separate from the descriptions of the .\"0 various items to be built. .I imake は、テンプレート、\fIcpp\fP マクロ関数群、\fIImakefile\fP と呼ばれるディ レクトリごとの入力ファイルから \fIMakefile\fP を生成する。これを使うこ とにより、プログラムを構築するための様々な要素の記述から、マシンに依存 する部分(コンパイラのオプション、異なるコマンド名、特別な \fImake\fP の規則など)を切り離すことができる。 .SH オプション .\"0 The following command line options may be passed to \fIimake\fP: 以下のコマンド行オプションは \fIimake\fP に渡される。 .TP 8 .B \-D\fIdefine\fP .\"0 This option is passed directly to \fIcpp\fP. It is typically used to set .\"0 directory-specific variables. For example, the X Window System uses this .\"0 flag to set \fITOPDIR\fP to the name of the directory containing the top .\"0 of the core distribution and \fICURDIR\fP to the name of the current .\"0 directory, relative to the top. このオプションは直接 \fIcpp\fP に渡される。このオプションは通常、ディ レクトリ固有の変数をセットするために使われる。例えば、Xウィンドウシス テムはこのフラグを使って、\fITOPDIR\fP にコアディストリビューションの 最上位ディレクトリの名前をセットし、\fICURDIR\fP には最上位ディレクト リからカレントとディレクトリへの相対パスをセットする。 .TP 8 .B \-I\fIdirectory\fP .\"0 This option is passed directly to \fIcpp\fP. It is typically used to .\"0 indicate the directory in which the \fIimake\fP template and configuration .\"0 files may be found. このオプションは直接 \fIcpp\fP に渡される。このオプションは通常、 \fIimake\fP のテンプレートや設定ファイルがあるディレクトリを指定するた めに使われる。 .TP 8 .B \-U\fIdefine\fP .\"0 This option is passed directly to \fIcpp\fP. It is typically used to .\"0 unset variables when debugging \fIimake\fP configuration files. このオプションは直接 \fIcpp\fP に渡される。このオプションは通常、 \fIimake\fP の設定ファイルをデバッグするときに変数をセット解除するため に使う。 .TP 8 .B \-T\fItemplate\fP .\"0 This option specifies the name of the master template file (which is usually .\"0 located in the directory specified with \fI\-I\fP) used by \fIcpp\fP. このオプションは、\fIcpp\fP が使うマスターテンプレートファイル(通常は \fI\-I\fP で指定されたディレクトリに置かれる)の名前を指定する。 .\"0 The default is \fIImake.tmpl\fP. デフォルト値は \fIImake.tmpl\fP である。 .TP 8 .B \-f \fIfilename\fP .\"0 This option specifies the name of the per-directory input file. The default .\"0 is \fIImakefile\fP. このオプションは、ディレクトリごとに置く入力ファイルの名前を指定する。 デフォルト値は \fIImakefile\fP である。 .TP 8 .B \-C \fIfilename\fP .\"0 This option specifies the name of the .c file that is constructed in the .\"0 current directory. The default is \fIImakefile.c\fP. このオプションは、カレントディレクトリに作られる .c ファイルの名前を指 定する。デフォルト値は \fIImakefile.c\fP である。 .TP 8 .B \-s \fIfilename\fP .\"0 This option specifies the name of the \fImake\fP description file to be .\"0 generated but \fImake\fP should not be invoked. このオプションでは、生成される \fImake\fP 記述ファイルの名前を指定する が、このオプションを指定しても \fImake\fP が実行されることはない。 .\"0 If the \fIfilename\fP is a dash (\-), the .\"0 output is written to \fIstdout\fP. The default is to generate, but .\"0 not execute, a \fIMakefile\fP. \fIfilename\fP がダッシュ(\-)ならば、出力は \fIstdout\fP に対して行わ れる。デフォルトの動作では \fIMakefile\fP を生成するが、実行はしない。 .TP 8 .B \-e .\"0 This option indicates the \fIimake\fP should execute the generated .\"0 \fIMakefile\fP. The default is to leave this to the user. このオプションを指定すると、\fIimake\fP は生成した \fIMakefile\fP を実 行する。デフォルトでは、\fIMakefile\fP の実行はユーザに任されている。 .TP 8 .B \-v .\"0 This option indicates that \fIimake\fP should print the \fIcpp\fP command line .\"0 that it is using to generate the \fIMakefile\fP. このオプションを指定すると、\fIimake\fP は \fIMakefile\fP の生成に使う \fIcpp\fP のコマンド行を表示する。 .\"0 .SH "HOW IT WORKS" .SH "imake の動作" .\"0 \fIImake\fP invokes \fIcpp\fP with any \fI\-I\fP or \fI\-D\fP flags passed .\"0 on the command line and passes the name of a file containing the .\"0 following 3 lines: \fIimake\fP は、コマンド行で \fI\-I\fP オプションや \fI\-D\fP オプ ションを渡して\fIcpp\fP を起動し、次の内容を持つファイル名を渡す。 .sp .nf \& #define IMAKE_TEMPLATE "Imake.tmpl" \& #define INCLUDE_IMAKEFILE \& #include IMAKE_TEMPLATE .fi .sp .\"0 where \fIImake.tmpl\fP and \fIImakefile\fP may be overridden by the .\"0 \fI\-T\fP and \fI\-f\fP command options, respectively. このとき、\fIImake.tmpl\fP の部分はコマンドの \fI\-T\fP オプションで書 き換えられることがあり、\fIImakefile\fP の部分は \fI\-f\fP オプション で書き換えられることがある。 .PP .\"0 The IMAKE_TEMPLATE typically .\"0 reads in a file containing machine-dependent parameters .\"0 (specified as \fIcpp\fP symbols), a site-specific parameters file, .\"0 a file defining variables, .\"0 a file .\"0 containing \fIcpp\fP macro functions for generating \fImake\fP rules, and .\"0 finally the \fIImakefile\fP (specified by INCLUDE_IMAKEFILE) in the current .\"0 directory. The \fIImakefile\fP uses the macro functions to indicate what .\"0 targets should be built; \fIimake\fP takes care of generating the appropriate .\"0 rules. IMAKE_TEMPLATE は通常、マシン依存のパラメータ(\fIcpp\fP のシンボルで指 定する)が書かれたファイル、サイト特有のパラメータファイル、変数を定義 するファイル、\fImake\fP を生成するための \fIcpp\fP のマクロ関数が書か れたファイル、カレントディレクトリの \fIImakefile\fP (INCLUDE_IMAKEFILE で指定する)を読む。\fIImakefile\fP は、このマクロ関 数を用いて生成すべき対象を示す。\fIimake\fP は、責任を持って適切な規則 を生成する。 .PP .\"0 .I Imake .\"0 configuration files contain two types of variables, imake variables .\"0 and make variables. The imake variables are interpreted by cpp when .\"0 .I imake .\"0 is run. By convention they are mixed case. The make variables are .\"0 written into the .\"0 .I Makefile .\"0 for later interpretation by .\"0 .I make. .I Imake の設定ファイルは、2つのタイプの変数を持つ。すなわち、imake 変数と make 変数である。imake 変数は .I imake を実行した際に cpp によって解釈される。慣習により、imake 変数の名前は 大文字と小文字が混ざった形となる。make 変数は .I Makefile に書き込まれ、後で .I make に解釈される。 .\"0 By convention make variables are upper case. 慣習により、make 変数の名前は大文字で書かれる。 .PP .\"0 The rules file (usually named \fIImake.rules\fP in the configuration .\"0 directory) contains a variety of \fIcpp\fP macro functions that are .\"0 configured according to the current platform. \fIImake\fP replaces .\"0 any occurrences of the string ``@@'' with a newline to allow macros that .\"0 generate more than one line of \fImake\fP rules. .\"0 For example, the macro 規則ファイル(通常は設定ディレクトリの \fIImake.rules\fP)には、現在のプ ラットフォームにしたがって設定された \fIcpp\fP マクロ関数群が記述され ている。マクロが複数行の \fImake\fP 規則を生成できるように、 \fIimake\fP は文字列 ``@@'' が現れると、これを改行に置き換える。 例えば、次のマクロ .ta 1i 1.6i 5i .nf \& #define program_target(program, objlist) @@\e program: objlist @@\e $(CC) \-o $@ objlist $(LDFLAGS) .fi .\"0 when called with は、 .I "program_target(foo, foo1.o foo2.o)" で呼ばれたとき、 .\"0 will expand to .nf foo: foo1.o foo2.o $(CC) \-o $@ foo1.o foo2.o $(LDFLAGS) .fi のように展開される。 .PP .\"0 \fIImake\fP also replaces any occurrences of the word ``XCOMM'' with .\"0 the character ``#'' to permit placing comments in the Makefile without .\"0 causing ``invalid directive'' errors from the preprocessor. \fIimake\fP は ``XCOMM'' が現れると、これを ``#'' 文字に置換する。 これにより、プリプロセッサに ``invalid directive'' エラーを出させるこ となく Makefile にコメントを置くことができる。 .PP .\"0 Some complex \fIimake\fP macros require generated \fImake\fP variables .\"0 local to each invocation of the macro, often because their value .\"0 depends on parameters passed to the macro. 複雑な \fIimake\fP の場合、生成される \fImake\fP 変数がマクロのそれぞ れの呼び出しにおいて局所性が必要なことがある。これはしばしば、その値 がマクロに渡されるパラメータに依存するために起こる。 .\"0 Such variables can be created by using an \fIimake\fP variable .\"0 of the form \fBXVARdef\fP\fIn\fP, where \fIn\fP is a single digit. このような変数は、\fBXVARdef\fP\fIn\fP の形式の \fIimake\fP 変数を使っ て作ることができる。ここで、\fIn\fP は1桁の数字である。 .\"0 A unique \fImake\fP variable will be substituted. Later occurrences .\"0 of the variable \fBXVARuse\fP\fIn\fP will .\"0 be replaced by the variable created by the corresponding .\"0 \fBXVARdef\fP\fIn\fP. 一意に決まる \fImake\fP には代入が行われる。後で変数 \fBXVARuse\fP\fIn\fP が現れたとき、これは対応する \fBXVARdef\fP\fIn\fP によって生成された変数に置き換えられる。 .PP .\"0 On systems whose \fIcpp\fP reduces multiple tabs and spaces to a single .\"0 space, \fIimake\fP attempts to put back any necessary tabs (\fImake\fP is .\"0 very picky about the difference between tabs and spaces). For this reason, .\"0 colons (:) in command lines must be preceded by a backslash (\\). \fIcpp\fP が複数のタブや空白を1つの空白に減らすようなシステムにおいて は、\fIimake\fP は必要なタブを戻そうと試みる(\fImake\fP はタブと空白の 違いに大変厳しい)。このため、コマンド行ではコロン(:)の前にバックス ラッシュ(\\)を置かなければならない。 .\"0 .SH "USE WITH THE X WINDOW SYSTEM" .SH "X ウィンドウシステムでの利用" .\"0 The X Window System uses \fIimake\fP extensively, for both full builds within .\"0 the source tree and external software. As mentioned above, two special .\"0 variables, \fITOPDIR\fP and \fICURDIR,\fP are set to make referencing files .\"0 using relative path names easier. For example, the following command is .\"0 generated automatically to build the \fIMakefile\fP in the directory .\"0 \fIlib/X/\fP (relative to the top of the sources): X ウィンドウシステムは、ソースからのシステム全体の構築と外部ソフトウェ アの構築の両方で \fIimake\fP を広く用いる。先に述べたように、相対パス 名を用いたファイルの参照を容易にするために2つの特別な変数 \fITOPDIR\fP と \fICURDIR\fP がセットされる。例えば、\fIlib/X/\fP における \fIMakefile\fP を作るため、次のコマンドが自動的に生成される(ソースの最 上位ディレクトリからの相対パス): .sp .nf % ../.././config/imake \-I../.././config \\ \-DTOPDIR=../../. \-DCURDIR=./lib/X .fi .sp .\"0 When building X programs outside the source tree, a special symbol .\"0 \fIUseInstalled\fP is defined and \fITOPDIR\fP and .\"0 \fICURDIR\fP are omitted. If the configuration files have been .\"0 properly installed, the script \fIxmkmf\fP(1) may be used. ソースツリーに含まれない X のプログラムを構築する際には、特殊なシンボ ル \fIUseInstalled\fP が定義され、\fITOPDIR\fP と \fICURDIR\fP は無視 される。設定ファイルが正しくインストールされていれば、スクリプト \fIxmkmf\fP(1) を使うことができる。 .\"0 .SH "INPUT FILES" .SH "入力ファイル" .\"0 Here is a summary of the files read by .\"0 .I imake .\"0 as used by X. X に使われるときに .I imake が読むファイルについての概略を示す。 .\"0 The indentation shows what files include what other files. 字下げは、他のファイルをインクルードすることを示す。 .nf .sp .ta 3i .\"0 Imake.tmpl generic variables Imake.tmpl 一般的な変数 .\"0 site.def site-specific, BeforeVendorCF defined site.def サイト固有、BeforeVendorCF が定義される .\"0 *.cf machine-specific *.cf マシン固有 .\"0 *Lib.rules shared library rules *Lib.rules 共有ライブラリの規則 .\"0 site.def site-specific, AfterVendorCF defined site.def サイト固有、AfterVendorCF が定義される .\"0 Imake.rules rules Imake.rules 規則 .\"0 Project.tmpl X-specific variables Project.tmpl X 特有の変数 .\"0 *Lib.tmpl shared library variables *Lib.tmpl 共有ライブラリについての変数 .\"0 Imakefilen Imakefile .\"0 Library.tmpl library rules Library.tmpl ライブラリについての規則 .\"0 Server.tmpl server rules Server.tmpl サーバについての規則 .\"0 Threads.tmpl multi-threaded rules Threads.tmpl マルチスレッドについての規則 .fi .LP .\"0 Note that \fIsite.def\fP gets included twice, once before the .\"0 \fI*.cf\fP file and once after. Although most site customizations .\"0 should be specified after the \fI*.cf\fP file, some, such as the .\"0 choice of compiler, need to be specified before, because other .\"0 variable settings may depend on them. \fIsite.def\fP は2度インクルードされる点に注意せよ。1度目は \fI*.cf\fP ファイルの前で、次はこのファイルの後である。サイトにおけるカスタマイズ のほとんどは \fI*.cf\fP ファイルの後でなければならないが、コンパイラの 選択のように先に指定しなければならないものもある。他の変数設定がこれら に依存しているからである。 .LP .\"0 The first time \fIsite.def\fP is included, the variable BeforeVendorCF .\"0 is defined, and the second time, the variable AfterVendorCF is .\"0 defined. All code in \fIsite.def\fP should be inside an #ifdef for .\"0 one of these symbols. 最初に \fIsite.def\fP をインクルードしたときには変数 BeforeVendorCF が定義され、2度目にインクルードしたときには変数 AfterVendorCF が定義さ れる。\fIsite.def\fP の全てのコードはどちらかのシンボルについての #ifdef の内側に置かれているはずである。 .SH ファイル .ta 3i .\"0 Imakefile.c temporary input file for cpp Imakefile.c cpp の入力に使う一時ファイル .br .\"0 /tmp/Imf.XXXXXX temporary Makefile for -s /tmp/Imf.XXXXXX -s のための一時的な Makefile .br .\"0 /tmp/IIf.XXXXXX temporary Imakefile if specified Imakefile uses # comments /tmp/IIf.XXXXXX 指定した Imakefile が # 形式のコメントを使っている場合の一時的な Imakefile .br .\"0 /lib/cpp default C preprocessor /lib/cpp デフォルトの C プリプロセッサ .DT .SH 関連項目 make(1), xmkmf(1) .br S. I. Feldman, .I .\"0 Make \(em A Program for Maintaining Computer Programs Make \(em コンピュータのプログラムを管理するためのプログラムを生成 .SH 環境変数 .\"0 The following environment variables may be set, however their use is not .\"0 recommended as they introduce dependencies that are not readily apparent .\"0 when \fIimake\fP is run: 以下の環境変数を設定することができる。ただし、これらは \fIimake\fP が 実行されるときに容易にはわからない依存関係をもたらすため、あまり使わな いほうがよい。 .TP 5 .B IMAKEINCLUDE .\"0 If defined, this specifies a ``\-I'' include argument to pass to the .\"0 C preprocessor. E.g., ``\-I/usr/X11/config''. この環境変数が定義された場合、C プリプロセッサにインクルードの引き数 ``\-I'' を渡すことを指定。例: ``\-I/usr/X11/config''. .TP 5 .B IMAKECPP .\"0 If defined, this should be a valid path to a preprocessor program. この環境変数が定義された場合、これはプリプロセッサのプログラムの有効な パスでなければならない。 .\"0 E.g., ``/usr/local/cpp''. 例: ``/usr/local/cpp''. .\"0 By default, .\"0 .I imake .\"0 will use /lib/cpp. デフォルトでは、 .I imake は /lib/cpp を用いる。 .TP 5 .B IMAKEMAKE .\"0 If defined, this should be a valid path to a make program, .\"0 such as ``/usr/local/make''. この環境変数が定義された場合、これは ``/usr/local/make'' のような make プログラムの有効なパスでなければならない。 .\"0 By default, .\"0 .I imake .\"0 will use whatever .\"0 .I make .\"0 program is found using .\"0 .I execvp(3). デフォルトでは、 .I execvp(3) を使って見つけた .I make を使用する。 .\"0 This variable is only used if the ``\-e'' option is specified. この環境変数が使用されるのは、``\-e'' オプションが指定されたときだけで ある。 .SH 著者 Todd Brunhoff, Tektronix and MIT Project Athena; Jim Fulton, MIT X Consortium