OSDN Git Service

既存のフォルダ削除
authorrezoo <rezoolab@gmail.com>
Fri, 22 Oct 2010 08:08:56 +0000 (17:08 +0900)
committerrezoo <rezoolab@gmail.com>
Fri, 22 Oct 2010 08:08:56 +0000 (17:08 +0900)
21 files changed:
_static/basic.css [deleted file]
_static/omake.gif [deleted file]
_templates/layout.html [deleted file]
autoconf.rst [deleted file]
base.rst [deleted file]
build-examples.rst [deleted file]
build.rst [deleted file]
conf.py
detail.rst [deleted file]
index.rst
language-examples.rst [deleted file]
language-naming.rst [deleted file]
language.rst [deleted file]
omake-grammar.rst [deleted file]
omake-options.rst [deleted file]
osh.rst [deleted file]
pervasives.rst [deleted file]
quickstart.rst [deleted file]
rules.rst [deleted file]
shell.rst [deleted file]
system.rst [deleted file]

diff --git a/_static/basic.css b/_static/basic.css
deleted file mode 100755 (executable)
index a440964..0000000
+++ /dev/null
@@ -1,405 +0,0 @@
-/**
- * Sphinx stylesheet -- basic theme
- * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- */
-
-/* -- main layout ----------------------------------------------------------- */
-
-div.clearer {
-    clear: both;
-}
-
-/* -- relbar ---------------------------------------------------------------- */
-
-div.related {
-    width: 100%;
-    font-size: 90%;
-}
-
-div.related h3 {
-    display: none;
-}
-
-div.related ul {
-    margin: 0;
-    padding: 0 0 0 10px;
-    list-style: none;
-}
-
-div.related li {
-    display: inline;
-}
-
-div.related li.right {
-    float: right;
-    margin-right: 5px;
-}
-
-/* -- sidebar --------------------------------------------------------------- */
-
-div.sphinxsidebarwrapper {
-    padding: 10px 5px 0 10px;
-}
-
-div.sphinxsidebar {
-    float: left;
-    width: 230px;
-    margin-left: -100%;
-    font-size: 90%;
-}
-
-div.sphinxsidebar ul {
-    list-style: none;
-}
-
-div.sphinxsidebar ul ul,
-div.sphinxsidebar ul.want-points {
-    margin-left: 20px;
-    list-style: square;
-}
-
-div.sphinxsidebar ul ul {
-    margin-top: 0;
-    margin-bottom: 0;
-}
-
-div.sphinxsidebar form {
-    margin-top: 10px;
-}
-
-div.sphinxsidebar input {
-    border: 1px solid #98dbcc;
-    font-family: sans-serif;
-    font-size: 1em;
-}
-
-img {
-    border: 0;
-}
-
-/* -- search page ----------------------------------------------------------- */
-
-ul.search {
-    margin: 10px 0 0 20px;
-    padding: 0;
-}
-
-ul.search li {
-    padding: 5px 0 5px 20px;
-    background-image: url(file.png);
-    background-repeat: no-repeat;
-    background-position: 0 7px;
-}
-
-ul.search li a {
-    font-weight: bold;
-}
-
-ul.search li div.context {
-    color: #888;
-    margin: 2px 0 0 30px;
-    text-align: left;
-}
-
-ul.keywordmatches li.goodmatch a {
-    font-weight: bold;
-}
-
-/* -- index page ------------------------------------------------------------ */
-
-table.contentstable {
-    width: 90%;
-}
-
-table.contentstable p.biglink {
-    line-height: 150%;
-}
-
-a.biglink {
-    font-size: 1.3em;
-}
-
-span.linkdescr {
-    font-style: italic;
-    padding-top: 5px;
-    font-size: 90%;
-}
-
-/* -- general index --------------------------------------------------------- */
-
-table.indextable td {
-    text-align: left;
-    vertical-align: top;
-}
-
-table.indextable dl, table.indextable dd {
-    margin-top: 0;
-    margin-bottom: 0;
-}
-
-table.indextable tr.pcap {
-    height: 10px;
-}
-
-table.indextable tr.cap {
-    margin-top: 10px;
-    background-color: #f2f2f2;
-}
-
-img.toggler {
-    margin-right: 3px;
-    margin-top: 3px;
-    cursor: pointer;
-}
-
-/* -- general body styles --------------------------------------------------- */
-
-a.headerlink {
-    visibility: hidden;
-}
-
-h1:hover > a.headerlink,
-h2:hover > a.headerlink,
-h3:hover > a.headerlink,
-h4:hover > a.headerlink,
-h5:hover > a.headerlink,
-h6:hover > a.headerlink,
-dt:hover > a.headerlink {
-    visibility: visible;
-}
-
-div.body p.caption {
-    text-align: inherit;
-}
-
-div.body td {
-    text-align: left;
-}
-
-.field-list ul {
-    padding-left: 1em;
-}
-
-.first {
-    margin-top: 0 !important;
-}
-
-p.rubric {
-    margin-top: 30px;
-    font-weight: bold;
-}
-
-/* -- sidebars -------------------------------------------------------------- */
-
-div.sidebar {
-    margin: 0 0 0.5em 1em;
-    border: 1px solid #ddb;
-    padding: 7px 7px 0 7px;
-    background-color: #ffe;
-    width: 40%;
-    float: right;
-}
-
-p.sidebar-title {
-    font-weight: bold;
-}
-
-/* -- topics ---------------------------------------------------------------- */
-
-div.topic {
-    border: 1px solid #ccc;
-    padding: 7px 7px 0 7px;
-    margin: 10px 0 10px 0;
-}
-
-p.topic-title {
-    font-size: 1.1em;
-    font-weight: bold;
-    margin-top: 10px;
-}
-
-/* -- admonitions ----------------------------------------------------------- */
-
-div.admonition {
-    margin-top: 10px;
-    margin-bottom: 10px;
-    padding: 7px;
-}
-
-div.admonition dt {
-    font-weight: bold;
-}
-
-div.admonition dl {
-    margin-bottom: 0;
-}
-
-p.admonition-title {
-    margin: 0px 10px 5px 0px;
-    font-weight: bold;
-}
-
-div.body p.centered {
-    text-align: center;
-    margin-top: 25px;
-}
-
-/* -- tables ---------------------------------------------------------------- */
-
-table.docutils {
-    border: 0;
-    border-collapse: collapse;
-}
-
-table.docutils td, table.docutils th {
-    padding: 1px 8px 1px 5px;
-    border-top: 0;
-    border-left: 0;
-    border-right: 0;
-    border-bottom: 1px solid #aaa;
-}
-
-table.field-list td, table.field-list th {
-    border: 0 !important;
-}
-
-table.footnote td, table.footnote th {
-    border: 0 !important;
-}
-
-th {
-    text-align: left;
-    padding-right: 5px;
-}
-
-/* -- other body styles ----------------------------------------------------- */
-
-dl {
-    margin-bottom: 15px;
-}
-
-dd p {
-    margin-top: 0px;
-}
-
-dd ul, dd table {
-    margin-bottom: 10px;
-}
-
-dd {
-    margin-top: 3px;
-    margin-bottom: 10px;
-    margin-left: 30px;
-}
-
-dt:target, .highlight {
-    background-color: #fbe54e;
-}
-
-dl.glossary dt {
-    font-weight: bold;
-    font-size: 1.1em;
-}
-
-.field-list ul {
-    margin: 0;
-    padding-left: 1em;
-}
-
-.field-list p {
-    margin: 0;
-}
-
-.refcount {
-    color: #060;
-}
-
-.optional {
-    font-size: 1.3em;
-}
-
-.versionmodified {
-    font-style: italic;
-}
-
-.system-message {
-    background-color: #fda;
-    padding: 5px;
-    border: 3px solid red;
-}
-
-.footnote:target  {
-    background-color: #ffa
-}
-
-/* -- code displays --------------------------------------------------------- */
-
-pre {
-    overflow: auto;
-}
-
-td.linenos pre {
-    padding: 5px 0px;
-    border: 0;
-    background-color: transparent;
-    color: #aaa;
-}
-
-table.highlighttable {
-    margin-left: 0.5em;
-}
-
-table.highlighttable td {
-    padding: 0 0.5em 0 0.5em;
-}
-
-tt.descname {
-    background-color: transparent;
-    font-weight: bold;
-    font-size: 1.2em;
-}
-
-tt.descclassname {
-    background-color: transparent;
-}
-
-tt.xref, a tt {
-    background-color: transparent;
-    font-weight: bold;
-}
-
-h1 tt, h2 tt, h3 tt, h4 tt, h5 tt, h6 tt {
-    background-color: transparent;
-}
-
-/* -- math display ---------------------------------------------------------- */
-
-img.math {
-    vertical-align: middle;
-}
-
-div.body div.math p {
-    text-align: center;
-}
-
-span.eqno {
-    float: right;
-}
-
-/* -- printout stylesheet --------------------------------------------------- */
-
-@media print {
-    div.document,
-    div.documentwrapper,
-    div.bodywrapper {
-        margin: 0 !important;
-        width: 100%;
-    }
-
-    div.sphinxsidebar,
-    div.related,
-    div.footer,
-    #top-link {
-        display: none;
-    }
-}
diff --git a/_static/omake.gif b/_static/omake.gif
deleted file mode 100755 (executable)
index e2bfd58..0000000
Binary files a/_static/omake.gif and /dev/null differ
diff --git a/_templates/layout.html b/_templates/layout.html
deleted file mode 100644 (file)
index d26625a..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-{% extends "!layout.html" %}
-
-{%- block sidebarsearch %}
-{{ super() }}
-<h3>SourceForge.JP</h3>
-<div>
-  <p>
-    <a href="http://sourceforge.jp/"><img src="http://sourceforge.jp/sflogo.php?group_id=4761&type=2" width="125" height="39" border="0" alt="SourceForge.JP"></a>
-  </p>
-  <p>
-    このドキュメントは<a href="http://sourceforge.jp/">sourceforge.jp</a>のサーバを利用して提供しています。
-  </p>
-</div>
-{%- endblock %}
-
-{% block extrahead %}
-<script type="text/javascript">
-var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
-document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
-</script>
-<script type="text/javascript">
-try {
-var pageTracker = _gat._getTracker("UA-378035-3");
-pageTracker._trackPageview();
-} catch(err) {}</script>
-{% endblock %}
-
diff --git a/autoconf.rst b/autoconf.rst
deleted file mode 100644 (file)
index be779f8..0000000
+++ /dev/null
@@ -1,329 +0,0 @@
-.. 14-autoconf
-
-.. index::
-   single: autoconf
-   single: configure
-.. _label14:
-
-14. 自動設定用の変数と関数
-========================================
-.. OMake standard library provides a number of functions and variables intended to help one write build specifications that need to be capable of autoconfiguring itself to adjust to different build environments.
-
-OMakeの標準ライブラリでは、異なったビルド環境下でのビルドを調整するための、自動設定(autoconfiguring)用のコードを書くことを手助けする、数多くの関数や変数を提供しています。
-
-.. index::
-   single: static.
-.. _label14.1:
-
-14.1 汎用的な自動設定関数
-----------------------------------
-.. The following general-purpose functions can be used to discover the properties of your build environment in a fashion similar to the one used by GNU autoconf tool you may be familiar with. It is recommended that these function be used from an appropriate static. block (see Section 4.14 for more information).
-
-以下にリストしてある汎用的な関数では、あなたの『ビルド環境(the properties of your build environment)』について調べることができます。これらの関数の中には、恐らくあなたがよく知っているであろうGNU autoconfツールによく似ているものも含まれています。また、これらの関数は適切な ``static.`` ブロックで使うことを推奨しています(詳細は ":ref:`label4.14`" を参照してください)。
-
-.. In order to use the following general-purpose functions, you need to have the line included in your OMakefile or OMakeroot. 
-
-以下の汎用的な関数を使うためには、まずあなたの ``OMakeroot`` あるいは ``OMakefile`` ファイルに、以下の一行を追加してください。 ::
-
-  open configure/Configure
-
-.. index::
-   single: ConfMsgChecking()
-   single: ConfMsgResult()
-.. _label14.1.1:
-
-14.1.1 ConfMsgChecking, ConfMsgResult
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-::
-
-  ConfMsgChecking(<msg>)
-  ...
-  ConfMsgResult(<msg>)
-
-.. The ConfMsgChecking function output message of the form --- Checking <msg>... without any trailing newline. After the test advertized by ConfMsgChecking is performed, the ConfMsgResult function should be used to output the result.
-
-``ConfMsgChecking`` 関数は ``--- Checking <msg>...`` のような形のメッセージを *改行なしで* 出力します。 ``ConfMsgChecking`` が実行されて、後にテストが終わったときには、 ``ConfMsgResult`` 関数を使って結果を出力すべきです。
-
-.. In certain cases users may want to redefine these function — for example, to use a different output formatting and/or to copy the messages to a log file.
-
-これらの関数を再定義したいという場合があるかもしれません。例えば、出力の形式を異なったものにしたいという場合や、メッセージをログファイルにコピーしたいというような場合です。
-
-例::
-
-  static. =
-     ConfMsgChecking(which foo to use)
-     foo = ...
-     ConfMsgResult($(foo))
-
-.. index::
-   single: ConfMsgWarn()
-   single: ConfMsgError()
-.. _label14.1.2:
-
-14.1.2 ConfMsgWarn, ConfMsgError
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-::
-
-  ConfMsgWarn(<msg>)
-  ConfMsgError(<msg>)
-
-.. Print a warning or an error message respectively. ConfMsgError would then abort OMake. 
-
-警告やエラーメッセージをそれぞれ表示します。 ``ConfMsgError`` はOMakeを中断させます。
-
-.. index::
-   single: ConfMsgYesNo()
-   single: ConfMsgFound()
-.. _label14.1.3:
-
-14.1.3 ConfMsgYesNo, ConfMsgFound
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-::
-
-  flag = $(ConfMsgYesNo <bool expr>)
-  flag = $(ConfMsgFound <bool expr>)
-
-.. The ConfMsgFound function expects to receive a boolean flag describing whether a test previously announced using the ConfMsgChecking function found what it was looking for. ConfMsgFound will output the appropriate result (“found” or “NOT found”) using the ConfMsgResult function and return its argument back.
-
-``ConfMsgFound`` 関数を使う前にまず ``ConfMsgChecking`` 関数を用いて「コマンドが使用できるかどうか調べます」ということをユーザに伝えます。その後、その結果を真偽値で ``ConfMsgFound`` 関数に渡します。 ``ConfMsgFound`` は結果を適切な形("found"あるいは"NOT found")に直し、 ``ConfMsgResult`` 関数を使って出力します。また引数として渡された結果を、加工しないでそのまま返します。
-
-.. The ConfMsgYesNo function is similar, outputting a simple (“yes” or “NO”). 
-
-``ConfMsgYesNo`` 関数は ``ConfMsgFound`` と似ていますが、出力がシンプルです("yes"あるいは"NO")。
-
-.. index::
-   single: TryConpileC()
-   single: TryLinkC()
-   single: TryRunC()
-.. _label14.1.4:
-
-14.1.4 TryCompileC, TryLinkC, TryRunC
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-::
-
-  success = $(TryCompileC <prog_text>)
-  success = $(TryLinkC <prog_text>)
-  success = $(TryRunC <prog_text>)
-
-.. Given the text of a C program, the TryCompileC, TryLinkC, and TryRunC functions would try to compile / compile and link / compile, link, and run, the given program and return a boolean flag indicating whether the attempt was successful.
-
-Cプログラムの *コード* を引数として渡します。 ``TryCompileC`` , ``TryLinkC`` , ``TryRunC`` 関数は与えられた引数を『コンパイル/コンパイルとリンク/コンパイルとリンクと実行』できるかどうか試します。テストが成功した場合、この関数は真を返します。一方で、失敗した場合は偽を返します。
-
-.. TryCompileC will use the CC, CFLAGS and INCLUDES variables to run the C compiler. TryLinkC and TryRunC will also use the LDFLAGS variable to run the C compiler and linker. However, the flags like /WX, -Werror and -warn-error will be not be passed to the compiler, even if they occur in CFLAGS.
-
-``TryCompileC`` はCコンパイラを実行するときに ``CC`` , ``CFLAGS`` , ``INCLUDES`` 変数を使用します。 ``TryLinkC`` と ``TryRunC`` はそれに加えて ``LDFLAGS`` 変数を、Cコンパイラとリンカを実行するときに使用します。しかし、 ``/WX`` , ``-Werror`` , ``-warn-error`` のようなフラグは、たとえ ``CFLAGS`` 変数に含まれていたとしても、コンパイラに渡されることはありません。
-
-.. These functions are silent and should normally be used with an appropriate ConfMsgChecking … ConfMsgResult. 
-
-これらの関数は結果を表示しません。また、通常の場合は適切な ``ConfMsgChecking`` ~ ``ConfMsgResult`` 間で使用すべきです。
-
-.. index::
-   single: RunCProg()
-.. _label14.1.5:
-
-14.1.5 RunCProg
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-::
-
-  output = $(RunCProg <prog>)
-
-.. RunCProg is similar to the RunCProg function, except that it returns the output of the function (will return false if the program fails to compile or run). 
-
-``RunCProg`` 関数は ``TryRunC`` 関数と似ていますが、この関数はプログラムの出力を返します(プログラムのコンパイルや実行に失敗した場合は ``false`` が返されます)。
-
-.. note::
-   訳注: 原文では "RunCProg is similar to the RunCProg function, ..." となっていましたが、恐らくこれはTryRunCの間違いではないかと思われます
-
-.. index::
-   single: CheckCHeader()
-   single: VerboseCheckCHeader()
-.. _label14.1.6:
-
-14.1.6 CheckCHeader, VerboseCheckCHeader
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-::
-
-  success = $(CheckCHeader <files>)
-  success = $(VerboseCheckCHeader <files>)
-
-.. Use the TryCompileC function to check whether your C compiler can locate and process the specified headers files. Will incude <stdio.h> before including the header files.
-
-``TryCompileC`` 関数を用いることで、あなたのCコンパイラが指定したヘッダファイルの位置をつきとめ、さらに処理できるかどうか調べることができます。 ``TryCompileC`` 関数はヘッダファイルをインクルードする前に ``<stdio.h>`` をインクルードします。
-
-.. Both functions return a boolean value. The CheckCHeader function is silent; the VerboseCheckCHeader function will use the ConfMsgChecking and ConfMsgResult functions to describe the test and the outcome.
-
-両方の関数は真偽値を返します。 ``CheckCHeader`` 関数は結果を表示しません。 ``VerboseCheckCHeader`` 関数はテストと結果を表示するのに ``ConfMsgChecking`` と ``ConfMsgResult`` 関数を使います。
-
-例::
-
-  static. =
-     NCURSES_H_AVAILABLE = $(VerboseCheckCHeader ncurses.h)
-
-.. index::
-   single: CheckCLib()
-   single: VerboseCheckCLib()
-.. _label14.1.7:
-
-14.1.7 CheckCLib, VerboseCheckCLib
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-::
-
-  success = $(CheckCLib <libs>, <functions>)
-  success = $(VerboseCheckCLib <libs>, <functions>)
-
-.. Use the TryLinkC function to check whether your C compiler and linker can find the named functions when linking with the named libraries. Will pass the <libs> to the compiler using the -l flag.
-
-``TryLinkC`` 関数を用いることで、与えられたライブラリのリンク時に、あなたのCコンパイラとリンカが、与えられた関数を見つけられるかどうか調べることができます。 ``TryLinkC`` 関数は ``-l`` フラグを使ってコンパイラに ``<libs>`` を渡します。
-
-.. Both functions return a boolean value. The CheckCLib function is silent; the VerboseCheckCHeader function will use the ConfMsgChecking and ConfMsgResult functions to describe the test and the outcome.
-
-両方の関数は真偽値を返します。 ``CheckCLib`` 関数は結果を表示しません。 ``VerboseCheckCLib`` 関数はテストと結果を表示するのに ``ConfMsgChecking`` と ``ConfMsgResult`` 関数を使います。
-
-例::
-
-  static. =
-      NCURSES_LIB_AVAILABLE = $(VerboseCheckCLib ncurses, initscr setupterm tigetstr)
-
-.. index::
-   single: CheckProg()
-.. _label14.1.8:
-
-14.1.8 CheckProg
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-::
-
-  success = $(CheckProg <prog>)
-
-.. Checks whether the program <prog> exists in your path. Will use the ConfMsgChecking and ConfMsgResult functions to describe the test and the outcome.
-
-あなたのパス中に ``<prog>`` が存在しているかどうかを調べます。この関数はテストと結果を表示するのに ``ConfMsgChecking`` と ``ConfMsgResult`` 関数を使います。
-
-.. index::
-   single: AC_MSG_CHECKING
-   single: AC_MSG_RESULT
-   single: AC_MSG_WARN
-   single: AC_MSG_ERROR
-   single: AC_TRY_COMPILE
-   single: AC_TRY_LINK
-   single: AC_TRY_RUN
-.. _label14.2:
-
-14.2 ``autoconf`` スクリプトをOMake用に翻訳する
---------------------------------------------------
-.. Some of the functions described above are very similar to the ones present in autoconf. Below is a brief translation table for such functions. 
-
-上の関数のいくつかは、 ``autoconf`` に存在しているものと非常に似ています。以下はそのような関数のための簡単な翻訳テーブルです。
-
-.. AC_MSG_CHECKING is very similar to ConfMsgChecking function. 
-   AC_MSG_RESULT is very similar to ConfMsgResult function. 
-   AC_MSG_WARN is very similar to ConfMsgWarn function. 
-   AC_MSG_ERROR is very similar to ConfMsgError function. 
-   AC_TRY_COMPILE is somewhat similar to TryCompileC function, except the TryCompileC function returns a boolean value and only works for C. Similarly,
-   AC_TRY_LINK is approximated by TryLinkC function, and 
-   AC_TRY_RUN is approximated by TryRunC function. 
-
-* ``AC_MSG_CHECKING`` は ``ConfMsgChecking`` 関数と非常に似ています。
-* ``AC_MSG_RESULT`` は ``ConfMsgResult`` 関数と非常に似ています。
-* ``AC_MSG_WARN`` は ``ConfMsgWarn`` 関数と非常に似ています。
-* ``AC_MSG_ERROR`` は ``COnfMsgError`` 関数と非常に似ています。
-* ``AC_TRY_COMPILE`` は ``TryCompileC`` 関数といくらか似ています。ただし、 ``TryCompileC`` 関数は真偽値を返し、 ``C`` 言語のみに機能するという点が異なります。
-* ``AC_TRY_LINK`` は ``TryLinkC`` 関数と似ています。
-* ``AC_TRY_RUN`` は ``TryRunC`` 関数と似ています。
-
-.. _label14.3:
-
-14.3 事前に用意された設定テスト
-------------------------------------------
-.. A number of configuration tests are already included in the standard library. In order to use them in your project, simply open (see Section 4.7) the corresponding build file in your OMakefile and the tests will run the first time OMake is executed. Note that it is not a problem to open these files from more than one place in your project — if you do that, the test will still run only once. 
-
-OMakeでは数多くの設定テスト(configuration tests)が標準ライブラリに含まれています。あなたのプロジェクトでこれらを使うためには、単純に対象の ``OMakefile`` に、設定テストを記述したビルドファイルを『 ``open`` (詳細は ":ref:`label4.7`" を参照してください)』するだけです。そうすれば、OMakeを初めて実行した時点で設定テストが実行されます。これは、あなたのプロジェクト上で二回以上設定テストが ``open`` されるわけではない点に注意してください。たとえ二回以上呼び出したとしても、このテストは一回だけしか実行されません。
-
-.. index::
-   single: NCURSES_AVAILABLE
-   single: NCURSES_TERMH_IN_NCURSES
-   single: NCURSES_CFLAGS
-   single: NCURSES_CLIBS
-.. _label14.3.1:
-
-14.3.1 NCursesライブラリの設定
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-.. Add open configure/ncurses line to your OMakefile to get access to the following autoconfiguration variables. 
-
-あなたの ``OMakefile`` に ``open configure/ncurses`` を加えることで、以下の自動設定変数を利用できます。
-
-* **NCURSES_AVAILABLE**
-  
-  .. A boolean flag that would be set when both the curses.h header, the term.h header, and the ncurses library very found.
-  
-  ``curses.h`` , ``term.h`` ヘッダファイルと ``ncurses`` ライブラリが見つかった場合に真となる真偽値
-
-* **NCURSES_TERMH_IN_NCURSES**
-  
-  .. A boolean flag that would be set when term.h has to be included as <ncurses/term.h> instead of <term.h>.
-  
-  ``term.h`` が ``<term.h>`` の代わりに ``<ncurses/term.h>`` としてインクルードされていた場合に真となる真偽値
-
-* **NCURSES_CFLAGS**
-  
-  .. The CFLAGS to use when compiling ncurses code. Will include -DNCURSES and -DTERMH_IN_NCURSES, respectively when NCURSES_AVAILABLE and NCURSES_TERMH_IN_NCURSES are true.
-  
-  ncursesコードをコンパイルする際に用いる ``CFLAGS`` の値。 ``NCURSES_AVAILABLE`` と ``NCURSES_TERMH_IN_NCURSES`` がそれぞれ真である場合には ``-DNCURSES`` と ``-DTERMH_IN_NCURSES`` が含まれます。
-
-* **NCURSES_CLIBS**
-  
-  .. The LDFLAGS to use when linking ncurses code. Will normally contain -lncurses when ncurses is found and remain empty otherwise. 
-  
-  ncursesコードをリンクする際に用いる ``LDFLAGS`` の値。ncursesが見つかって、それ以外が空のままである場合には通常 ``-lncurses`` が含まれます。
-
-.. index::
-   single: READLINE_AVAILABLE
-   single: READLINE_GNU
-   single: READLINE_CFLAGS
-   single: READLINE_CLIBS
-.. _label14.3.2:
-
-14.3.2 ReadLineライブラリの設定
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-.. Add open configure/readline line to your OMakefile to get access to the following autoconfiguration variables. 
-
-あなたの ``OMakefile`` に ``open configure/readline`` を加えることで、以下の自動設定変数を利用できます。
-
-* **READLINE_AVAILABLE**
-  
-  .. A boolean flag that would be set when both the readline/readline.h header, the readline/history.h header, and the readline library very found.
-  
-  ``readline/readline.h`` , ``readline/history.h`` ヘッダと ``readline`` ライブラリが見つかった場合に真となる真偽値
-
-* **READLINE_GNU**
-  
-  .. A boolean flag that would be set when the GNU version of the readline library is found (as opposed to the BSD one).
-  
-  readlineライブラリのGNUバージョン(BSDバージョンではなく)が見つかった場合に真となる真偽値
-
-* **READLINE_CFLAGS**
-  
-  .. The CFLAGS to use when compiling readline code. Will include -DREADLINE_ENABLED and -DREADLINE_GNU, respectively when READLINE_AVAILABLE and READLINE_GNU are true.
-  
-  readlineコードをコンパイルする際に用いる ``CFLAGS`` の値。 ``READLINE_AVAILABLE`` と ``READLINE_GNU`` がそれぞれ真である場合には ``-DREADLINE_ENABLED`` と ``-DREADLINE_GNU`` が含まれます。
-
-* **READLINE_CLIBS**
-  
-  .. The LDFLAGS to use when linking readline code. Will normally contain -lncurses -lreadline when readline is found and remain empty otherwise. 
-  
-  readlineコードをリンクする際に用いる ``LDFLAGS`` の値。readlineが見つかって、それ以外が空である場合には通常 ``-lncurses -lreadline`` が含まれます。
-
-.. index::
-   single: SNPRINTF_AVAILABLE
-.. _label14.3.3:
-
-14.3.3 Snprintfの設定
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-.. Add open configure/snprintf line to your OMakefile to get access to the following autoconfiguration variables.
-
-あなたの ``OMakefile`` に ``open configure/snprintf`` を加えることで、以下の自動設定変数を利用できます。
-
-* **SNPRINTF_AVAILABLE**
-  
-  .. A boolean flag telling whether the snprintf function is available in the standard C library.
-  
-  標準Cライブラリでsnprintf関数が利用可能であるかどうかを示す真偽値
diff --git a/base.rst b/base.rst
deleted file mode 100644 (file)
index 4fad068..0000000
--- a/base.rst
+++ /dev/null
@@ -1,1918 +0,0 @@
-.. 9-base
-
-.. _label9:
-
-9. 基本ライブラリ
-==================================
-
-.. index::
-   single: OMAKE_VERSION
-   single: STDLIB
-   single: OMAKEPATH
-   single: OSTYPE
-   single: SYSNAME
-   single: NODENAME
-   single: OS_VERSION
-   single: MACHINE
-   single: HOST
-   single: USER
-   single: HOME
-   single: PID
-   single: TARGETS
-   single: BUILD_SUMMARY
-   single: VERBOSE
-.. _label9.1:
-
-9.1 ビルドイン変数
-----------------------------------
-
-* **OMAKE_VERSION** 
-
-  OMakeのバージョンを表します。
-
-.. Version of OMake.
-
-* **STDLIB**
-
-  OMakeの基本ライブラリのファイルがあるディレクトリを表します。起動時に、この変数のデフォルトの値は以下のようにして決定されます。
-
-  * ``OMAKELIB`` 環境変数の値が存在している場合はその値が用いられます。ただし、値は絶対パスでなければなりません。
-  * Windows上では、レジストリのキー ``HKEY_CURRENT_USER\SOFTWARE\MetaPRL\OMake\OMAKELIB`` と ``HKEY_LOCAL_MACHINE\SOFTWARE\MetaPRL\OMake\OMAKELIB`` が調べられ、存在している場合にはその値が用いられます。
-  * さもなければコンパイルされた時の値が用いられます。
-
-  現在のデフォルトの値は ``omake --version`` を実行することによって参照できます。
-
-.. The directory where the OMake standard library files reside. At startup, the default value is determined as follows. 
-      * The value of the OMAKELIB environment variable, if set (must contain an absolute path, if set), otherwise
-      * On Windows, the registry keys HKEY_CURRENT_USER\SOFTWARE\MetaPRL\OMake\OMAKELIB and HKEY_LOCAL_MACHINE\SOFTWARE\MetaPRL\OMake\OMAKELIB are looked up and the value is used, if exist.
-      * Otherwise a compile-time default it used. 
-  The current default value may be accessed by running omake --version
-
-* **OMAKEPATH**
-
-  ``include`` と ``open`` 文における検索パスを指定した、ディレクトリの配列です(詳細は ":ref:`label4.7`" を参照してください)。デフォルトの値は ``.`` と ``$(STDLIB)`` の2つの成分を持った配列です。
-
-.. An array of directories specifying the lookup path for the include and open directives (see Section 4.7). The default value is an array of two elements — . and $(STDLIB).
-
-* **OSTYPE**
-  
-  omakeを実行しているマシンのアーキテクチャの集合です。考えられる値は ``Unix`` (LinuxやMac OS Xを含む、すべてのUnixのバージョンを表します), ``Win32`` (MS-Windowsでは、OMakeはMSVC++かMingwを用いてコンパイルします), ``Cygwin`` (MS-Windowsでは、OMakeはCygwinを用いてコンパイルします)があります。
-
-.. Set to the machine architecture omake is running on. Possible values are Unix (for all Unix versions, including Linux and Mac OS X), Win32 (for MS-Windows, OMake compiled with MSVC++ or Mingw), and Cygwin (for MS-Windows, OMake compiled with Cygwin). 
-
-* **SYSNAME**
-  
-  現在のマシンのOSの名前を表します。
-
-.. The name of the operating system for the current machine. 
-
-* **NODENAME**
-
-  現在のマシンのホスト名を表します。
-
-.. The hostname of the current machine. 
-
-* **OS_VERSION**
-
-  OSのバージョンを表します。
-
-.. The operating system release. 
-
-* **MACHINE**
-
-  マシンのアーキテクチャを表します(例: ``i386`` , ``sparc`` , etc...)。
-
-.. The machine architecture, e.g. i386, sparc, etc. 
-
-* **HOST**
-
-  ``NODENAME`` と等価です。
-
-.. Same as NODENAME. 
-
-* **USER**
-
-  処理を実行しているユーザのログイン名を表します。
-
-.. The login name of the user executing the process.
-
-* **HOME**
-
-  処理を実行しているユーザのホームディレクトリを表します。
-
-.. The home directory of the user executing the process. 
-
-* **PID**
-
-  OMakeのプロセスIDを表します。
-
-.. The OMake process id. 
-
-* **TARGETS**
-
-  コマンドラインのターゲットを表す文字列です。例えば、OMakeが以下のコマンドラインで実行されたとしましょう。 ::
-
-        omake CFLAGS=1 foo bar.c
-
-  この場合、 ``TARGETS`` は ``foo bar.c`` が定義されます。
-
-.. The command-line target strings. For example, if OMake is invoked with the following command line, 
-   then TARGETS is defined as foo bar.c.
-
-* **BUILD_SUMMARY**
-
-  ``BUILD_SUMMARY`` 変数は ``omake`` がビルド状況を要約したファイルが定義されています(メッセージはビルドの最後で出力されます)。ビルドが開始されたとき、このファイルは空です。あなたはビルド中にこのファイルを編集したり追加することで、ビルドの要約に何らかのメッセージを追加できます。
-
-  例えば、もしあなたがいくつかのアクションが発生した場所を把握しておきたいとしますと、ビルドの要約に以下を追加することで実現できます。 ::
-
-     foo: boo
-         echo "The file foo was built" >> $(BUILD_SUMMARY)
-         ...build foo...
-
-.. The BUILD_SUMMARY variable refers to the file that omake uses to summarize a build (the message that is printed at the very end of a build). The file is empty when the build starts. If you wish to add additional messages to the build summary, you can edit/modify this file during the build.
-   For example, if you want to point out that some action was taken, you can append a message to the build summary.
-
-* **VERBOSE**
-
-  いくつかのコマンドのメッセージが冗長に出力されます。デフォルトの値は ``false`` で、 ``--verbose`` オプションを用いてOMakeが実行された場合、変数の値は ``true`` となります。
-
-.. Whether certain commands should be verbose. A boolean flag that is false by default and is set to true when OMake is invoked with the --verbose option. 
-
-.. _label9.2:
-
-9.2 論理式、真偽関数、コマンドのコントロール
--------------------------------------------------
-.. Boolean values in omake are represented by case-insensitive strings. The false value can be represented by the strings false, no, nil, undefined or 0, and everything else is true.
-
-omakeのブーリアン型は状況に無反応な(case-insensitive)文字列によって表現されます。『偽』は文字列 ``false`` , ``no`` , ``nil`` , ``undefined`` , ``0`` のいづれかによって表現されます。それ以外はすべて『真』となります。
-
-.. index::
-   single: not()
-.. _label9.2.1:
-
-9.2.1 not
-^^^^^^^^^^^^^^^^^^^^^^^^^
-::
-
-   $(not e) : String
-      e : String
-
-.. The not function negates a Boolean value.
-
-``not`` 関数は真偽値を反転します。
-
-.. For example, $(not false) expands to the string true, and $(not hello world) expands to false. 
-
-例えば、 ``$(not false)`` は ``true`` が返されて、 ``$(not hello world)`` は ``false`` が返されます。
-
-.. index::
-   single: equal()
-.. _label9.2.2:
-
-9.2.2 equal
-^^^^^^^^^^^^^^^^^^^^^^^^^
-.. The equal function tests for equality of two values.
-
-``equal`` 関数は2つの値が等しいかどうか比較します。
-
-.. For example $(equal a, b) expands to false, and $(equal hello world, hello world) expands to true. 
-
-例えば、 ``$(equal a, b)`` は ``false`` が返されて、 ``$(equal hello world, hello world)`` は ``true`` が返されます。
-
-.. index::
-   single: and()
-.. _label9.2.3:
-
-9.2.3 and
-^^^^^^^^^^^^^^^^^^^^^^^^^
-::
-
-    $(and e1, ..., en) : String
-       e1, ..., en: Sequence
-
-.. The and function evaluates to the conjunction of its arguments.
-
-``and`` 関数は引数の論理積を評価します。
-
-.. For example, in the following code, X is true, and Y is false.
-
-例えば、以下のコードでは ``X`` は真で、 ``Y`` は偽となります。 ::
-
-    A = a
-    B = b
-    X = $(and $(equal $(A), a) true $(equal $(B), b))
-    Y = $(and $(equal $(A), a) true $(equal $(A), $(B)))
-
-.. index::
-   single: or()
-.. _label9.2.4:
-
-9.2.4 or
-^^^^^^^^^^^^^^^^^^^^^^^^^
-::
-
-   $(or e1, ..., en) : String
-      e1, ..., en: String Sequence
-
-.. The or function evaluates to the disjunction of its arguments.
-
-``or`` 関数は引数の選言を評価します。
-
-.. For example, in the following code, X is true, and Y is false.
-
-例えば、以下のコードでは ``X`` は真で、 ``Y`` は偽となります。 ::
-
-    A = a
-    B = b
-    X = $(or $(equal $(A), a) false $(equal $(A), $(B)))
-    Y = $(or $(equal $(A), $(B)) $(equal $(A), b))
-
-.. index::
-   single: if()
-.. _label9.2.5:
-
-9.2.5 if
-^^^^^^^^^^^^^^^^^^^^^^^^^
-::
-
-    $(if e1, e2[, e3]) : value
-       e1 : String
-       e2, e3 : value
-
-.. The if function represents a conditional based on a Boolean value. For example $(if $(equal a, b), c, d) evaluates to d.
-
-``if`` 関数は真偽値を基にした条件分岐を行います。例えば、 ``$(if $(equal a, b), c, d)`` は ``d`` と評価されます。
-
-.. Conditionals may also be declared with an alternate syntax.
-
-条件分岐は以下のような文を用いても宣言できます。 ::
-
-   if e1
-      body1
-   elseif e2
-      body2
-   ...
-   else
-      bodyn
-
-.. If the expression e1 is not false, then the expressions in body1 are evaluated and the result is returned as the value of the conditional. Otherwise, if e1 evaluates to false, the evaluation continues with the e2 expression. If none of the conditional expressions is true, then the expressions in bodyn are evaluated and the result is returned as the value of the conditional.
-
-もし式 ``e1`` が偽でなかったら ``body1`` が評価されて、結果は条件分岐の値として返されます。もし ``e1`` が偽であるなら、条件分岐は移り変わり ``e2`` の式が用いられます。もしどの条件式も真でなかった場合、 ``bodyn`` が評価されて、結果は条件分岐の値として返されます。
-
-.. There can be any number of elseif clauses; the else clause is optional.
-
-``if`` 文は任意の数の ``elseif`` 文を加えることができます。また、 ``else`` 文はなくても構いません。
-
-.. Note that each branch of the conditional defines its own scope, so variables defined in the branches are normally not visible outside the conditional. The export command may be used to export the variables defined in a scope. For example, the following expression represents a common idiom for defining the C compiler configuration.
-
-.. note::
-  各々の条件分岐文はそれぞれのスコープを持っているので、条件文中で定義された変数は通常外から見ることができません。 ``export`` コマンドはスコープ中で定義された変数をエクスポートするために用いられます。たとえば、以下の式はCコンパイラの設定を定義するために良く用いられる方法です。 ::
-
-   if $(equal $(OSTYPE), Win32)
-      CC = cl
-      CFLAGS += /DWIN32
-      export
-   else
-      CC = gcc
-      CFLAGS += -g -O2
-      export
-
-.. index::
-   single: switch()
-   single: match()
-.. _label9.2.6:
-
-9.2.6 switch, match
-^^^^^^^^^^^^^^^^^^^^^^^^^
-.. The switch and match functions perform pattern matching.
-
-``switch`` , ``match`` 関数はパターンのマッチングに用いられます。
-
-``$(switch <arg>, <pattern_1>, <value_1>, ..., <pattern_n>, <value_n>) $(match <arg>, <pattern_1>, <value_1>, ..., <pattern_n>, <value_n>)``
-
-.. The number of <pattern>/<value> pairs is arbitrary. They strictly alternate; the total number of arguments to <match> must be odd.
-
-``<pattern>/<value>`` の数は任意です。ただし、引数の数は必ず奇数でなければなりません。
-
-.. The <arg> is evaluated to a string, and compared with <pattern_1>. If it matches, the result of the expression is <value_1>. Otherwise evaluation continues with the remaining patterns until a match is found. If no pattern matches, the value is the empty string.
-
-``<arg>`` は文字列として評価されて、 ``<pattern_1>`` を用いて比較されます。もしマッチしている場合、結果の式は ``<value_1>`` が返されます。そうでない場合、マッチする文が見つかるまで、残りのパターンを用いて評価が行われます。
-
-.. The switch function uses string comparison to compare the argument with the patterns. For example, the following expression defines the FILE variable to be either foo, bar, or the empty string, depending on the value of the OSTYPE variable.
-
-``switch`` 関数はパターンと引数を比較するために用いられます。例えば、以下の表現式では、 ``FILE`` 変数は ``OSTYPE`` 変数の値に依存して、 ``foo`` , ``bar`` , あるいは空の文字列が定義されます。 ::
-
-    FILE = $(switch $(OSTYPE), Win32, foo, Unix, bar)
-
-.. The match function uses regular expression patterns (see the grep function). If a match is found, the variables $1, $2, ... are bound to the substrings matched between \( and \) delimiters. The $0 variable contains the entire match, and $* is an array of the matched substrings. to the matched substrings.
-
-``match`` 関数は正規表現を用います( ":ref:`label10.11.1`" を参照してください)。もしマッチしているパターンが見つかった場合、変数 ``$1, $2, ...`` は ``\(`` と ``\)`` デリミタの間にある文字列が束縛されます。 ``\0`` 変数は全体のマッチ文が定義されており、 ``$*`` はマッチした文字列の配列が定義されます。 ::
-
-    FILE = $(match foo_xyz/bar.a, foo_\\\(.*\\\)/\\\(.*\\\)\.a, foo_$2/$1.o)
-
-.. The switch and match functions also have an alternate (more usable) form.
-
-``switch`` と ``match`` 関数は代わりに(もっと便利な)以下のような形に書くことができます。 ::
-
-   match e
-   case pattern1
-      body1
-   case pattern2
-      body2
-   ...
-   default
-      bodyd
-
-.. If the value of expression e matches pattern_i and no previous pattern, then body_i is evaluated and returned as the result of the match. The switch function uses string comparison; the match function uses regular expression matching.
-
-式 ``e`` が前回のパターンでマッチせずに ``pattern_i`` でマッチした場合、 ``body_i`` が評価されて、 ``match`` の結果として返されます。 ``switch`` 関数は文字列の比較を行います。 ``match`` 関数は正規表現でのマッチングを行います。 ::
-
-   match $(FILE)
-   case $".*\(\.[^\/.]*\)"
-      println(The string $(FILE) has suffix $1)
-   default
-      println(The string $(FILE) has no suffix)
-
-.. index::
-   single: try
-.. _label9.2.7:
-
-9.2.7 try
-^^^^^^^^^^^^^^^^^^^^^^^^^
-::
-
-   try
-      try-body
-   catch class1(v1)
-      catch-body
-   when expr
-      when-body
-   ...
-   finally
-      finally-body
-
-.. The try form is used for exception handling. First, the expressions in the try-body are evaluated.
-
-``try`` 文は例外を扱うために用いられます。はじめに、 ``try-body`` の式が評価されます。
-
-.. If evaluation results in a value v without raising an exception, then the expressions in the finally-body are evaluated and the value v is returned as the result.
-
-値 ``v`` が例外を出さなかった場合、 ``finally-body`` の式が評価され値 ``v`` が結果として返されます。
-
-.. If evaluation of the try-body results in a exception object obj, the catch clauses are examined in order. When examining catch clause catch class(v), if the exception object obj is an instance of the class name class, the variable v is bound to the exception object, and the expressions in the catch-body are evaluated.
-
-``try-body`` の評価がオブジェクト ``obj`` の例外を送出した場合、 ``catch`` 文が代わりに評価されます。 ``catch`` 文の ``catch class(v)`` を実行している最中、もし例外のオブジェクト ``obj`` がクラス名 ``class`` のインスタンスであったならば、変数 ``v`` が例外のオブジェクトとして束縛されて、 ``catch-body`` の式が評価されます。
-
-.. If a when clause is encountered while a catch body is being evaluated, the predicate expr is evaluated. If the result is true, evaluation continues with the expressions in the when-body. Otherwise, the next catch clause is considered for evaluation.
-
-``catch`` 文が評価されている間中 ``when`` 文に遭遇した場合、評価式 ``expr`` が評価されます。もし結果が真であったならば、 ``when-body`` の式が続けて評価されます。さもなければ、次の ``catch`` 文が評価されます。
-
-.. If evaluation of a catch-body or when-body completes successfully, returning a value v, without encountering another when clause, then the expressions in the finally-body are evaluated and the value v is returned as the result.
-
-``catch-body`` か ``when-body`` の評価が完全に終わった場合、別の ``when`` 文を評価することなく ``finally-body`` の式が評価されて、値 ``v`` が返されます。
-
-.. There can be any number of catch clauses; the finally clause is optional. 
-
-``try`` 文には任意の数の ``catch`` 文を含めることができます。また、 ``finally`` 文はなくても構いません。
-
-.. index::
-   single: raise()
-.. _label9.2.8:
-
-9.2.8 raise
-^^^^^^^^^^^^^^^^^^^^^^^^^
-.. The raise function raises an exception. The exn object can be any object. However, the normal convention is to raise an Exception object.
-
-``raise`` 関数は例外を送出します。 ``exn`` は任意のオブジェクトです。しかしながら、通常は ``Exception`` オブジェクトを送出します。
-
-.. If the exception is never caught, the whole object will be verbosely printed in the error message. However, if the object is an Exception one and contains a message field, only that field will be included in the error message. 
-
-例外が捕らえられなかった場合、全体のオブジェクトはエラーメッセージとして詳細に出力されます。しかしながら、もしオブジェクトが ``Exception`` で ``message`` フィールドを含んでいるのなら、エラーメッセージは ``message`` のみが出力されます。
-
-.. index::
-   single: exit()
-.. _label9.2.9:
-
-9.2.9 exit
-^^^^^^^^^^^^^^^^^^^^^^^^^
-::
-
-   exit(code)
-      code : Int
-
-.. The exit function terminates omake abnormally.
-
-``exit`` 関数はomakeを異常終了させます。
-
-``$(exit <code>)``
-
-.. The exit function takes one integer argument, which is exit code. Non-zero values indicate abnormal termination. 
-
-``exit`` 関数は終了コードである整数を引数に指定します。0でない値は異常終了を表します。
-
-.. index::
-   single: defined()
-.. _label9.2.10:
-
-9.2.10 defined
-^^^^^^^^^^^^^^^^^^^^^^^^^
-::
-
-   $(defined sequence) : String
-      sequence : Sequence
-
-.. The defined function test whether all the variables in the sequence are currently defined. For example, the following code defines the X variable if it is not already defined.
-
-``defined`` 関数はシーケンス中のすべての変数が現在定義されているか試します。例えば、以下のコードでは変数 ``X`` が既に定義されていないかどうかを定義しています。 ::
-
-    if $(not $(defined X))
-       X = a b c
-       export
-
-.. It is acceptable to use qualified names.
-
-これは修飾された変数にも用いることができます。 ::
-
-    $(defined X.a.b)
-    $(defined public.X)
-
-.. index::
-   single: defined-env()
-.. _label9.2.11:
-
-9.2.11 defined-env
-^^^^^^^^^^^^^^^^^^^^^^^^^
-::
-
-   $(defined-env sequence) : String
-      sequence : String
-
-.. The defined-env function tests whether a variable is defined as part of the process environment.
-
-``defined-env`` 関数は処理している環境で、指定された変数が定義されているかどうか試します。
-
-.. For example, the following code adds the -g compile option if the environment variable DEBUG is defined.
-
-例えば、以下のコードでは、環境変数 ``DEBUG`` が定義されている場合は ``-g`` コンパイルオプションを追加します。 ::
-
-  if $(defined-env DEBUG)
-      CFLAGS += -g
-      export
-
-.. index::
-   single: getenv()
-.. _label9.2.12:
-
-9.2.12 getenv
-^^^^^^^^^^^^^^^^^^^^^^^^^
-::
-
-   $(getenv name) : String
-   $(getenv name, default) : String
-
-.. The getenv function gets the value of a variable from the process environment. The function takes one or two arguments.
-
-``getenv`` 関数は現在処理している環境での変数の値を取得します。この関数は一つか二つの引数を指定する必要があります。
-
-.. In the single argument form, an exception is raised if the variable variable is not defined in the environment. In the two-argument form, the second argument is returned as the result if the value is not defined.
-
-一つの引数を指定した場合、もし環境中で変数が定義されていなかったならば例外を送出します。二つの引数を指定した場合、もし定義されていなかったならば二番目の引数が返されます。
-
-.. For example, the following code defines the variable X to be a space-separated list of elements of the PATH environment variable if it is defined, and to /bin /usr/bin otherwise.
-
-例えば、以下のコードでは、もし環境変数 ``PATH`` が定義されていた場合は、その値を空白で分割したリストとして ``X`` を定義します。さもなければ ``/bin /usr/bin`` が代わりに使われます。 ::
-
-    X = $(split $(PATHSEP), $(getenv PATH, /bin:/usr/bin))
-
-.. You may also use the alternate form. 
-
-以下のような形でも定義することができます。 ::
-
-     getenv(NAME)
-         default
-
-.. index::
-   single: setenv()
-.. _label9.2.13:
-
-9.2.13 setenv
-^^^^^^^^^^^^^^^^^^^^^^^^^
-::
-
-   setenv(name, value)
-      name : String
-      value : String
-
-.. The setenv function sets the value of a variable in the process environment. Environment variables are scoped like normal variables.
-
-``setenv`` 関数は現在処理している環境での変数を定義します。環境変数は通常の変数のようにスコープされます。
-
-.. index::
-   single: unsetenv()
-.. _label9.2.14:
-
-9.2.14 unsetenv
-^^^^^^^^^^^^^^^^^^^^^^^^^
-::
-
-   unsetenv(names)
-      names : String Array
-
-.. The unsetenv function removes some variable definitions from the process environment. Environment variables are scoped like normal variables.
-
-``unsetenv`` 関数は現在処理している環境からいくつかの変数を削除します。環境変数は通常の変数のようにスコープされます。
-
-.. index::
-   single: get-registry()
-.. _label9.2.15:
-
-9.2.15 get-registry
-^^^^^^^^^^^^^^^^^^^^^^^^^
-::
-
-   get-registry(hkey, key, field) : String
-   get-registry(hkey, key, field, default) : String
-       hkey : String
-       key : String
-       field : String
-
-.. The get-registry function retrieves a string value from the system registry on Win32. On other architectures, there is no registry.
-
-``get-registry`` 関数はWin32上のシステムレジストリから文字列を取得します。他のアーキテクチャ上では、レジストリの値は返されません。
-
-.. The hive (I think that is the right word), indicates which part of the registry to use. It should be one of the following values.
-
-``hive`` (私はこの呼び方が正しいと思っています)では、使用するレジストリの区分を指定します。これは以下の値である必要があります。(訳注: よく意味がわかりませんがhkeyとfiveをもじったもの?)
-
-* HKEY_CLASSES_ROOT 
-* HKEY_CURRENT_CONFIG 
-* HKEY_CURRENT_USER 
-* HKEY_LOCAL_MACHINE 
-* HKEY_USERS 
-
-.. Refer to the Microsoft documentation if you want to know what these mean.
-
-もしこれらの意味について知りたい場合はマイクロソフトのドキュメントを参照してください。
-
-.. The key is the field you want to get from the registry. It should have a form like A\B\C (if you use forward slashes, they will be converted to backslashes). The field is the sub-field of the key.
-
-``key`` はレジストリから取得したいフィールドを指定します。これは ``A\B\C`` のような形である必要があります(通常のスラッシュを用いた場合はバックスラッシュに変換されます)。 ``field`` は ``key`` のサブフィールドを指定します。
-
-.. In the 4-argument form, the default is returned on failure. You may also use the alternate form.
-
-4つの引数を取る場合、 ``default`` の値が失敗したときに返されます。あなたはこれを別の形で用いることもできます。 ::
-
-    get-registry(hkey, key, field)
-       default
-
-.. index::
-   single: getvar()
-.. _label9.2.16:
-
-9.2.16 getvar
-^^^^^^^^^^^^^^^^^^^^^^^^^
-::
-
-   $(getvar name) : String
-
-.. The getvar function gets the value of a variable.
-
-``getvar`` 関数は変数の値を取得します。
-
-.. An exception is raised if the variable variable is not defined.
-
-変数が定義されていない場合は例外が送出されます。
-
-.. For example, the following code defines X to be the string abc.
-
-例えば、以下のコードでは ``X`` を文字列 ``abc`` で定義します。 ::
-
-    NAME = foo
-    foo_1 = abc
-    X = $(getvar $(NAME)_1)
-
-.. It is acceptable to use qualified names.
-
-これは修飾された変数にも使うことができます。 ::
-
-    $(getvar X.a.b)
-
-.. index::
-   single: setvar()
-.. _label9.2.17:
-
-9.2.17 setvar
-^^^^^^^^^^^^^^^^^^^^^^^^^
-::
-
-   setvar(name, value)
-      name : String
-      value : String
-
-.. The setvar function defines a new variable. For example, the following code defines the variable X to be the string abc.
-
-``setvar`` 関数は新しい変数を定義します。例えば、以下のコードでは ``X`` は文字列 ``abc`` で定義されます。 ::
-
-   NAME = X
-   setvar($(NAME), abc)
-
-.. It is acceptable to use qualified names.
-
-これは修飾された変数にも使うことができます。 ::
-
-    setvar(public.X, abc)
-
-9.3 配列とシーケンス
-----------------------------------
-
-.. index::
-   single: array()
-.. _label9.3.1:
-
-9.3.1 array
-^^^^^^^^^^^^^^^^^^^^^^^^^
-::
-
-    $(array elements) : Array
-       elements : Sequence
-
-.. The array function creates an array from a sequence. If the <arg> is a string, the elements of the array are the whitespace-separated elements of the string, respecting quotes.
-
-``array`` 関数はシーケンスから配列を生成します。もし ``<arg>`` が文字列だった場合、配列の成分はホワイトスペースによって区切られた文字列となります。また、クオートによっても区切られます。
-
-.. In addition, array variables can be declared as follows.
-
-加えて、配列の変数は以下のように宣言することもできます。 ::
-
-    A[] =
-       <val1>
-       ...
-       <valn>
-
-.. In this case, the elements of the array are exactly <val1>, ..., <valn>, and whitespace is preserved literally.
-
-この場合、配列の成分は ``<val1>`` , ... , ``<valn>`` であり、ホワイトスペースは文字通りに取り扱われます。
-
-.. index::
-   single: split()
-.. _label9.3.2:
-
-9.3.2 split
-^^^^^^^^^^^^^^^^^^^^^^^^^
-::
-
-   $(split sep, elements) : Array
-      sep : String
-      elements : Sequence
-
-.. The split function takes two arguments, a string of separators, and a string argument. The result is an array of elements determined by splitting the elements by all occurrence of the separator in the elements sequence.
-
-``split`` 関数は二つの引数を必要とし、一つめには文字列のデリミタ、二つめには区切りたい文字列を指定します。結果は ``elements`` シーケンスをセパレータによって区切った配列が返されます。
-
-.. For example, in the following code, the X variable is defined to be the array /bin /usr/bin /usr/local/bin.
-
-例えば、以下のコードでは、変数 ``X`` は配列 ``/bin /usr/bin /usr/local/bin`` に定義されます。 ::
-
-    PATH = /bin:/usr/bin:/usr/local/bin
-    X = $(split :, $(PATH))
-
-.. The sep argument may be omitted. In this case split breaks its arguments along the white space. Quotations are not split. 
-
-``sep`` は除外することもできます。この場合 ``split`` はホワイトスペースで区切ります。クオーテーションは区切りません。
-
-.. index::
-   single: concat()
-.. _label9.3.3:
-
-9.3.3 concat
-^^^^^^^^^^^^^^^^^^^^^^^^^
-::
-
-   $(concat sep, elements) : String
-      sep : String
-      elements : Sequence
-
-.. The concat function takes two arguments, a separator string, and a sequence of elements. The result is a string formed by concatenating the elements, placing the separator between adjacent elements.
-
-``concat`` 関数は二つの引数を必要とし、一つめには文字列のセパレータ、二つめにはシーケンスを指定します。結果は隣接した成分の間にセパレータを配置した、結合された文字列が返されます。
-
-.. For example, in the following code, the X variable is defined to be the string foo_x_bar_x_baz.
-
-例えば、以下のコードでは、変数 ``X`` は文字列 ``foo_x_bar_x_baz`` に定義されます。 ::
-
-    X = foo  bar     baz
-    Y = $(concat _x_, $(X))
-
-.. index::
-   single: length()
-.. _label9.3.4:
-
-9.3.4 length
-^^^^^^^^^^^^^^^^^^^^^^^^^
-::
-
-   $(length sequence) : Int
-      sequence : Sequence
-
-.. The length function returns the number of elements in its argument.
-
-``length`` 関数は引数の成分の数を返します。
-
-.. For example, the expression $(length a b "c d") evaluates to 3. 
-
-例えば、式 ``$(length a b "c d")`` は3と評価されます。
-
-.. index::
-   single: nth()
-.. _label9.3.5:
-
-9.3.5 nth
-^^^^^^^^^^^^^^^^^^^^^^^^^
-::
-
-   $(nth i, sequence) : value
-      i : Int
-      sequence : Sequence
-   raises RuntimeException
-
-.. The nth function returns the nth element of its argument, treated as a list. Counting starts at 0. An exception is raised if the index is not in bounds.
-
-``nth`` 関数は引数のi番目の成分を返します。配列のインデックスは0から始まります。もしインデックスが存在しない成分を指定していた場合、例外が送出されます。
-
-.. For example, the expression $(nth 1, a "b c" d) evaluates to "b c".
-
-例えば、式 ``$(nth 1, a "b c" d)`` は ``"b c"`` と評価されます。
-
-.. index::
-   single: replace-nth()
-.. _label9.3.6:
-
-9.3.6 replace-nth
-^^^^^^^^^^^^^^^^^^^^^^^^^
-::
-
-   $(replace-nth i, sequence, x) : value
-      i : Int
-      sequence : Sequence
-      x : value
-   raises RuntimeException
-
-.. The replace-nth function replaces the nth element of its argument with a new value x. Counting starts at 0. An exception is raised if the index is not in bounds.
-
-``replace-nth`` 関数はi番目の成分を新しい値 ``x`` に置き換えます。インデックスは0から始まります。もしインデックスが存在しない成分を指定していた場合、例外が送出されます。
-
-.. For example, the expression $(replace-nth 1, a "b c" d, x) evaluates to a x d.
-
-例えば、式 ``$(replace-nth 1, a "b c" d, x)`` は ``a x d`` と評価されます。
-
-.. index::
-   single: nth-hd()
-.. _label9.3.7:
-
-9.3.7 nth-hd
-^^^^^^^^^^^^^^^^^^^^^^^^^
-::
-
-   $(nth-hd i, sequence) : value
-      i : Int
-      sequence : Sequence
-   raises RuntimeException
-
-.. The nth-hd function returns the first i elements of the sequence. An exception is raised if the sequence is not at least i elements long.
-
-``nth-hd`` 関数は最初から ``i`` 個までの成分をもった配列を返します。もしシーケンスが ``i`` 個より少ない場合は例外が送出されます。
-
-.. For example, the expression $(nth-hd 2, a "b c" d) evaluates to a "b c".
-
-例えば、式 ``$(nth-hd 2, a "b c" d)`` は ``a "b c"`` と評価されます。
-
-.. index::
-   single: nth-tl()
-.. _label9.3.8:
-
-9.3.8 nth-tl
-^^^^^^^^^^^^^^^^^^^^^^^^^
-::
-
-   $(nth-tl i, sequence) : value
-      i : Int
-      sequence : Sequence
-   raises RuntimeException
-
-.. The nth-tl function skips i elements of the sequence and returns the rest. An exception is raised if the sequence is not at least i elements long.
-
-``nth-tl`` 関数は最初から ``i`` 個までの成分を除いた、残りの配列を返します。もしシーケンスが ``i`` 個より少ない場合には例外が送出されます。
-
-.. For example, the expression $(nth-tl 1, a "b c" d) evaluates to "b c" d.
-
-例えば、式 ``$(nth-tl 1, a "b c" d)`` は ``"b c" d`` と評価されます。
-
-.. index::
-   single: subrange()
-.. _label9.3.9:
-
-9.3.9 subrange
-^^^^^^^^^^^^^^^^^^^^^^^^^
-::
-
-   $(subrange off, len, sequent) : value
-      off : Int
-      len : Int
-      sequence : Sequence
-   raises RuntimeException
-
-.. The subrange function returns a subrange of the sequence. Counting starts at 0. An exception is raised if the specified range is not in bounds.
-
-``subrange`` 関数はシーケンスの一部分を返します。インデックスは0から始まります。もし指定された範囲に成分が存在しない場合には例外が送出されます。
-
-.. For example, the expression $(subrange 1, 2, a "b c" d e) evaluates to "b c" d. 
-
-例えば、式 ``$(subrange 1, 2, a "b c" d e)`` は ``"b c" d`` と評価されます。
-
-.. index::
-   single: rev()
-.. _label9.3.10:
-
-9.3.10 rev
-^^^^^^^^^^^^^^^^^^^^^^^^^
-::
-
-    $(rev sequence) : Sequence
-       sequence : Sequence
-
-.. The rev function returns the elements of a sequence in reverse order. For example, the expression $(rev a "b c" d) evaluates to d "b c" a. 
-
-``rev`` 関数は指定された配列の順番を逆にした配列を返します。例えば、式 ``$(rev a "b c" d)`` は ``d "b c" a`` と評価されます。
-
-.. index::
-   single: join()
-.. _label9.3.11:
-
-9.3.11 join
-^^^^^^^^^^^^^^^^^^^^^^^^^
-::
-
-   $(join sequence1, sequence2) : Sequence
-      sequence1 : Sequence
-      sequence2 : Sequence
-
-.. The join function joins together the elements of the two sequences. For example, $(join a b c, .c .cpp .h) evaluates to a.c b.cpp c.h. If the two input sequences have different lengths, the remainder of the longer sequence is copied at the end of the output unmodified. 
-
-``join`` 関数は二つのシーケンスの成分を互いに結合させます。例えば、 ``$(join a b c, .c .cpp .h)`` は ``a.c b.cpp c.h`` と評価されます。もし二つの入力シーケンスが異なる長さであった場合は、長いシーケンスの残りの成分は、出力先の配列の終わりに修正されない状態でコピーされます。
-
-.. index::
-   single: string()
-.. _label9.3.12:
-
-9.3.12 string
-^^^^^^^^^^^^^^^^^^^^^^^^^
-::
-
-   $(string sequence) : String
-      sequence : Sequence
-
-.. The string function flattens a sequence into a single string. This is similar to the concat function, but the elements are separated by whitespace. The result is treated as a unit; whitespace is significant. 
-
-``string`` 関数はシーケンスを一つの文字列にまとめます。これは ``concat`` 関数と似ていますが、この成分はホワイトスペースによって分割されています。結果は一つのユニットとして扱われます。ホワイトスペースは重要です。
-
-.. index::
-   single: string-length()
-.. _label9.3.13:
-
-9.3.13 string-length
-^^^^^^^^^^^^^^^^^^^^^^^^^
-::
-
-   $(string-length sequence) : Int
-      sequence : Sequence
-
-.. The string-lenght returns a length (number of characters) in its argument. If the argument is a sequence, it flattens it, so $(string-length sequence) is equivalent to $(string-length $(string sequence)).
-
-``string-length`` 関数は引数の文字列の長さを返します。もし引数がシーケンスであった場合、まとめられた状態で評価されます。よって、 ``$(string-length sequence)`` は ``$(string-length $(string sequence))`` と等価です。
-
-.. index::
-   single: string-escaped()
-   single: ocaml-escaped()
-   single: html-escaped()
-   single: html-pre-escaped()
-   single: c-escaped()
-   single: id-escaped()
-.. _label9.3.14:
-
-9.3.14 string-escaped, ocaml-escaped, html-escaped, html-pre-escaped, c-escaped, id-escaped
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-::
-
-   $(string-escaped sequence) : String Array
-   $(ocaml-escaped sequence) : String Array
-   $(html-escaped sequence) : String Array
-   $(html-pre-escaped sequence) : String Array
-   $(c-escaped sequence) : String Array
-   $(hex-escaped sequence) : StringArray
-      sequence : Array
-
-.. The string-escaped function converts each element of its argument to a string, escaping it, if it contains symbols that are special to OMake. The special characters include :()\,$'"# and whitespace. This function can be used in scanner rules to escape file names before printing then to stdout.
-
-.. The ocaml-escaped function converts each element of its argument to a string, escaping characters that are special to OCaml.
-
-``string-escaped`` 関数は引数の各々の成分を文字列に変換し、もしその成分がOMakeの特殊文字を含んでいた場合は、その文字をエスケープした状態で返します。特殊文字は ``:()\,$'"#`` とホワイトスペースを含みます。この関数はスキャナルール中で、 ``stdout`` に出力する前にファイル名をエスケープするために使われます。
-
-.. The c-escaped function converts a string to a form that can be used as a string constant in C.
-
-``ocaml-escaped`` 関数はOCamlの特殊文字をエスケープした状態で返します。
-
-.. The id-escaped function turns a string into an identifier that may be used in OMake.
-
-``c-escaped`` 関数はCの文字定数に使われるような形の文字列に変換します。
-
-.. The id-escaped function turns a string into an identifier that may be used in OMake.
-
-``id-escaped`` 関数はOMakeで使われるような識別子に変換します。
-
-.. The html-escaped function turns a literal string into a form acceptable as HTML. The html-pre-escaped function is similar, but it does not translate newlines into <br>.
-
-``html-escaped`` 関数はHTMLで文字通りに読み込まれるような形の文字列に変換します。 ``html-pre-escaped`` 関数と似ていますが、この関数では改行は ``<br>`` に変換されません。 ::
-
-    println($(string $(string-escaped $"a b" $"y:z")))
-    a\ b y\:z
-
-.. index::
-   single: decode-uri()
-   single: encode-uri()
-.. _label9.3.15:
-
-9.3.15 decode-uri, encode-uri
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-::
-
-    $(decode-uri sequence) : sequence
-        sequence : Sequence
-
-.. These two functions perform URI encoding, where special characters are represented by hexadecimal characters.
-
-これら二つの関数はURIのエンコーディングに用いられ、特殊文字を16進数の文字に置き換えます。 ::
-
-    osh> s = $(encode-uri $'a b~c')
-    "a+b%7ec"
-    osh> decode-uri($s)
-    "a b~c"
-
-.. index::
-   single: quote()
-.. _label9.3.16:
-
-9.3.16 quote
-^^^^^^^^^^^^^^^^^^^^^^^^^
-::
-
-   $(quote sequence) : String
-      sequence : Sequence
-
-.. The quote function flattens a sequence into a single string and adds quotes around the string. Inner quotation symbols are escaped.
-
-``quote`` 関数はシーケンスを一つの文字列にまとめ、さらに文字列にクオートを付与します。内部のクオーテーションはエスケープされます。
-
-.. For example, the expression $(quote a "b c" d) evaluates to "a \"b c\" d", and $(quote abc) evaluates to "abc". 
-
-例えば、式 ``$(quote a "b c" d)`` は ``"a \"b c\" d"`` に、 ``$(quote abc)`` は ``"abc"`` に評価されます。
-
-.. index::
-   single: quote-argv()
-.. _label9.3.17:
-
-9.3.17 quote-argv
-^^^^^^^^^^^^^^^^^^^^^^^^^
-::
-
-   $(quote-argv sequence) : String
-      sequence : Sequence
-
-.. The quote-argv function flattens a sequence into a single string, and adds quotes around the string. The quotation is formed so that a command-line parse can separate the string back into its components.
-
-``quote-argv`` 関数はシーケンスを一つの文字列にまとめ、さらに文字列にクオートを付与します。クオーテーションは変換されるため、コマンドラインのパーサは、正常に文字列をその構成要素へと戻すことができます。
-
-.. index::
-   single: html-string()
-.. _label9.3.18:
-
-9.3.18 html-string
-^^^^^^^^^^^^^^^^^^^^^^^^^
-::
-
-   $(html-string sequence) : String
-      sequence : Sequence
-
-.. The html-string function flattens a sequence into a single string, and escaped special HTML characters. This is similar to the concat function, but the elements are separated by whitespace. The result is treated as a unit; whitespace is significant. 
-
-``html-string`` 関数はシーケンスを一つの文字列にまとめ、さらに特殊なHTML文字にエスケープします。 ``concat`` 関数と似ていますが、この関数はホワイトスペースで分割を行います。結果は一つの文字列として返されます。
-
-.. index::
-   single: addsuffix()
-.. _label9.3.19:
-
-9.3.19 addsuffix
-^^^^^^^^^^^^^^^^^^^^^^^^^
-::
-
-   $(addsuffix suffix, sequence) : Array
-      suffix : String
-      sequence : Sequence
-
-.. The addsuffix function adds a suffix to each component of sequence. The number of elements in the array is exactly the same as the number of elements in the sequence.
-
-``addsuffix`` 関数はシーケンスの各々の成分に接尾辞を付与します。返される配列の長さは、指定されたシーケンスの配列の長さと全く同じです。
-
-.. For example, $(addsuffix .c, a b "c d") evaluates to a.c b.c "c d".c. 
-
-例えば、 ``$(addsuffix .c, a b "c d")`` は ``a.c b.c "c d".c`` と評価されます。
-
-.. index::
-   single: mapsuffix()
-.. _label9.3.20:
-
-9.3.20 mapsuffix
-^^^^^^^^^^^^^^^^^^^^^^^^^
-::
-
-   $(mapsuffix suffix, sequence) : Array
-      suffix : value
-      sequence : Sequence
-
-.. The mapsuffix function adds a suffix to each component of sequence. It is similar to addsuffix, but uses array concatenation instead of string concatenation. The number of elements in the array is twice the number of elements in the sequence.
-
-``mapsuffix`` 関数はシーケンスの各々の成分に接尾辞を付与します。これは ``addsuffix`` 関数と似ていますが、この関数は文字列をくっ付ける代わりに新しく成分を追加します。よって、返される配列の長さは、指定されたシーケンスの配列の長さの2倍です。
-
-.. For example, $(mapsuffix .c, a b "c d") evaluates to a .c b .c "c d" .c. 
-
-例えば、 ``$(mapsuffix .c, a b "c d")`` は ``a .c b .c "c d" .c`` と評価されます。
-
-.. index::
-   single: addsuffixes()
-.. _label9.3.21:
-
-9.3.21 addsuffixes
-^^^^^^^^^^^^^^^^^^^^^^^^^
-::
-
-   $(addsuffixes suffixes, sequence) : Array
-      suffixes : Sequence
-      sequence : Sequence
-
-.. The addsuffixes function adds all suffixes in its first argument to each component of a sequence. If suffixes has n elements, and sequence has m elements, the the result has n * m elements.
-
-``addsuffixes`` 関数は最初の引数に指定されたすべての接尾辞をシーケンスの各々の成分に付与します。もし ``suffixes`` が ``n`` 個の成分を、 ``sequence`` が ``m`` 個の成分を持っていた場合、結果は ``n * m`` 個の成分を持ったシーケンスが返されます。
-
-.. For example, the $(addsuffixes .c .o, a b c) expressions evaluates to a.c a.o b.c b.o c.o c.a. 
-
-例えば、 ``$(addsuffixes .c .o, a b c)`` は ``a.c a.o b.c b.o c.c c.o`` と評価されます。
-
-.. index::
-   single: removeprefix()
-.. _label9.3.22:
-
-9.3.22 removeprefix
-^^^^^^^^^^^^^^^^^^^^^^^^^
-::
-
-   $(removeprefix prefix, sequence) : Array
-      prefix : String
-      sequence : Array
-
-.. The removeprefix function removes a prefix from each component of a sequence. 
-
-``removeprefix`` 関数はシーケンスの各々の成分から接頭辞を取り除きます。
-
-.. index::
-   single: removesuffix()
-.. _label9.3.23:
-
-9.3.23 removesuffix
-^^^^^^^^^^^^^^^^^^^^^^^^^
-::
-
-   $(removesuffix sequence) : Array
-      sequence : String
-
-.. The removesuffix function removes the suffixes from each component of a sequence.
-
-``removesuffix`` 関数はシーケンスの各々の成分から接尾辞(拡張子)を取り除きます。
-
-.. For example, $(removesuffix a.c b.foo "c d") expands to a b "c d". 
-
-例えば、 ``$(removesuffix a.c b.foo "c d")`` の結果は ``a b "c d"`` となります。
-
-.. index::
-   single: replacesuffixes()
-.. _label9.3.24:
-
-9.3.24 replacesuffixes
-^^^^^^^^^^^^^^^^^^^^^^^^^
-::
-
-   $(replacesuffixes old-suffixes, new-suffixes, sequence) : Array
-      old-suffixes : Sequence
-      new-suffixes : Sequence
-      sequence : Sequence
-
-.. The replacesuffixes function modifies the suffix of each component in sequence. The old-suffixes and new-suffixes sequences should have the same length.
-
-``replacesuffixes`` 関数はシーケンスの各々の成分の接尾辞(拡張子)を置き換えます。 ``old-suffixes`` と ``new-suffixes`` シーケンスは同じ長さである必要があります。
-
-.. For example, $(replacesuffixes .h .c, .o .o, a.c b.h c.z) expands to a.o b.o c.z. 
-
-例えば、 ``$(replacesuffixes .h .c, .o .o, a.c b.h c.z)`` の結果は ``a.o b.o c.z`` となります。
-
-.. index::
-   single: addprefix()
-.. _label9.3.25:
-
-9.3.25 addprefix
-^^^^^^^^^^^^^^^^^^^^^^^^^
-::
-
-   $(addprefix prefix, sequence) : Array
-      prefix : String
-      sequence : Sequence
-
-.. The addprefix function adds a prefix to each component of a sequence. The number of element in the result array is exactly the same as the number of elements in the argument sequence.
-
-``addprefix`` 関数はシーケンスの各々の成分に接頭辞を付与します。返される配列の長さは、指定されたシーケンスの配列の長さと全く同じです。
-
-.. For example, $(addprefix foo/, a b "c d") evaluates to foo/a foo/b foo/"c d". 
-
-例えば、 ``$(addprefix foo/, a b "c d")`` は ``foo/a foo/b foo/"c d"`` と評価されます。
-
-.. index::
-   single: mapprefix()
-.. _label9.3.26:
-
-9.3.26 mapprefix
-^^^^^^^^^^^^^^^^^^^^^^^^^
-::
-
-   $(mapprefix prefix, sequence) : Array
-      prefix : String
-      sequence : Sequence
-
-.. The mapprefix function adds a prefix to each component of a sequence. It is similar to addprefix, but array concatenation is used instead of string concatenation. The result array contains twice as many elements as the argument sequence.
-
-``mapprefix`` 関数はシーケンスの各々の成分に接頭辞を付与します。これは ``addprefix`` 関数と似ていますが、この関数は文字列をくっ付ける代わりに新しく成分を追加します。よって、返される配列の長さは、指定されたシーケンスの配列の長さの2倍です。
-
-.. For example, $(mapprefix foo, a b "c d") expands to foo a foo b foo "c d".
-
-例えば、 ``$(mapprefix foo, a b "c d")`` の結果は ``foo a foo b foo "c d"`` となります。
-
-.. index::
-   single: add-wrapper()
-.. _label9.3.27:
-
-9.3.27 add-wrapper
-^^^^^^^^^^^^^^^^^^^^^^^^^
-::
-
-   $(add-wrapper prefix, suffix, sequence) : Array
-      prefix : String
-      suffix : String
-      sequence : Sequence
-
-.. The add-wrapper functions adds both a prefix and a suffix to each component of a sequence. For example, the expression $(add-wrapper dir/, .c, a b) evaluates to dir/a.c dir/b.c. String concatenation is used. The array result has the same number of elements as the argument sequence. 
-
-``add-wrapper`` 関数はシーケンスの各々の成分に接頭辞と接尾辞の両方を付与します。例えば、 ``$(add-wrapper dir/, .c, a b)`` は ``dir/a.c dir/b.c`` と評価されます。文字列は結合されるため、返される配列の長さは、指定されたシーケンスの長さと全く同じです。
-
-.. index::
-   single: set()
-.. _label9.3.28:
-
-9.3.28 set
-^^^^^^^^^^^^^^^^^^^^^^^^^
-::
-
-   $(set sequence) : Array
-      sequence : Sequence
-
-.. The set function sorts a set of string components, eliminating duplicates.
-
-``set`` 関数は文字列の集合をソートします。さらに、重複した成分を除去します。
-
-.. For example, $(set z y z "m n" w a) expands to "m n" a w y z. 
-
-例えば、 ``$(set z y z "m n" w a)`` の結果は ``"m n" a w y z`` となります。
-
-.. index::
-   single: mem()
-.. _label9.3.29:
-
-9.3.29 mem
-^^^^^^^^^^^^^^^^^^^^^^^^^
-::
-
-   $(mem elem, sequence) : Boolean
-      elem : String
-      sequence : Sequence
-
-.. The mem function tests for membership in a sequence.
-
-``mem`` 関数はシーケンス中に指定した成分が含まれているかどうか調べます。
-
-.. For example, $(mem "m n", y z "m n" w a) evaluates to true, while $(mem m n, y z "m n" w a) evaluates to false. 
-
-例えば、 ``$(mem "m n", y z "m n" w a)`` は ``true`` と評価されて、一方で ``$(mem m n, y z "m n" w a)`` は ``false`` と評価されます。
-
-.. index::
-   single: intersection()
-.. _label9.3.30:
-
-9.3.30 intersection
-^^^^^^^^^^^^^^^^^^^^^^^^^
-::
-
-   $(intersection sequence1, sequence2) : Array
-      sequence1 : Sequence
-      sequence2 : Sequence
-
-.. The intersection function takes two arguments, treats them as sets of strings, and computes their intersection. The order of the result is undefined, and it may contain duplicates. Use the set function to sort the result and eliminate duplicates in the result if desired.
-
-``intersection`` 関数は指定された二つの集合の和をとります。返される配列の長さは不定であり、重複があればそれを含みます。もし結果をソートし、さらに重複を除きたい場合は ``set`` 関数を使ってください。
-
-.. For example, the expression $(intersection c a b a, b a) evaluates to a b a. 
-
-例えば、 ``$(intersection c a b a, b a)`` は ``a b a`` と評価されます。
-
-.. index::
-   single: intersects()
-.. _label9.3.31:
-
-9.3.31 intersects
-^^^^^^^^^^^^^^^^^^^^^^^^^
-::
-
-   $(intersects sequence1, sequence2) : Boolean
-      sequence1 : Sequence
-      sequence2 : Sequence
-
-.. The intersects function tests whether two sets have a non-empty intersection. This is slightly more efficient than computing the intersection and testing whether it is empty.
-
-``intersects`` 関数は二つの集合の和が空集合でないかどうか調べます。これは集合の和を計算し、空であるかどうか調べるよりも少しだけ効率的です。
-
-.. For example, the expression $(intersects a b c, d c e) evaluates to true, and $(intersects a b c a, d e f) evaluates to false. 
-
-例えば、 ``$(intersects a b c, d c e)`` は ``true`` と評価されて、 ``$(intersects a b c a, d e f)`` は ``false`` と評価されます。
-
-.. index::
-   single: set-diff()
-.. _label9.3.32:
-
-9.3.32 set-diff
-^^^^^^^^^^^^^^^^^^^^^^^^^
-::
-
-   $(set-diff sequence1, sequence2) : Array
-      sequence1 : Sequence
-      sequence2 : Sequence
-
-.. The set-diff function takes two arguments, treats them as sets of strings, and computes their difference (all the elements of the first set that are not present in the second one). The order of the result is undefined and it may contain duplicates. Use the set function to sort the result and eliminate duplicates in the result if desired.
-
-``set-diff`` 関数は二つの集合の差異を計算します。結果は ``sequence1`` には含まれるが ``sequence2`` には含まれていない成分からなる配列です。返される配列の長さは不定であり、重複があればそれを含みます。もし結果をソートし、さらに重複を除きたい場合は ``set`` 関数を使ってください。
-
-.. note::
-   訳注: この関数は集合論における ``f(A,B) = A - B`` と等価です。
-
-.. For example, the expression $(set-diff c a b a e, b a) evaluates to c e. 
-
-例えば、 ``$(set-diff c a b a e, b a)`` は ``c e`` と評価されます。
-
-.. index::
-   single: filter()
-.. _label9.3.33:
-
-9.3.33 filter
-^^^^^^^^^^^^^^^^^^^^^^^^^
-::
-
-   $(set-diff sequence1, sequence2) : Array
-      sequence1 : Sequence
-      sequence2 : Sequence
-
-.. The filter function picks elements from a sequence. The patterns is a non-empty sequence of patterns, each may contain one occurrence of the wildcard % character.
-
-``filter`` 関数はシーケンスから特定の成分を抜き出します。 ``patterns`` にはパターンを定義した、空でないシーケンスを指定します。また、パターンにはワイルドカード ``%`` を含めることができます。
-
-.. For example $(filter %.h %.o, a.c x.o b.h y.o "hello world".c) evaluates to x.o b.h y.o. 
-
-例えば、 ``$(filter %.h %.o, a.c x.o b.h y.o "hello world".c)`` は ``x.o b.h y.o`` と評価されます。
-
-.. index::
-   single: filter-out()
-.. _label9.3.34:
-
-9.3.34 filter-out
-^^^^^^^^^^^^^^^^^^^^^^^^^
-::
-
-   $(filter-out patterns, sequence) : Array
-      patterns : Sequence
-      sequence : Sequence
-
-.. The filter-out function removes elements from a sequence. The patterns is a non-empty sequence of patterns, each may contain one occurrence of the wildcard % character.
-
-``filter-out`` 関数はシーケンスから特定の成分を除去します。 ``patterns`` にはパターンを定義した、空でないシーケンスを指定します。また、パターンにはワイルドカード ``%`` を含めることができます。
-
-.. For example $(filter-out %.c %.h, a.c x.o b.h y.o "hello world".c) evaluates to x.o y.o. 
-
-例えば、 ``$(filter-out %.c %.h, a.c x.o b.h y.o "hello world".c)`` は ``x.o y.o`` と評価されます。
-
-.. index::
-   single: capitalize()
-.. _label9.3.35:
-
-9.3.35 capitalize
-^^^^^^^^^^^^^^^^^^^^^^^^^
-::
-
-   $(capitalize sequence) : Array
-      sequence : Sequence
-
-.. The capitalize function capitalizes each word in a sequence. For example, $(capitalize through the looking Glass) evaluates to Through The Looking Glass. 
-
-``capitalize`` 関数はシーケンスの各々の成分の単語を大文字化します。例えば、 ``$(capitalize through the looking Glass)`` は ``Through The Looking Glass`` と評価されます。
-
-.. index::
-   single: uncapitalize()
-.. _label9.3.36:
-
-9.3.36 uncapitalize
-^^^^^^^^^^^^^^^^^^^^^^^^^
-::
-
-   $(uncapitalize sequence) : Array
-      sequence : Sequence
-
-.. The uncapitalize function uncapitalizes each word in its argument.
-
-``uncapitalize`` 関数は引数に指定された各々の単語を小文字化します。
-
-.. For example, $(uncapitalize through the looking Glass) evaluates to through the looking glass. 
-
-例えば、 ``$(uncapitalize through the looking Glass)`` は ``through the looking glass`` と評価されます。
-
-.. index::
-   single: uppercase()
-.. _label9.3.37:
-
-9.3.37 uppercase
-^^^^^^^^^^^^^^^^^^^^^^^^^
-::
-
-   $(uppercase sequence) : Array
-      sequence : Sequence
-
-.. The uppercase function converts each word in a sequence to uppercase. For example, $(uppercase through the looking Glass) evaluates to THROUGH THE LOOKING GLASS. 
-
-``uppercase`` 関数はシーケンス中の文字すべてを大文字化します。例えば、 ``$(uppercase through the looking Glass)`` は ``THROUGH THE LOOKING GLASS`` と評価されます。
-
-.. index::
-   single: lowercase()
-.. _label9.3.38:
-
-9.3.38 lowercase
-^^^^^^^^^^^^^^^^^^^^^^^^^
-::
-
-   $(lowercase sequence) : Array
-      sequence : Sequence
-
-.. The lowercase function reduces each word in its argument to lowercase.
-
-``lowercase`` 関数はシーケンス中の文字すべてを小文字化します。
-
-.. For example, $(lowercase through tHe looking Glass) evaluates to through the looking glass. 
-
-例えば、 ``$(lowercase through tHe looking Glass)`` は ``through the looking glass`` と評価されます。
-
-.. index::
-   single: system()
-.. _label9.3.39:
-
-9.3.39 system
-^^^^^^^^^^^^^^^^^^^^^^^^^
-::
-
-   system(s)
-      s : Sequence
-
-.. The system function is used to evaluate a shell expression. This function is used internally by omake to evaluate shell commands.
-
-``system`` 関数はシェル上のコマンドを評価するために用いられます。シェルコマンドを評価するため、omakeは内部でこの関数を使用しています。
-
-.. For example, the following program is equivalent to the expression system(ls foo).
-
-例えば、以下のプログラムは式 ``system(ls foo)`` と等価です。 ::
-
-   ls foo
-
-.. index::
-   single: shell()
-.. _label9.3.40:
-
-9.3.40 shell
-^^^^^^^^^^^^^^^^^^^^^^^^^
-::
-
-   $(shell command) : Array
-   $(shella command) : Array
-   $(shell-code command) : Int
-      command : Sequence
-
-.. The shell function evaluates a command using the command shell, and returns the whitespace-separated words of the standard output as the result.
-
-``shell`` 関数はシェルコマンドを用いてコマンドを評価し、さらに標準出力先に出力された、ホワイトスペースで区切ってある出力結果を返します。
-
-.. The shella function acts similarly, but it returns the lines as separate items in the array.
-
-``shella`` 関数は同様に振る舞いますが、この関数では改行をそのまま出力するのではなく、分割された配列として返します。
-
-.. The shell-code function returns the exit code. The output is not diverted.
-
-``shell-code`` は結果として終了コードを返します。出力は返されません。
-
-.. For example, if the current directory contains the files OMakeroot, OMakefile, and hello.c, then $(shell ls) evaluates to hello.c OMakefile OMakeroot (on a Unix system). 
-
-例えば、もしカレントディレクトリがファイル ``OMakeroot`` , ``OMakefile`` , ``hello.c`` を含んでいる場合、 ``$(shell ls)`` はUnixシステム上では ``hello.c OMakefile OMakeroot`` と評価されます。
-
-.. index::
-   single: export()
-.. _label9.3.41:
-
-9.3.41 export
-^^^^^^^^^^^^^^^^^^^^^^^^^
-.. The export function allows one to capture the current environment in a variable.
-
-``export`` 関数は現在の環境中の変数の値を保存します。
-
-.. For example, the following code will print 1 1 2.
-
-例えば、以下のコードは ``1 1 2`` と出力されます。 ::
-
-    A = 1
-    B = 1
-    C = 1
-    SAVE_ENV = $(export A B)
-    A = 2
-    B = 2
-    C = 2
-    export($(SAVE_ENV))
-    println($A $B $C)
-
-.. The arguments to this function are interpreted the exact same way as the arguments to the export special form (see Section 6.3). 
-
-この関数に引数を指定することは、 ``export`` 文を用いて引数を指定するのと全く等価なものとして解釈されます(詳細は ":ref:`label6.3`" を参照してください)。
-
-.. index::
-   single: while
-.. _label9.3.42:
-
-9.3.42 while
-^^^^^^^^^^^^^^^^^^^^^^^^^
-::
-
-   while <test>
-      <body>
-
-あるいは ::
-
-    while <test>
-    case <test1>
-       <body1>
-    ...
-    case <testn>
-       <bodyn>
-    default
-       <bodyd>
-
-.. The loop is executed while the test is true. In the first form, the <body> is executed on every loop iteration. In the second form, the body <bodyI> is selected, as the first case where the test <testI> is true. If none apply, the optional default case is evaluated. If no cases are true, the loop exits. The environment is automatically exported.
-
-``<test>`` が真である間はずっとループの式が実行されます。最初の形では、 ``<body>`` はすべてのループにおいて実行されます。二番目の形では、もし ``<testI>`` が真であった場合は ``<bodyI>`` が実行されます。もしなにも当てはまらない場合には ``<bodyd>`` が実行されます。もしすべての場合において真でなかったならば、ループは終了します。なお、ループ中の環境は自動的にエクスポートされます。
-
-.. Examples. Iterate for i from 0 to 9.
-
-例えば、 ``i`` を ``0`` から ``9`` まで繰り返します。 ::
-
-    i = 0
-    while $(lt $i, 10)
-       echo $i
-       i = $(add $i, 1)
-
-.. The following example is equivalent.
-
-上の例は以下の例と等価です。 ::
-
-   i = 0
-   while true
-   case $(lt $i, 10)
-      echo $i
-      i = $(add $i, 1)
-
-.. The following example is similar, but some special cases are printed. value is printed.
-
-以下の例は似ていますが、いくつかの特殊な場合においてある文字が出力されます。その他は値が出力されます。 ::
-
-    i = 0
-    while $(lt $i, 10)
-    case $(equal $i, 0)
-       echo zero
-    case $(equal $i, 1)
-       echo one
-    default
-       echo $i
-
-.. The break function can be used to break out of the while loop early.
-
-``break`` 関数は ``while`` ループを早期に抜けたい場合に用いられます。
-
-.. index::
-   single: break
-.. _label9.3.43:
-
-9.3.43 break
-^^^^^^^^^^^^^^^^^^^^^^^^^
-::
-
-   break
-
-.. Terminate execution of the innermost loop, returning the current state. 
-
-最も近いループから抜け出し、現在の状態を返します。
-
-.. index::
-   single: random()
-   single: random-init()
-.. _label9.3.44:
-
-9.3.44 random, random-init
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-::
-
-    random-init(i)
-        i : Int
-    random() : Int
-
-.. Produce a random number. The numbers are pseudo-random, and are not cryptographically secure.
-
-乱数を生成します。値は疑似乱数で、暗号として用いられるほどセキュアではありません。
-
-.. The generator is initialized form semi-random system data. Subsequent runs should produce different results. The rando-init function can be used to return the generator to a known state.
-
-乱数生成器はシステムの乱数器を用いて初期化します。よって、次にプログラムを実行したときの乱数の値は前回と異なります。 ``ramdom-init`` 関数は特定の値を用いて乱数生成器を初期化します。
-
-.. _label9.4:
-
-9.4 演算
-----------------------------------
-
-.. index::
-   single: int()
-.. _label9.4.1:
-
-9.4.1 int
-^^^^^^^^^^^^^^^^^^^^^^^^^
-.. The int function can be used to create integers. It returns an Int object.
-
-``int`` 関数は整数値を作るために用いられ、 ``Int`` オブジェクトを返します。 ::
-
-       $(int 17)
-
-.. index::
-   single: float()
-.. _label9.4.2:
-
-9.4.2 float
-^^^^^^^^^^^^^^^^^^^^^^^^^
-.. The float function can be used to create floating-point numbers. It returns a Float object.
-
-``float`` 関数は浮動小数点値を作るために用いられ、 ``Float`` オブジェクトを返します。 ::
-
-       $(float 3.1415926)
-
-.. index::
-   single: neg()
-   single: add()
-   single: sub()
-   single: mul()
-   single: div()
-   single: mod()
-   single: lnot()
-   single: land()
-   single: lor()
-   single: lxor()
-   single: lsl()
-   single: lsr()
-   single: asr()
-   single: min()
-   single: max()
-.. _label9.4.3:
-
-9.4.3 基本的な演算
-^^^^^^^^^^^^^^^^^^^^^^^^^
-.. The following functions can be used to perform basic arithmetic.
-
-以下の関数は基本的な数学の演算を行います。
-
-..  * $(neg <numbers>): arithmetic inverse
-    * $(add <numbers>): addition.
-    * $(sub <numbers>): subtraction.
-    * $(mul <numbers>): multiplication.
-    * $(div <numbers>): division.
-    * $(mod <numbers>): remainder.
-    * $(lnot <numbers>): bitwise inverse.
-    * $(land <numbers>): bitwise and.
-    * $(lor <numbers>): bitwise or.
-    * $(lxor <numbers>): bitwise exclusive-or.
-    * $(lsl <numbers>): logical shift left.
-    * $(lsr <numbers>): logical shift right.
-    * $(asr <numbers>): arithmetic shift right.
-    * $(min <numbers>): smallest element.
-    * $(max <numbers>): largest element. 
-
-* ``$(neg <numbers>)`` : 数学的な反転
-* ``$(add <numbers>)`` : 加算
-* ``$(sub <numbers>)`` : 減算
-* ``$(mul <numbers>)`` : 乗算
-* ``$(div <numbers>)`` : 除算
-* ``$(mod <numbers>)`` : 余り
-* ``$(lnot <numbers>)`` : ビット単位NOT
-* ``$(land <numbers>)`` : ビット単位AND
-* ``$(lor <numbers>)`` : ビット単位OR
-* ``$(lxor <numbers>)`` : ビット単位XOR
-* ``$(lsl <numbers>)`` : 論理左シフト
-* ``$(lsr <numbers>)`` : 論理右シフト
-* ``$(asr <numbers>)`` : 算術右シフト
-* ``$(min <numbers>)`` : 最も小さい成分
-* ``$(max <numbers>)`` : 最も大きい成分
-
-
-.. index::
-   single: lt()
-   single: le()
-   single: eq()
-   single: ge()
-   single: gt()
-   single: ult()
-   single: ule()
-   single: uge()
-   single: ugt()
-.. _label9.4.4:
-
-9.4.4 評価
-^^^^^^^^^^^^^^^^^^^^^^^^^
-.. The following functions can be used to perform numerical comparisons.
-
-以下の関数は数学的な評価を行います。
-
-..  * $(lt <numbers>): less then.
-    * $(le <numbers>): no more than.
-    * $(eq <numbers>): equal.
-    * $(ge <numbers>): no less than.
-    * $(gt <numbers>): greater than.
-    * $(ult <numbers>): unsigned less than.
-    * $(ule <numbers>): unsigned greater than.
-    * $(uge <numbers>): unsigned greater than or equal.
-    * $(ugt <numbers>): unsigned greater than. 
-
-* ``$(lt <numbers>)`` : ~より少ない (A < B)
-* ``$(le <numbers>)`` : ~以下 (A <= B)
-* ``$(eq <numbers>)`` : 等しい (A == B)
-* ``$(ge <numbers>)`` : ~以上 (A >= B)
-* ``$(gt <numbers>)`` : ~より多い (A > B)
-* ``$(ult <numbers>)`` : ~より少ない(符号なし)
-* ``$(ule <numbers>)`` : ~以下(符号なし)
-* ``$(uge <numbers>)`` : ~以上(符号なし)
-* ``$(ugt <numbers>)`` : ~より多い(符号なし)
-
-.. note::
-   訳注: ここでいう(符号なし)とは符号ビットを考慮しないで評価を行うことを表しています。例えば、int型とunsigned int型では同じビット数に対してそれぞれ表している数値が異なります。(符号なし)の演算子はこのような場合に用いられます。
-
-.. _label9.5:
-
-9.5 基本的な関数群
-----------------------------------
-
-.. index::
-   single: fun()
-.. _label9.5.1:
-
-9.5.1 fun
-^^^^^^^^^^^^^^^^^^^^^^^^^
-.. The fun form introduces anonymous functions.
-
-``fun`` 関数は匿名関数を生成します。 ::
-
-$(fun <v1>, ..., <vn>, <body>)
-
-.. The last argument is the body of the function. The other arguments are the parameter names.
-
-最後の引数には関数の内容を記述します。他の引数はパラメータ名を指定します。
-
-.. The three following definitions are equivalent.
-
-例えば、以下の3つの関数定義は等価です。 ::
-
-    F(X, Y) =
-       return($(addsuffix $(Y), $(X)))
-
-    F = $(fun X, Y, $(addsuffix $(Y), $(X)))
-
-    F =
-       fun(X, Y)
-          value $(addsuffix $(Y), $(X))
-
-.. index::
-   single: apply()
-.. _label9.5.2:
-
-9.5.2 apply
-^^^^^^^^^^^^^^^^^^^^^^^^^
-.. The apply operator is used to apply a function.
-
-``apply`` 関数は関数に値を適用します。 ::
-
-       $(apply <fun>, <args>)
-
-.. Suppose we have the following function definition.
-
-以下の関数定義を行った場合について考えてみましょう。 ::
-
-    F(X, Y) =
-       return($(addsuffix $(Y), $(X)))
-
-.. The the two expressions below are equivalent.
-
-以下の2つの式は等価です。 ::
-
-    X = F(a b c, .c)
-    X = $(apply $(F), a b c, .c)
-
-.. index::
-   single: applya()
-.. _label9.5.3:
-
-9.5.3 applya
-^^^^^^^^^^^^^^^^^^^^^^^^^
-.. The applya operator is used to apply a function to an array of arguments.
-
-``applya`` 関数は引数の配列を関数に適用します。 ::
-
-       $(applya <fun>, <args>)
-
-.. For example, in the following program, the value of Z is file.c.
-
-例えば、以下のプログラムでは ``Z`` の値は ``file.c`` となります。 ::
-
-    F(X, Y) =
-       return($(addsuffix $(Y), $(X)))
-    args[] =
-       file
-       .c
-    Z = $(applya $(F), $(args))
-
-.. index::
-   single: create-map()
-   single: create-lazy-map()
-.. _label9.5.4:
-
-9.5.4 create-map, create-lazy-map
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-.. The create-map is a simplified form for creating Map objects. The create-map function takes an even number of arguments that specify key/value pairs. For example, the following values are equivalent.
-
-``create-map`` 関数は簡単に ``Map`` オブジェクトを作る関数です。 ``create-map`` 関数はキー/値のペアを引数によって指定するので、引数の数は等しくなければなりません。例えば、以下の2つの式は等価です。 ::
-
-    X = $(create-map name1, xxx, name2, yyy)
-
-    X. =
-        extends $(Map)
-        $|name1| = xxx
-        $|name2| = yyy
-
-.. The create-lazy-map function is similar, but the values are computed lazily. The following two definitions are equivalent.
-
-``create-lazy-map`` 関数は ``create-map`` と似ていますが、この関数は値が遅延評価されます。例えば、以下の2つの式は等価です。 ::
-
-    Y = $(create-lazy-map name1, $(xxx), name2, $(yyy))
-
-    Y. =
-        extends $(Map)
-        $|name1| = $`(xxx)
-        $|name2| = $`(yyy)
-
-.. The create-lazy-map function is used in rule construction. 
-
-``create-lazy-map`` 関数はルールを生成する際に用いられます。
-
-.. _label9.6:
-
-9.6 イテレーションとマッピング
-----------------------------------
-
-.. index::
-   single: foreach()
-.. _label9.6.1:
-
-9.6.1 foreach
-^^^^^^^^^^^^^^^^^^^^^^^^^
-.. The foreach function maps a function over a sequence.
-
-``foreach`` 関数はシーケンスすべての成分にわたって関数を適用します。 ::
-
-    $(foreach <fun>, <args>)
-
-    foreach(<var>, <args>)
-       <body>
-
-.. For example, the following program defines the variable X as an array a.c b.c c.c.
-
-例えば、以下のプログラムでは変数 ``X`` は配列 ``a.c b.c c.c`` と定義されます。 ::
-
-    X =
-       foreach(x, a b c)
-          value $(x).c
-
-    # 等価な式
-    X = $(foreach $(fun x, $(x).c), abc)
-
-.. There is also an abbreviated syntax.
-
-これらの表現を省略することもできます。
-
-.. The export form can also be used in a foreach body. The final value of X is a.c b.c c.c.
-
-``export`` 文は ``foreach`` の内容に使うこともできます。例えば、以下の式の ``X`` は最終的に ``a.c b.c c.c`` となります。 ::
-
-    X =
-    foreach(x, a b c)
-       X += $(x).c
-       export
-
-.. The break function can be used to break out of the loop early. 
-
-``break`` 関数はこのようなループを早期に抜けたい場合に用いられます。
-
-.. _label9.7:
-
-9.7 ブーリアン関数群
-----------------------------------
-
-.. index::
-   single: sequence-forall()
-.. _label9.7.1:
-
-9.7.1 sequence-forall
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-.. The forall function tests whether a predicate halds for each element of a sequence.
-
-``forall`` 関数は ``<body>`` がシーケンスのすべての成分に当てはまっているかどうか調べます。 ::
-
-    $(sequence-forall <fun>, <args>)
-
-    sequence-forall(<var> => ..., <args>)
-       <body>
-
-.. index::
-   single: sequence-forall()
-.. _label9.7.2:
-
-9.7.2 sequence-exists
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-.. The exists function tests whether a predicate holds for some element of a sequence.
-
-``exists`` 関数は ``<body>`` がシーケンスのいくつかの成分に当てはまっているかどうか調べます。 ::
-
-    $(sequence-exists <fun>, <args>)
-
-    sequence-exists(<var> => ..., <args>)
-       <body>
-
-.. index::
-   single: sequence-sort()
-.. _label9.7.3:
-
-9.7.3 sequence-sort
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-.. The sort function sorts the elements in an array, given a comparison function. Given two elements (x, y), the comparison should return a negative number if x < y; a positive number if x > y; and 0 if x = y.
-
-``sort`` 関数は配列の成分を与えられた評価関数を元にソートします。評価関数は二つの引数(x, y)を取ります。もしx < yであった場合、評価関数は負の値を返す必要があります。同様に、x > yの場合は正の値、x = yの場合は0を返します。 ::
-
-    $(sequence-sort <fun>, <args>)
-
-    sort(<var>, <var> => ..., <args>)
-       <body>
-
-.. index::
-   single: compare()
-.. _label9.7.4:
-
-9.7.4 compare
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-.. The compare function compares two values (x, y) generically returning a negative number if x < y; a positive number if x > y; and 0 if x = y.
-
-``compare`` 関数は二つの値(x, y)を比較します。もしx < yであった場合、この関数は負の値を返します。同様に、x > yの場合は正の値、x = yの場合は0を返します。 ::
-
-    $(compare x, y) : Int
diff --git a/build-examples.rst b/build-examples.rst
deleted file mode 100644 (file)
index 26a1e77..0000000
+++ /dev/null
@@ -1,836 +0,0 @@
-.. 3-build-examples
-
-.. index::
-   single: OMakefile
-   single: OMakeroot
-   single: OSTYPE
-.. _label3:
-
-3. OMakeビルドサンプル
-==================================
-.. Let's explain the OMake build model a bit more. One issue that dominates this discussion is that OMake is based on global project analysis. That means you define a configuration for the entire project, and you run one instance of omake.
-
-この章ではOMakeのビルド体系をさらにもう少し解説します。この議論を決定するただ一つの結論としては、OMakeは全体のプロジェクト解析を元にしているということです。これはあなたがプロジェクト全体の設定を決めて、そしてOMakeのインスタンスを実行することを意味しています。
-
-.. For single-directory projects this doesn't mean much. For multi-directory projects it means a lot. With GNU make, you would usually invoke the make program recursively for each directory in the project. For example, suppose you had a project with some project root directory, containing a directory of sources src, which in turn contains subdirectories lib and main. So your project looks like this nice piece of ASCII art.
-
-一つのディレクトリで構成されたプロジェクトではあまり意味がないかもしれませんが、多数のディレクトリからなるプロジェクトでは大きな意味を持ちます。 ``GNU make`` では、あなたは通常、プロジェクトの各々のディレクトリにおいて ``make`` プログラムを再帰的に呼び出すでしょう。例えば、あなたが現在サブディレクトリ ``lib`` と ``main`` が入っているソースディレクトリ ``src`` を含んでいるプロジェクトをいくつか持っているものとしましょう。具体的には、あなたのプロジェクト構成は以下のアスキーアートのようになります。 ::
-
-    my_project/
-    |--> Makefile
-    `--> src/
-         |---> Makefile
-         |---> lib/
-         |     |---> Makefile
-         |     `---> source files...
-         `---> main/
-               |---> Makefile
-               `---> source files...
-
-.. Typically, with GNU make, you would start an instance of make in my_project/; this would in term start an instance of make in the src/ directory; and this would start new instances in lib/ and main/. Basically, you count up the number of Makefiles in the project, and that is the number of instances of make processes that will be created.
-
-一般的に ``GNU make`` では、初めに ``my_project/`` の ``make`` インスタンスを呼び出します。この ``make`` インスタンスは ``src/`` ディレクトリ内の ``make`` インスタンスを呼び出し、そして ``lib/`` と ``main/`` の新しいインスタンスを呼び出します。つまり、 ``GNU make`` では単純に、プロジェクト内の ``Makefile`` の数だけ ``make`` インスタンスが生成されることになります。
-
-.. The number of processes is no big deal with today's machines (sometimes contrary the the author's opinion, we no longer live in the 1970s). The problem with the scheme was that each make process had a separate configuration, and it took a lot of work to make sure that everything was consistent. Furthermore, suppose the programmer runs make in the main/ directory, but the lib/ is out-of-date. In this case, make would happily crank away, perhaps trying to rebuild files in lib/, perhaps just giving up.
-
-大量のプロセスを処理することは今日のコンピュータにとってさほど大きな問題ではありません(ときどき著者の意見に反対する人もいるようですが、私たちはもはや1970年代に住んでいるわけではないのです)。この構造に関する問題としては、各々の ``make`` プロセスの設定が分離されており、そしてそのすべてが調和のとれたものにするには、非常に多くの負担となってしまう点です。さらには、例えばプログラマが ``main/`` ディレクトリで ``make`` プログラムを実行するが、 ``lib/`` はもう時代遅れの代物であった場合を考えてみましょう。この場合、 ``make`` は楽しそうにあちこち曲がりくねった挙句、恐らく ``lib/`` 内のファイルをリビルドしようと奮起して、恐らく諦めることとなるでしょう。
-
-.. With OMake this changes entirely. Well, not entirely. The source structure is quite similar, we merely add some Os to the ASCII art.
-
-OMakeではこの構造を抜本的に変更します。とは言っても実際の変更点はそれほどありません。ソース構造は非常に似通っています。私たちは単純にいくつかの"O"を以下のアスキーアートのように加えただけです。 ::
-
-    my_project/
-    |--> OMakeroot   (or Root.om)
-    |--> OMakefile
-    `--> src/
-         |---> OMakefile
-         |---> lib/
-         |     |---> OMakefile
-         |     `---> source files...
-         `---> main/
-               |---> OMakefile
-               `---> source files...
-
-.. The role of each <dir>/OMakefile plays the same role as each <dir>/Makefile: it describes how to build the source files in <dir>. The OMakefile retains much of syntax and structure of the Makefile, but in most cases it is much simpler.
-
-各々の ``<dir>/OMakefile`` の役割は各々の ``<dir>/Makefile`` の役割と同様で、どのように ``<dir>`` のソースファイルをビルドするのかについて設定します。 ``OMakefile`` は ``Makefile`` の構造や構文を保持しておりますが、ほとんどの場合 ``make`` よりも簡単に記述することができます。
-
-.. One minor difference is the presence of the OMakeroot in the project root. The main purpose of this file is to indicate where the project root is in the first place (in case omake is invoked from a subdirectory). The OMakeroot serves as the bootstrap file; omake starts by reading this file first. Otherwise, the syntax and evaluation of OMakeroot is no different from any other OMakefile.
-
-一つ小さな違いがあるとすれば、プロジェクトのルートディレクトリに ``OMakeroot`` が存在している点です。このファイルの主な目的は、第一にプロジェクトのルートディレクトリがどこにあるか示すことです(omakeがサブディレクトリから呼び出されたときのためです)。 ``OMakeroot`` はブートストラップとして働きます。omakeはこのファイルを最初に読み込んで実行されます。それ以外では、 ``OMakeroot`` の構文と機能は他の ``OMakefile`` と全く同様です。
-
-.. The big difference is that OMake performs a global analysis. Here is what happens when omake starts.
-
-*大きな* 違いは、OMakeは *グローバルな* 解析を行うという点です。以下はどのようにomakeが動作するのかについて示します。
-
-..   1. omake locates that OMakeroot file, and reads it.
-     2. Each OMakefile points to its subdirectory OMakefiles using the .SUBDIRS target. For example, my_project/OMakefile has a rule,
-
-            .SUBDIRS: src
-
-        and the my_project/src/OMakefile has a rule,
-
-            .SUBDIRS: lib main
-
-        omake uses these rules to read and evaluate every OMakefile in the project. Reading and evaluation is fast. This part of the process is cheap.
-     3. Now that the entire configuration is read, omake determines which files are out-of-date (using a global analysis), and starts the build process. This may take a while, depending on what exactly needs to be done. 
-
-1. omakeは ``OMakeroot`` ファイルがあるディレクトリに移動し、読んでいきます。
-2. 各々の ``OMakefile`` は ``.SUBDIRS`` ターゲットを使用して ``OMakefile`` があるサブディレクトリを指し示します。例えば、 ``my_project/OMakefile`` は以下のルールを持っていたとします。 ::
-
-     .SUBDIRS: src
-
-  omakeはこれらのルールを読んで、プロジェクト内のすべての ``OMakefile`` を評価します。読み込みや評価は高速に行われるので、このプロセスは早期に終わります。
-
-3. 全体の設定が読まれたら、omakeはどのファイルが使われていないのかを決定し(グローバルな解析を使用します)、ビルド作業を開始します。これはどのファイルのビルドが実際に必要なのかに依存した、ビルド時間がかかります。
-
-.. There are several advantages to this model. First, since analysis is global, it is much easier to ensure that the build configuration is consistent–after all, there is only one configuration. Another benefit is that the build configuration is inherited, and can be re-used, down the hierarchy. Typically, the root OMakefile defines some standard boilerplate and configuration, and this is inherited by subdirectories that tweak and modify it (but do not need to restate it entirely). The disadvantage of course is space, since this is global analysis after all. In practice rarely seems to be a concern; omake takes up much less space than your web browser even on large projects.
-
-このモデルではいくつかの利点があります。初めに、解析をグローバルにしたことで、単一のビルド設定が用いられることとなり、ビルド設定を一定にするよう保証することがより簡単になるという点です。別の利点はビルドに関する設定が継承されて、再利用可能となり、さらに階層構造となる点です。概して、ルートの ``OMakefile`` はいくつかの標準的な決まり文句と設定を定義しており、これはサブディレクトリによって継承されて、調整したり、変更することができます(全体を書き換える必要はありません)。この方法の欠点は容量が増大することで、これは結局グローバルな解析を行っているためです。が、実際にはめったに考慮する必要があるようには見えません。OMakeは大きなプロジェクトにおいてでさえ、あなたが使っているウェブブラウザよりもはるかに小さい容量しか使いません。
-
-.. Some notes to the GNU/BSD make user. 
-
-GNU/BSDのmakeユーザは以下の点に留意してください。
-
-..    * OMakefiles are a lot like Makefiles. The syntax is similar, and there many of the builtin functions are similar. However, the two build systems are not the same. Some evil features (in the authors' opinions) have been dropped in OMake, and some new features have been added.
-      * OMake works the same way on all platforms, including Win32. The standard configuration does the right thing, but if you care about porting your code to multiple platforms, and you use some tricky features, you may need to condition parts of your build config on the $(OSTYPE) variable.
-      * A minor issue is that OMake dependency analysis is based on MD5 file digests. That is, dependencies are based on file contents, not file modification times. Say goodbye to false rebuilds based on spurious timestamp changes and mismatches between local time and fileserver time. 
-
-* OMakeは ``Makefile`` と同じくらい多くのファイルを作ります。構文は似ており、makeと同様に多くのビルドイン関数が用意されています。しかしながら、この2つのビルドシステムは同じではありません。OMakeではいくつかの酷い機能(これは著者の意見です)が外されており、それに代わって新しい機能が追加されています。
-* OMakeはWin32を含んだ、複数のプラットフォーム上で同様に動きます。あなたは複数のプラットフォーム上で動かすためにコードを変更したり、いくつかのトリッキーなテクを使ったり、 ``$(OSTYPE)`` 変数を使ってビルド設定を調節する必要はありません。
-* OMakeの依存関係の解析はMD5によるファイルの要約(digest)を元にしています。これはつまり、依存関係の解析はファイルの『修正日時』ではなくファイルの『内容』を元にしていることを表しています。さあ、ローカル日時とファイルサーバの日時から生じるミスマッチや、間違ったタイムスタンプの変更によるビルドミスからおさらばしましょう。
-
-.. index::
-   single: OMakeroot
-   single: OMakefile
-.. _label3.1:
-
-3.1  OMakeroot vs. OMakefile
-----------------------------------
-.. Before we begin with examples, let's ask the first question, “What is the difference between the project root OMakeroot and OMakefile?” A short answer is, there is no difference, but you must have an OMakeroot file (or Root.om file).
-
-さて、例を見せる前に、一つ質問をしてみましょう。それは「プロジェクトルートの ``OMakeroot`` と ``OMakefile`` の違いは何か?」というものです。その質問に関する端的な答えは「違いはないが、あなたは必ず ``OMakeroot`` ファイル(あるいは ``Root.om`` ファイル)を作らなければならない」です。
-
-.. However, the normal style is that OMakeroot is boilerplate and is more-or-less the same for all projects. The OMakefile is where you put all your project-specific stuff.
-
-しかしながら、通常の範囲で用いるならば ``OMakeroot`` は変更する必要のない決まり文句が並んでいるファイルであり、すべてのプロジェクトの ``OMakeroot`` は多かれ少なかれ同じような内容となるでしょう。
-
-.. To get started, you don't have to do this yourself. In most cases you just perform the following step in your project root directory.
-
-OMakeを始めるために、あなたがこのような決まり文句を入力する必要はありません。ほとんどの場合において、あなたは以下の手順をプロジェクトのルートディレクトリで実行するだけです。
-
-.. Run omake --install in your project root. 
-
-* ``omake --install`` をプロジェクトのルートで実行する。
-
-.. This will create the initial OMakeroot and OMakefile files that you can edit to get started.
-
-これで最初の ``OMakeroot`` と ``OMakefile`` が生成されて、編集できるようになりました。
-
-.. index::
-   single: DefineCommandVars()
-.. _label3.2:
-
-3.2  Cプロジェクトのサンプル
-------------------------------
-.. To begin, let's start with a simple example. Let's say that we have a full directory tree, containing the following files.
-
-OMakeを始めるために、まずは簡単なサンプルから始めてみましょう。いま私たちは以下のファイルを含んだディレクトリツリーを持っているものとします。 ::
-
-    my_project/
-    |--> OMakeroot
-    |--> OMakefile
-    `--> src/
-         |---> OMakefile
-         |---> lib/
-         |     |---> OMakefile
-         |     |---> ouch.c
-         |     |---> ouch.h
-         |     `---> bandaid.c
-         `---> main/
-               |---> OMakefile
-               |---> horsefly.c
-               |---> horsefly.h
-               `---> main.c
-
-.. Here is an example listing.
-
-以下は ``OMakeroot`` , ``OMakefile`` リストのサンプルです。 ::
-
-    my_project/OMakeroot:
-        # Cアプリケーションの標準的な設定をインクルード
-        open build/C
-        
-        # コマンドライン上の変数を処理
-        DefineCommandVars()
-        
-        # このディレクトリのOMakefileをインクルード
-        .SUBDIRS: .
-
-    my_project/OMakefile:
-        # 標準的なコンパイルオプションを設定
-        CFLAGS += -g
-
-        # srcディレクトリをインクルード
-        .SUBDIRS: src
-
-    my_project/src/OMakefile:
-        # あなたの好きなようにオプションを付け加えます
-        CFLAGS += -O2
-
-        # サブディレクトリをインクルード
-        .SUBDIRS: lib main
-
-    my_project/src/lib/OMakefile:
-        # 静的ライブラリとしてライブラリをビルドします。
-        # これはUnix/OSX上ではlibbug.aとして、
-        # Win32上ではlibbug.libとしてビルドされます。
-        # 引数にはソースファイルの拡張子を入れていないことに注意してください。
-        StaticCLibrary(libbug, ouch bandaid)
-
-    my_project/src/main/OMakefile:
-        # いくつかのファイルは../libディレクトリ上の
-        # .hファイルをインクルードしています。
-        INCLUDES += ../lib
-
-        # どのライブラリに対してリンクしたいのかを指定
-        LIBS[] +=
-            ../lib/libbug
-
-        # プログラムをビルドします。
-        # Win32上ではhorsefly.exe、
-        # Unix上ではhorseflyとしてビルドされます。
-        # 最初の引数はアプリケーション名を指定します。
-        # 二番目の引数はソースファイルの配列を指定します(拡張子は抜いてください)。
-        # これらの配列はビルドするプログラムの一部となります。
-        CProgram(horsefly, horsefly main)
-
-        # デフォルトでこのプログラムをビルドします
-        # (他の引数を指定しないでomakeが実行される場合です)。
-        # EXE変数はWin32上では.exeとして定義されていますが、
-        # 他のプラットフォーム上では空の変数です。
-        .DEFAULT: horsefly$(EXE)
-
-.. Most of the configuration here is defined in the file build/C.om (which is part of the OMake distribution). This file takes care of a lot of work, including: 
-
-ほとんどの設定は ``build/C.om`` (これはOMakeがもつ全機能の一部です)ファイルに定義されています。このファイルはほとんどの作業の面倒を見てくれます。具体的には、
-
-..    * Defining the StaticCLibrary and CProgram functions, which describe the canonical way to build C libraries and programs.
-      * Defining a mechanism for scanning each of the source programs to discover dependencies. That is, it defines .SCANNER rules for C source files. 
-
-* Cライブラリやプログラムを正当な方法でビルドするための、 ``StaticCLibrary`` と ``CProgram`` 関数を定義しています。
-* 依存関係を特定するために各々のソースコードを調べていくメカニズムを定義しています。これはつまり、Cソースファイルのための ``.SCANNER`` ルールを定義していることを意味しています。変数はサブディレクトリにも継承されていき、例えば、 ``src/main/OMakefile`` の ``CFLAGS`` 変数の値は ``"-g -O2"`` となります。
-
-.. index::
-   single: OCaml
-   single: OCamlLibrary()
-   single: OCamlProgram()
-.. _label3.3:
-
-3.3  OCamlプロジェクトのサンプル
-------------------------------------
-.. Let's repeat the example, assuming we are using OCaml instead of C. This time, the directory tree looks like this.
-
-前回のCの代わりにOCamlを使った状態で、簡単なサンプルを作ってみましょう。今回では、ディレクトリツリーは以下のようになります。 ::
-
-    my_project/
-    |--> OMakeroot
-    |--> OMakefile
-    `--> src/
-         |---> OMakefile
-         |---> lib/
-         |     |---> OMakefile
-         |     |---> ouch.ml
-         |     |---> ouch.mli
-         |     `---> bandaid.ml
-         `---> main/
-               |---> OMakefile
-               |---> horsefly.ml
-               |---> horsefly.mli
-               `---> main.ml
-
-.. The listing is only a bit different.
-
-``OMakeroot`` , ``OMakefile`` のリストは前回と少し異なります。 ::
-
-    my_project/OMakeroot:
-        # OCamlアプリケーションの標準的な設定をインクルード
-        open build/OCaml
-        
-        # コマンドライン上の変数を処理
-        DefineCommandVars()
-        
-        # このディレクトリのOMakefileをインクルード
-        .SUBDIRS: .
-
-    my_project/OMakefile:
-        # 標準的なコンパイルオプションを設定
-        OCAMLFLAGS += -Wa
-
-        # バイトコードのコンパイラを使いたいですか?
-        # それともネイティブコードのコンパイラを使いたいですか?
-        # 今回は両方とも使ってみましょう。
-        NATIVE_ENABLED = true
-        BYTE_ENABLED = true
-
-        # srcディレクトリをインクルード
-        .SUBDIRS: src
-
-    my_project/src/OMakefile:
-        # サブディレクトリをインクルード
-        .SUBDIRS: lib main
-
-    my_project/src/lib/OMakefile:
-        # ネイティブコードにおいて、積極的にインライン化を行う
-        OCAMLOPTFLAGS += -inline 10
-
-        # 静的ライブラリとしてライブラリをビルドします。
-        # これはUnix/OSX上ではlibbug.aとして、
-        # Win32上ではlibbug.libとしてビルドされます。
-        # 引数にはソースファイルの拡張子を入れていないことに注意してください。
-        OCamlLibrary(libbug, ouch bandaid)
-
-    my_project/src/main/OMakefile:
-        # いくつかのファイルは../libディレクトリ上の
-        # インターフェースに依存しています。
-        OCAMLINCLUDES += ../lib
-
-        # どのライブラリに対してリンクしたいのかを指定
-        OCAML_LIBS[] +=
-            ../lib/libbug
-
-        # プログラムをビルドします。
-        # Win32上ではhorsefly.exe、
-        # Unix上ではhorseflyとしてビルドされます。
-        # 最初の引数はアプリケーション名を指定します。
-        # 二番目の引数はソースファイルの配列を指定します(拡張子は抜いてください)。
-        # これらの配列はビルドするプログラムの一部となります。
-        OCamlProgram(horsefly, horsefly main)
-
-        # デフォルトでこのプログラムをビルドします
-        # (他の引数を指定しないでomakeが実行される場合です)。
-        # EXE変数はWin32上では.exeとして定義されていますが、
-        # 他のプラットフォーム上では空の変数です。
-        .DEFAULT: horsefly$(EXE)
-
-.. In this case, most of the configuration here is defined in the file build/OCaml.om. In this particular configuration, files in my_project/src/lib are compiled aggressively with the option -inline 10, but files in my_project/src/lib are compiled normally.
-
-この場合、ほとんどの設定は ``build/OCaml.om`` ファイルで定義されています。今回は特に、 ``my_project/src/lib`` ファイルを ``-inline 10`` オプションを用いて積極的にコンパイルするが、 ``my_project/src/lib`` は普通にコンパイルする設定となっています。
-
-.. _label3.4:
-
-3.4  新しい言語を扱う
-------------------------
-.. The previous two examples seem to be easy enough, but they rely on the OMake standard library (the files build/C and build/OCaml) to do all the work. What happens if we want to write a build configuration for a language that is not already supported in the OMake standard library?
-
-前回の二つのサンプルは十分簡単なように見えますが、これはOMakeの標準ライブラリ( ``build/C`` と ``/build/OCaml`` ファイル)がすべての仕事を行ってしまったためです。もし私たちがOMakeの標準ライブラリでサポートされていないような言語のビルド設定を書こうとしたら、一体どのようにすれば良いのでしょうか?
-
-.. For this example, let's suppose we are adopting a new language. The language uses the standard compile/link model, but is not in the OMake standard library. Specifically, let's say we have the following setup.
-
-例えば、私たちはOMakeに新しい言語を適用させているものとしましょう。この言語は標準的なコンパイル/リンクモデルを用いていますが、OMakeの標準ライブラリには存在していません。今回は問題をはっきりさせるため、以下のように動作する手順について考えてみましょう。
-
-..    * Source files are defined in files with a .cat suffix (for Categorical Abstract Terminology).
-      * .cat files are compiled with the catc compiler to produce .woof files (Wicked Object-Oriented Format).
-      * .woof files are linked by the catc compiler with the -c option to produce a .dog executable (Digital Object Group). The catc also defines a -a option to combine several .woof files into a library.
-      * Each .cat can refer to other source files. If a source file a.cat contains a line open b, then a.cat depends on the file b.woof, and a.cat must be recompiled if b.woof changes. The catc function takes a -I option to define a search path for dependencies. 
-
-* ``.cat`` 拡張子(Categorical Abstract Terminology)では複数あるファイルの中のソースファイルを定義します。
-* ``catc`` コンパイラを用いて ``.cat`` ファイルは ``.woof`` (Wicked Object-Oriented Format)ファイルにコンパイルされます。
-* ``.woof`` ファイルは実行可能な ``.dog`` (Digital Object Group)ファイルを生成するために、 ``-c`` オプションを用いた ``catc`` コンパイラによってリンクされます。 ``catc`` はまた ``-a`` オプションで、いくつかの ``.woof`` ファイルをライブラリに結合させることができます。
-* 各々の ``.cat`` ファイルは他のソースファイルに関連付けることができます。もしソースファイル ``a.cat`` が行 ``open b`` を含んでいたのなら、 ``a.cat`` は ``b.woof`` ファイルに依存しており、 ``a.cat`` は ``b.woof`` が変更されたときに再コンパイルしなければなりません。 ``catc`` 関数は ``-I`` オプションで依存関係を示した行を探索することができます。
-
-.. note::
-   訳注: これはcat, woof, dogにもじって作られた仮のソースコードであり、実際に存在しているわけではありません
-
-.. To define a build configuration, we have to do three things. 
-
-ビルド設定を定義するために、私たちは以下の3つの作業を行う必要があります。
-
-..   1. Define a .SCANNER rule for discovering dependency information for the source files.
-     2. Define a generic rule for compiling a .cat file to a .woof file.
-     3. Define a rule (as a function) for linking .woof files to produce a .dog executable. 
-
-1. 依存関係の情報をソースファイルから探索するための ``.SCANNER`` ルールを定義する。
-2. ``.cat`` ファイルを ``.woof`` ファイルにコンパイルするための普遍的なビルドルールを定義する。
-3. 実行可能な ``.dog`` ファイルを生成するために、 ``.woof`` ファイルをリンクするためのルールを一つの関数として定義する。
-
-.. Initially, these definitions will be placed in the project root OMakefile.
-
-初めに、これらの定義はプロジェクトルートの ``OMakefile`` に置くことになります。
-
-.. index::
-   single: 遅延評価変数
-   single: mapprefix()
-.. _label3.4.1:
-
-3.4.1  通常の編集ルールの定義
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-.. Let's start with part 2, defining a generic compilation rule. We'll define the build rule as an implicit rule. To handle the include path, we'll define a variable CAT_INCLUDES that specifies the include path. This will be an array of directories. To define the options, we'll use a lazy variable (Section 7.5). In case there are any other standard flags, we'll define a CAT_FLAGS variable.
-
-さて、パート2に移って、通常の編集ルールを定義していきましょう。今回私たちはビルドルールについて、ソースコードに直接ルールを定義することにします。まずはインクルードパスを扱うために、インクルードパスを指定した変数 ``CAT_INCLUDES`` を定義します。これはディレクトリが格納されている配列です。そしてオプションを定義するために、私たちは『遅延評価変数(lazy variable)(":ref:`label7.5`"を参照)』を使用します。この場合は他にも標準的なフラグが存在していますので、 ``CAT_FLAGS`` 変数も定義することにしましょう。 ::
-
-   # 私たちは今回CATC変数ををオーバーライドしたいので、catcコマンドを定義します
-   CATC = catc
-
-   # 通常のフラグは空にします
-   CAT_FLAGS =
-   
-   # インクルードパスの辞書(通常は空です)
-   INCLUDES[] =
-
-   # インクルードパスによるインクルードオプションを計算します
-   PREFIXED_INCLUDES[] = $`(mapprefix -I, $(INCLUDES))
-
-   # 通常の方法で.woofファイルをビルドします
-   %.woof: %.cat
-       $(CATC) $(PREFIXED_INCLUDES) $(CAT_FLAGS) -c $<
-
-.. note::
-   訳注: 今回の場合、 ``$`(mapprefix -I, $(INCLUDES))`` という表記法がまさに遅延評価に相当しています。 ``$`(v)`` は ``v`` を遅延評価するための表記法です。
-
-.. The final part is the build rule itself, where we call the catc compiler with the include path, and the CAT_FLAGS that have been defined. The $< variable represents the source file.
-
-最後の部分では、インクルードパスと前に定義されている ``CAT_FLAGS`` 変数を含んだ、 ``catc`` コンパイラを呼び出すというビルドルールを定義しています。 ``$<`` 変数はソースファイル名に置き換わります。
-
-.. index::
-   single: addsuffix()
-.. _label3.4.2:
-
-3.4.2  リンクするためのルールを定義
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-.. For linking, we'll define another rule describing how to perform linking. Instead of defining an implicit rule, we'll define a function that describes the linking step. The function will take two arguments; the first is the name of the executable (without suffix), and the second is the files to link (also without suffixes). Here is the code fragment.
-
-.woofファイルをリンクするために、どのようにビルド作業を行うのかについて記述した、別のルールを記述します。ここでソースに直接ルールを定義するかわりに、リンク作業を記述した関数を定義することにします。この関数は二つの引数をとり、最初の引数は実行ファイル名(拡張子なし)で、二つ目の引数はリンクするためのファイル名(これもまた拡張子はなし)を指定します。以下はコードの断片です。 ::
-
-    # 副次的なリンクオプション
-    CAT_LINK_FLAGS =
-
-    # どのように.dogプログラムをビルドするのかを定義した関数
-    CatProgram(program, files) =
-        # 拡張子を追加
-        file_names = $(addsuffix .woof, $(files))
-        prog_name = $(addsuffix .dog, $(files))
-
-        # ビルドルール
-        $(prog_name): $(file_names)
-            $(CATC) $(PREFIXED_INCLUDES) $(CAT_FLAGS) $(CAT_LINK_FLAGS) -o $@ $+
-
-        # プログラム名を返す
-        value $(prog_name)
-
-.. The CAT_LINK_FLAGS variable is defined just in case we want to pass additional flags specific to the link step. Now that this function is defined, whenever we want to define a rule for building a program, we simply call the rule. The previous implicit rule specifies how to compile each source file, and the CatProgram function specifies how to build the executable.
-
-``CAT_LINK_FLAGS`` 変数はちょうど私たちがリンク作業において、追加フラグを渡したいような場合に定義される変数です。さて、新しく関数が定義されましたので、私たちがプログラムをビルドするためのルールを定義したいと思った場合はいつでも、単純にこの関数を呼ぶだけで完了します。前回のような暗黙のルールを記述する場合ですと、どのように各々のソースファイルがコンパイルされるのかについていちいち指定する必要がありましたが、 ``CatProgram`` 関数はどのように実行ファイルをビルドするのか指定するだけで完了します。
-
-.. note::
-   訳注: ``$@`` , ``$+`` はそれぞれ『ターゲットの名前』と『依存ファイルのリスト』を表しています。詳細は ":ref:`label8`" を参照してください。
-
-::
-
-    # rover.dogプログラムをソースファイルneko.catとchat.catからビルドします。
-    # rover.dogは普通にコンパイルされます。
-    .DEFAULT: $(CatProgram rover, neko chat)
-
-.. index::
-   single: .SCANNER
-   single: 暗黙的な依存関係
-   single: 正規表現
-   single: find-in-path()
-   single: awk()
-.. _label3.4.3:
-
-3.4.3  依存関係の解析
-^^^^^^^^^^^^^^^^^^^^^^^^^
-.. That's it, almost. The part we left out was automated dependency scanning. This is one of the nicer features of OMake, and one that makes build specifications easier to write and more robust. Strictly speaking, it isn't required, but you definitely want to do it.
-
-これでほとんどの作業が終わりましたが、まだ依存関係の解析を自動的に行わせる部分が残っています。これはOMakeの利点の一つであり、さらにロバストで書きやすいビルド設定を作る手助けとなっています。厳密に言うと、この箇所は必要というわけではありませんが、あなたは切実にこの機能を欲しがっていると思います。
-
-.. The mechanism is to define a .SCANNER rule, which is like a normal rule, but it specifies how to compute dependencies, not the target itself. In this case, we want to define a .SCANNER rule of the following form.
-
-このメカニズムは通常のルールのように、 ``.SCANNER`` ルールを定義することで得られます。しかし ``.SCANNER`` ルールはどのように依存関係を解析するのかについて指定するのであって、ターゲット自身を指定しているわけではありません。私たちは以下のような形で ``.SCANNER`` ルールを定義したいものとします。 ::
-
-    .SCANNER: %.woof: %.cat
-        <commands>
-
-.. This rule specifies that a .woof file may have additional dependencies that can be extracted from the corresponding .cat file by executing the <commands>. The result of executing the <commands> should be a sequence of dependencies in OMake format, printed to the standard output.
-
-このルールでは、「 ``.woof`` ファイルは収集した ``.cat`` ファイルから、 ``<commands>`` を実行することで展開できる」という、新しい依存関係を追加することを指定しています。 ``<commands>`` の実行結果は、通常の端末で出力できる、OMake形式の依存関係の配列である必要があります。
-
-.. As we mentioned, each .cat file specifies dependencies on .woof files with an open directive. For example, if the neko.cat file contains a line open chat, then neko.woof depends on chat.woof. In this case, the <commands> should print the following line.
-
-すでに述べた通り、各々の ``.cat`` ファイルは ``open`` 構文を用いて、 ``.woof`` ファイルに依存していることを指定していたとします。例えば、もし ``neko.cat`` ファイルが行 ``open chat`` コマンドを含んでいたとするならば、 ``neko.woof`` ファイルは ``chat.woof`` ファイルに依存しています。この場合、 ``<commands>`` は以下の行を出力しなければなりません。 ::
-
-    neko.woof: chat.woof
-
-.. For an analogy that might make this clearer, consider the C programming language, where a .o file is produced by compiling a .c file. If a file foo.c contains a line like #include "fum.h", then foo.c should be recompiled whenever fum.h changes. That is, the file foo.o depends on the file fum.h. In the OMake parlance, this is called an implicit dependency, and the .SCANNER <commands> would print a line like the following.
-
-この類推は、 ``.o`` ファイルが ``.c`` ファイルをコンパイルすることで生成されるC言語について考えるとより明瞭になります。もしファイル ``foo.c`` が ``#include "fum.h"`` のような行を含んでいたとすると、 ``foo.c`` は ``fum.c`` が変更されたときはいつでも再コンパイルを行う必要があります。これはつまり、ファイル ``foo.o`` がファイル ``fum.h`` に依存していることを表しています。OMakeの用語では、このことを『暗黙的な依存関係(implicit dependency)』と呼んでおり、 ``.SCANNER <commands>`` は以下のような行を出力する必要があるでしょう。 ::
-
-    foo.o: fum.h
-
-.. Now, returning to the animal world, to compute the dependencies of neko.woof, we should scan neko.cat, line-by-line, looking for lines of the form open <name>. We could do this by writing a program, but it is easy enough to do it in omake itself. We can use the builtin awk function to scan the source file. One slight complication is that the dependencies depend on the INCLUDE path. We'll use the find-in-path function to find them. Here we go.
-
-それでは動物の世界へと戻ってみましょう。 ``neko.woof`` の依存関係を解析するために、私たちは一行一行 ``neko.cat`` ファイルをスキャンして、 ``open <name>`` のような形の構文を含んだ行を探す必要があります。私たちはこのようなプログラムを書かなければなりませんが、OMakeはこのような作業を簡略化することができます。この例ですと、ソースファイルをスキャンする ``awk`` 関数がビルドインで用意されているので、これを使ってみましょう。一つ難しいことがあるとするならば、それは依存関係が ``INCLUDE`` パスに依存していることです。そのためにOMakeでは探索するための ``find-in-path`` 関数を用意しています。それでは以下のように書いてみます。 ::
-
-    .SCANNER: %.woof: %.cat
-        section
-            # ファイルをスキャン
-            deps[] =
-            awk($<)
-            case $'^open'
-                deps[] += $2
-                export
-
-            # 重複を削除し、インクルードパスのファイルを探索する
-            deps = $(find-in-path $(INCLUDES), $(set $(deps)))
-
-            # 依存関係を出力
-            println($"$@: $(deps)")
-
-.. Let's look at the parts. First, the entire body is defined in a section because we are computing it internally, not as a sequence of shell commands.
-
-それでは上のソースコードを見てみましょう。初めに、全体の文はシェルコマンドのシーケンスとして扱われずに内部で計算されるよう、 ``section`` 文の中で定義されています。
-
-.. We use the deps variable to collect all the dependencies. The awk function scans the source file ($<) line-by-line. For lines that match the regular expression ^open (meaning that the line begins with the word open), we add the second word on the line to the deps variable. For example, if the input line is open chat, then we would add the chat string to the deps array. All other lines in the source file are ignored.
-
-今回私たちはすべての依存関係を集めるために、 ``deps`` 変数を用いました。 ``awk`` 関数はソースファイル ``($<)`` を一行一行スキャンしていきます。正規表現 ``^open`` (これはこの行が単語 ``open`` で始まることを表しています)が見つかった場合、 ``deps`` 変数に二番目の単語を追加します。具体的には、入力された行が ``open chat`` であった場合、 ``deps`` 配列に ``chat`` 文字列を追加することになります。ソースファイル中のその他すべての行は無視されます。
-
-.. Next, the $(set $(deps)) expression removes any duplicate values in the deps array (sorting the array alphabetically in the process). The find-in-path function then finds the actual location of each file in the include path.
-
-次に、 ``$(set $(deps))`` 文によって ``deps`` 配列の重複された文字列は削除されます(このとき、アルファベット順に配列をソートします)。 ``find-in-path`` 関数はインクルードパス中の各々のファイルの絶対パスを探索します。
-
-.. The final step is print the result as the string $"$@: $(deps)" The quotations are added to flatten the deps array to a simple string.
-
-最後に、文字列 ``$"$@: $(deps)"`` を結果として出力します。クオーテーションには ``deps`` 配列を単純な文字列に変換した状態で追加されます。
-
-.. _label3.4.4:
-
-3.4.4  まとめ
-^^^^^^^^^^^^^^^^^^^
-.. To complete the example, let's pull it all together into a single project, much like our previous example.
-
-例がすべて終わったので、この成果を一つのプロジェクトにまとめてみましょう。前回の例は以下のような構成とします。 ::
-
-    my_project/
-    |--> OMakeroot
-    |--> OMakefile
-    `--> src/
-         |---> OMakefile
-         |---> lib/
-         |     |---> OMakefile
-         |     |---> neko.cat
-         |     `---> chat.cat
-         `---> main/
-               |---> OMakefile
-               `---> main.cat
-
-.. The listing for the entire project is as follows. Here, we also include a function CatLibrary to link several .woof files into a library.
-
-この全体のプロジェクトのリストは以下のようになります。私たちはまたライブラリにいくつかの ``.woof`` ファイルをリンクさせるために、 ``CatLibrary`` 関数を定義していることに注意してください。 ::
-
-    my_project/OMakeroot:
-        # コマンドライン上の変数を処理
-        DefineCommandVars()
-        
-        # このディレクトリのOMakefileをインクルード
-        .SUBDIRS: .
-
-    my_project/OMakefile:
-       ########################################################################
-       # .catファイルをコンパイルするための標準設定
-       #
-
-       # 私たちは今回CATC変数ををオーバーライドしたいので、catcコマンドを定義します
-       CATC = catc
-
-       # 通常のフラグは空にします
-       CAT_FLAGS =
-       
-       # インクルードパスの辞書(通常は空です)
-       INCLUDES[] =
-
-       #  インクルードパスによるインクルードオプションを計算します
-       PREFIXED_INCLUDES[] = $`(mapprefix -I, $(INCLUDES))
-
-       # .catファイルの依存関係を解析するスキャナ
-       .SCANNER: %.woof: %.cat
-            section
-                # ファイルをスキャン
-                deps[] =
-                awk($<)
-                case $'^open'
-                    deps[] += $2
-                    export
-
-                # 重複を削除し、インクルードパスのファイルを探索する
-                deps = $(find-in-path $(INCLUDES), $(set $(deps)))
-
-                # 依存関係を出力
-                println($"$@: $(deps)")
-
-       # 通常の方法で.catファイルをコンパイルする
-       %.woof: %.cat
-           $(CATC) $(PREFIXED_INCLUDES) $(CAT_FLAGS) -c $<
-
-       # 副次的なリンクオプション
-       CAT_LINK_FLAGS =
-
-       # いくつかの.woofファイルを用いてライブラリをビルド
-       CatLibrary(lib, files) =
-           # 拡張子を追加
-           file_names = $(addsuffix .woof, $(files))
-           lib_name = $(addsuffix .woof, $(lib))
-
-           # ビルドルール
-           $(lib_name): $(file_names)
-               $(CATC) $(PREFIXED_INCLUDES) $(CAT_FLAGS) $(CAT_LINK_FLAGS) -a $@ $+
-
-           # プログラム名を返す
-           value $(lib_name)
-
-       # どのように.dogプログラムをビルドするのかを定義した関数
-       CatProgram(program, files) =
-           # 拡張子を追加
-           file_names = $(addsuffix .woof, $(files))
-           prog_name = $(addsuffix .dog, $(program))
-
-           # ビルドルール
-           $(prog_name): $(file_names)
-               $(CATC) $(PREFIXED_INCLUDES) $(CAT_FLAGS) $(CAT_LINK_FLAGS) -o $@ $+
-
-           # プログラム名を返す
-           value $(prog_name)
-
-       ########################################################################
-       # これで正しくプログラムが動きます
-       #
-
-       # srcサブディレクトリをインクルード
-       .SUBDIRS: src
-
-    my_project/src/OMakefile:
-       .SUBDIRS: lib main
-
-    my_project/src/lib/OMakefile:
-       CatLibrary(cats, neko chat)
-
-    my_project/src/main/OMakefile:
-       # ../libディレクトリからのインクルードを許可
-       INCLUDES[] += ../lib
-
-       # プログラムをビルド
-       .DEFAULT: $(CatProgram main, main ../cats)
-
-.. Some notes. The configuration in the project OMakeroot defines the standard configuration, including the dependency scanner, the default rule for compiling source files, and functions for building libraries and programs.
-
-注意点としては、 ``OMakeroot`` では依存関係の解析や、ソースファイルをコンパイルするための通常のルール、ライブラリやプログラムをビルドするいくつかの関数を含んだ、標準的な設定を定義しています。
-
-.. These rules and functions are inherited by subdirectories, so the .SCANNER and build rules are used automatically in each subdirectory, so you don't need to repeat them.
-
-これらのルールや関数はサブディレクトリに継承されていますので、 ``.SCANNER`` とビルドルールは自動的に各々のサブディレクトリに使われます。よってあなたはこれらを繰り返し記述する必要はありません。
-
-.. index::
-   single: OMAKEPATH
-.. _label3.4.5:
-
-3.4.5  終わりに
-^^^^^^^^^^^^^^^^^^
-.. At this point we are done, but there are a few things we can consider.
-
-これで一通りの作業は終わりましたが、まだ考慮すべき点はいくつか残っています。
-
-.. First, the rules for building cat programs is defined in the project OMakefile. If you had another cat project somewhere, you would need to copy the OMakeroot (and modify it as needed). Instead of that, you should consider moving the configuration to a shared library directory, in a file like Cat.om. That way, instead of copying the code, you could include the shared copy with an OMake command open Cat. The share directory should be added to your OMAKEPATH environment variable to ensure that omake knows how to find it.
-
-まず、 ``cat`` プログラムをビルドするためのルールはプロジェクトの ``OMakefile`` に定義しました。もしあなたがどこか別の ``cat`` プロジェクトを持っていたとすると、 ``OMakeroot`` をコピー(そしてもし必要ならば修正も)するかもしれません。その代わりに、あなたは設定ファイルを ``Cat.om`` のように名称を変更して、ライブラリの共有ディレクトリに移すべきです。これで、コードをコピーする代わりに、OMakeコマンド ``open Cat`` を用いてインクルードできるようになります。そのためには、あなたは共有ディレクトリを ``OMAKEPATH`` 環境変数に追加することで、omakeがどこを探せば良いのか分かるようにすべきです。
-
-.. Better yet, if you are happy with your work, consider submitting it as a standard configuration (by sending a request to omake@metaprl.org) so that others can make use of it too.
-
-もしあなたが満足する仕事をしたのなら、標準の設定となるようにあなたの設定ファイルを送ることを考えてみてください(``omake@metaprl.org`` 宛にリクエストを送ることで)。他の人の作業を省力化することになります。
-
-.. index::
-   single: .SUBDIRS
-   single: absname()
-.. _label3.5:
-
-3.5  階層構造、.SUBDIRSの内容を並列化させる
--------------------------------------------
-.. Some projects have many subdirectories that all have the same configuration. For instance, suppose you have a project with many subdirectories, each containing a set of images that are to be composed into a web page. Apart from the specific images, the configuration of each file is the same.
-
-いくつかのプロジェクトは同一の設定を有した、数多くのディレクトリで構成されているものです。例えば、あなたは現在サブディレクトリが多数あり、その各々がウェブページの画像の集合であるというプロジェクトを持っているものとしましょう。ある特定の画像を除いて、各々のファイルの設定は同一です。
-
-.. To make this more concrete, suppose the project has four subdirectories page1, page2, page3, and page4. Each contains two files image1.jpg and image2.jpg that are part of a web page generated by a program genhtml.
-
-この設定をより強固に構築するため、以下のような場合を考えます。まず、このプロジェクトは4つのサブディレクトリ ``page1, page2, page3, page4`` を含んでいるものとします。また、各々のサブディレクトリは二つのファイル ``image1.jpg, image2.jpg`` を含んでおり、それらはプログラム ``genhtml`` によって生成されるウェブページの一部であるとします。
-
-.. Instead of of defining a OMakefile in each directory, we can define it as a body to the .SUBDIRS command.
-
-各々のディレクトリ中に ``OMakefile`` を定義する代わりに、OMakeでは ``.SUBDIRS`` コマンドの内容として定義することができます。 ::
-
-    .SUBDIRS: page1 page2 page3 page4
-        index.html: image1.jpg image2jpg
-            genhtml $+ > $@
-
-.. The body of the .SUBDIRS is interpreted exactly as if it were the OMakefile, and it can contain any of the normal statements. The body is evaluated in the subdirectory for each of the subdirectories. We can see this if we add a statement that prints the current directory ($(CWD)).
-
-``.SUBDIRS`` の内容は、まるで ``OMakefile`` が内部にあるかのように正確にふるまい、通常の命令を任意の数だけ実行することができます。 ``.SUBDIRS`` の内容は各々のサブディレクトリの内部で評価されます。実際に何が行われているのかについては、現在のディレクトリ名を出力する命令 ``($(CWD))`` を追加することでより分かりやすくなるでしょう。 ::
-
-    .SUBDIRS: page1 page2 page3 page4
-        println($(absname $(CWD)))
-        index.html: image1.jpg image2jpg
-            genhtml $+ > $@
-  # 出力
-    /home/jyh/.../page1
-    /home/jyh/.../page2
-    /home/jyh/.../page3
-    /home/jyh/.../page4
-
-.. index::
-   single: glob()
-   single: ls()
-.. _label3.5.1:
-
-3.5.1  globパターンを扱う
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-.. Of course, this specification is quite rigid. In practice, it is likely that each subdirectory will have a different set of images, and all should be included in the web page. One of the easier solutions is to use one of the directory-listing functions, like glob or ls. The glob function takes a shell pattern, and returns an array of file with matching filenames in the current directory.
-
-もちろん、上述した指定は非常に強固なものとなっています。実際に、各々のサブディレクトリが異なった画像の集合であり、そのすべてがウェブページに含まれているような場合でも、記述方法は似ています。この問題に対するより簡単な解法の一つは、 ``glob`` や ``ls`` のようなディレクトリのリストを出力する関数を用いることです。 ``glob`` 関数はシェルのパターンを引数に持ち、現在のディレクトリ上でマッチしているファイル名の配列を返す関数です。 ::
-
-    .SUBDIRS: page1 page2 page3 page4
-        IMAGES = $(glob *.jpg)
-        index.html: $(IMAGES)
-            genhtml $+ > $@
-
-.. index::
-   single: include
-.. _label3.5.2:
-
-3.5.2  簡略化されたサブディレクトリの設定
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-.. Another option is to add a configuration file in each of the subdirectories that defines directory-specific information. For this example, we might define a file BuildInfo.om in each of the subdirectories that defines a list of images in that directory. The .SUBDIRS line is similar, but we include the BuildInfo file.
-
-別の方法は、各々のサブディレクトリ固有の情報を定義した設定ファイルを、それぞれのディレクトリに追加することです。例えば、私たちは現在、各々のサブディレクトリ中に、ディレクトリ内部にある画像のリストを定義した ``BuildInfo.om`` ファイルを設置しているものとします。 ``.SUBDIRS`` の行は似ていますが、 ``BuildInfo`` ファイルをインクルードしている点が異なっています。 ::
-
-    .SUBDIRS: page1 page2 page3 page4
-        include BuildInfo   # IMAGES変数を定義
-
-        index.html: $(IMAGES)
-            genhtml $+ > $@
-
-.. Where we might have the following configurations.
-
-それぞれの ``BuildInfo.om`` の内容は以下のようになっています。 ::
-
-   page1/BuildInfo.om:
-       IMAGES[] = image.jpg
-   page2/BuildInfo.om:
-       IMAGES[] = ../common/header.jpg winlogo.jpg
-   page3/BuildInfo.om:
-       IMAGES[] = ../common/header.jpg unixlogo.jpg daemon.jpg
-   page4/BuildInfo.om:
-       IMAGES[] = fee.jpg fi.jpg foo.jpg fum.jpg
-
-.. index::
-   single: subdirs()
-   single: find()
-   single: dirof()
-.. _label3.5.3:
-
-3.5.3  サブディレクトリのリストを計算
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-.. The other hardcoded specification is the list of subdirectories page1, ..., page4. Rather than editing the project OMakefile each time a directory is added, we could compute it (again with glob).
-
-現在、サブディレクトリのリスト ``page1, ... , page4`` は直接指定しています。他のディレクトリが追加される度に ``OMakefile`` を編集するよりも、( ``glob`` を用いて)計算させたほうがはるかに合理的です。 ::
-
-    .SUBDIRS: $(glob page*)
-        index.html: $(glob *.jpg)
-            genhtml $+ > $@
-
-.. Alternately, the directory structure may be hierarchical. Instead of using glob, we could use the subdirs function, returns each of the directories in a hierarchy. For example, this is the result of evaluating the subdirs function in the omake project root. The P option, passed as the first argument, specifies that the listing is “proper,” it should not include the omake directory itself.
-
-ディレクトリ構造が階層的である場合を考えてみましょう。その場合 ``glob`` 関数を用いる代わりに、階層的に各々のディレクトリを返す ``subdirs`` 関数を使います。例えば、以下はOMakeプロジェクトのルート上で ``subdirs`` 関数を評価した結果です。最初の引数として渡した ``P`` オプションでは、OMakeのディレクトリ自身を含んでいない、『適切な』リストを返すことを指定しています。 ::
-
-    osh> subdirs(P, .)
-    - : <array
-            /home/jyh/.../omake/mk : Dir
-            /home/jyh/.../omake/RPM : Dir
-            ...
-            /home/jyh/.../omake/osx_resources : Dir>
-
-.. Using subdirs, our example is now as follows.
-
-``subdirs`` を使用することで、上の例は以下のように表現できます。 ::
-
-    .SUBDIRS: $(subdirs P, .)
-        index.html: $(glob *.jpg)
-            genhtml $+ > $@
-
-.. In this case, every subdirectory will be included in the project.
-
-この場合ですと、プロジェクト中の *すべての* サブディレクトリが含まれることとなります。
-
-.. If we are using the BuildInfo.om option. Instead of including every subdirectory, we could include only those that contain a BuildInfo.om file. For this purpose, we can use the find function, which traverses the directory hierarchy looking for files that match a test expression. In our case, we want to search for files with the name BuildInfo.om. Here is an example call.
-
-私たちが ``BuildInfo.om`` オプションを使用する場合、すべてのサブディレクトリをインクルードする代わりに、 ``BuildInfo.om`` ファイルが含んであるディレクトリのみインクルードしたいと思うでしょう。これを実現するために、私たちはディレクトリを階層的に全走査し、特定の表現にマッチしたファイルを返す ``find`` 関数を使用します。この場合ですと、 ``BuildInfo.om`` という名前のファイルを探したいことになります。以下は ``find`` 関数を呼び出したサンプルです。 ::
-
-    osh> FILES = $(find . -name BuildInfo.om)
-    - : <array
-            /home/jyh/.../omake/doc/html/BuildInfo.om : File
-            /home/jyh/.../omake/src/BuildInfo.om : File
-            /home/jyh/.../omake/tests/simple/BuildInfo.om : File>
-    osh> DIRS = $(dirof $(FILES))
-    - : <array
-            /home/jyh/.../omake/doc/html : Dir
-            /home/jyh/.../omake/src : Dir
-            /home/jyh/.../omake/tests/simple : Dir>
-
-.. In this example, there are three BuildInfo.om files, in the doc/html, src, and tests/simple directories. The dirof function returns the directories for each of the files.
-
-この例では、プロジェクト中に3つの ``BuildInfo.om`` ファイルが ``doc/html, src, tests/simple`` ディレクトリに存在しています。また、 ``dirof`` 関数は各々のファイルのディレクトリを返します。
-
-.. Returning to our original example, we modify it as follows.
-
-先の例に戻って、私たちは以下のように修正することにしました。 ::
-
-    .SUBDIRS: $(dirof $(find . -name BuildInfo.om))
-        include BuildInfo   # IMAGES変数を定義
-
-        index.html: $(IMAGES)
-            genhtml $+ > $@
-
-.. index::
-   single: 一時的なディレクトリ
-   single: CREATE_SUBDIRS
-.. _label3.5.4:
-
-3.5.4  一時的なディレクトリ
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-.. Sometimes, your project may include temporary directories–directories where you place intermediate results. these directories are deleted whenever the project is cleanup up. This means, in particular, that you can't place an OMakefile in a temporary directory, because it will be removed when the directory is removed.
-
-時々、プロジェクトでは中間ファイルを置いておくための一時的なディレクトリが必要となる場合があります。これらの一時ディレクトリはプロジェクトがクリーンアップされたときはいつでも消去されます。これは特に、ディレクトリが消去されたら同ディレクトリの ``OMakefile`` も消去されるために、 ``OMakefile`` を一時的なディレクトリに置くべきではないことを意味しています。
-
-.. Instead, if you need to define a configuration for any of these directories, you will need to define it using a .SUBDIRS body.
-
-もしあなたがこれらのディレクトリに関する設定を行いたいのなら、あなたは ``OMakefile`` を設置する代わりに、 ``.SUBDIRS`` の内容について記述する必要があります。 ::
-
-    section
-        CREATE_SUBDIRS = true
-
-        .SUBDIRS: tmp
-            # MD5ハッシュを計算
-            %.digest: %.comments
-               echo $(digest $<) > $@
-
-            # ソースファイルからコメントを展開
-            %.comments: ../src/%.src
-               grep '^#' $< > $@
-
-            .DEFAULT: foo.digest
-
-    .PHONY: clean
-
-    clean:
-        rm -rf tmp
-
-.. In this example, we define the CREATE_SUBDIRS variable as true, so that the tmp directory will be created if it does not exist. The .SUBDIRS body in this example is a bit contrived, but it illustrates the kind of specification you might expect. The clean phony-target indicates that the tmp directory should be removed when the project is cleaned up.
-
-今回の例では、私たちは ``tmp`` ディレクトリが存在しない場合に新しくディレクトリを生成するため、 ``CREATE_SUBDIRS`` 変数を ``true`` に設定しました。 ``.SUBDIRS`` の内容は少々工夫してありますが、だいたいあなたが期待している通りに動作するはずです。 ``clean phony`` ターゲットでは、プロジェクトがクリーンアップされた場合は ``tmp`` ディレクトリが消去されるように指示しています。
diff --git a/build.rst b/build.rst
deleted file mode 100644 (file)
index 6574947..0000000
--- a/build.rst
+++ /dev/null
@@ -1,1741 +0,0 @@
-.. 13-build
-
-.. _label13:
-
-13. ビルド関数とユーティリティ
-==================================
-
-.. index::
-   single: .PHONY
-   single: .DEFAULT
-   single: .SUBDIRS
-   single: .SCANNER
-   single: .INCLUDE
-   single: .ORDER
-   single: .BUILD_BEGIN
-   single: .BUILD_SUCCESS
-   single: .BUILD_FAILURE
-.. _label13.1:
-
-13.1 ビルドイン .PHONY ターゲット
---------------------------------------
-.. The complete set of builtin .PHONY targets include the following.
-
-以下にビルドイン ``.PHONY`` ターゲットの完全なリストを示します。
-
-* **.PHONY**
-  
-  .. Declares new phony targets (Section 8.10). 
-  
-  新しいphonyターゲットを宣言します。(:ref:`label8.10`)
-
-* **.DEFAULT**
-  
-  .. Declare the default build targets (Section 8.7). 
-  
-  デフォルトのビルドターゲットを宣言します。(:ref:`label8.7`)
-
-* **.SUBDIRS**
-  
-  .. Include a directory as part of the project (Section 8.8). 
-  
-  プロジェクトの一部としてディレクトリをインクルードします。(:ref:`label8.8`)
-
-* **.SCANNER**
-  
-  .. Define a dependency scanner (Section 8.8). 
-  
-  依存関係のスキャナを定義します。(:ref:`label8.6`)
-
-* **.INCLUDE**
-  
-  .. Include a file (Section 8.9). 
-  
-  ファイルをインクルードします。(:ref:`label8.9`)
-
-* **.ORDER**
-  
-  .. Define a file-dependency ordering rule (Section 10.3.6).
-  
-  ファイルの依存関係ルールの順番を定義します。(:ref:`label10.3.6`)
-
-* **.BUILD_BEGIN**
-  
-  .. Commands to be executed at the beginning of a build. 
-  
-  ビルド開始時に実行されるコマンド
-
-* **.BUILD_SUCCESS**
-  
-  .. Commands to be executed if the build is successful. 
-  
-  ビルドが成功したときに実行されるコマンド
-
-* **.BUILD_FAILURE**
-  
-  .. Commands to be executed if the build fails. 
-  
-  ビルドが失敗したときに実行されるコマンド
-
-.. The .BUILD targets can be used to specify commands to be executed at the beginning and end of the build. The .BUILD_BEGIN target is built at the beginning of a project build, and one of .BUILD_FAILURE or .BUILD_SUCCESS is executed when the build terminates.
-
-``.BUILD`` ターゲットはビルドの開始と終了時に実行されるコマンドを指定するために用いられます。 ``.BUILD_BEGIN`` ターゲットはプロジェクトをビルドする前に実行されて、 ``.BUILD_FAILURE`` または ``.BUILD_SUCCESS`` はビルドが終了したときに実行されます。
-
-.. For example, the following set of rules simply print additional messages about the status of the build.
-
-例えば、以下のルールの集合はビルドの状況について、簡単なメッセージを表示します。 ::
-
-   .BUILD_BEGIN:
-       echo Build starting
-
-   .BUILD_SUCCESS:
-       echo The build was successful
-
-   .BUILD_FAILURE:
-       println($"The build failed: $(length $(find-build-targets Failed)) targets could not be built")
-
-.. Another common use is to define notifications to be performed when the build completes. For example, the following rule will create a new X terminal displaying the summary of the build (using the BUILD_SUMMARY variable).
-
-通常用いる別の使い方としては、ビルドが完了したときに通知するように定義するという方法があります。例えば、以下のルールでは(BUILD_SUMMARY変数を使うことで)ビルドの要約を新しいXターミナル上に表示します。 ::
-
-    .BUILD_FAILURE:
-        xterm -e vi $(BUILD_SUMMARY)
-
-.. If you do not wish to add these rules directly to your project (which is probably a good idea if you work with others), you can define them in your .omakerc (see Section A.8).
-
-あなたがプロジェクトに直接これらのルールを追加したくない場合(もしあなたが他の場所で実行するなら、これはよいアイデアです)、あなたはこれらのルールを ``.omakerc`` に定義することができます(詳細は :ref:`labelA.8` を参照してください)。
-
-.. The find-build-targets function is useful for obtaining a firther summary of the build. Note that when output diversions are in effect (with the --output-* options — see Chapter A), any output produced by the commands is copied to a file. The name of the file is specified by the output-file field of the Target object. You may find this useful in defining custom build summaries. 
-
-``find-build-targets`` 関数はさらに具体的なビルドの状況を取得したいときに有用です。 ``--output-*`` オプションを使って出力先を変更している場合、コマンドによって生成された出力はファイルにコピーされることに注意してください。ファイル名は ``Target`` オブジェクトの ``output-file`` フィールドによって指定されます。あなたはビルドの状況をカスタマイズしたいときに、この方法を試してみてください。
-
-.. _label13.2:
-
-13.2 オプションとバージョン管理
---------------------------------------
-
-.. index::
-   single: OMakeFlags()
-.. _label13.2.1:
-
-13.2.1 OMakeFlags
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-::
-
-   OMakeFlags(options)
-      options : String
-
-.. The OMakeFlags function is used to set omake options from within OMakefiles. The options have exactly the same format as options on the command line.
-
-``OMakeFlags`` 関数はOMakefileの内部で ``omake`` のオプションを設定したいときに用いられます。オプションはコマンドライン上でのオプション指定と全く同じフォーマットで指定します。
-
-.. For example, the following code displays the progress bar unless the VERBOSE environment variable is defined.
-
-例えば、以下のコードは ``VERBOSE`` 環境変数が定義されるまで、プログレスバーを表示し続けます。 ::
-
-    if $(not $(defined-env VERBOSE))
-        OMakeFlags(-S --progress)
-        export
-
-.. index::
-   single: OMakeVersion()
-.. _label13.2.2:
-
-13.2.2 OMakeVersion
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-::
-
-   OMakeVersion(version1)
-   OMakeVersion(version1, version2)
-      version1, version2 : String
-
-.. The OMakeVersion function is used for version checking in OMakefiles. It takes one or two arguments.
-
-``OMakeVersion`` 関数はOMakefileのバージョンをチェックするときに用いられます。この関数は1つ、または2つの引数を取ります。
-
-.. In the one argument form, if the omake version number is less than <version1>, then an exception is raised. In the two argument form, the version must lie between version1 and version2.
-
-1つの引数をとる形では、omakeのバージョン番号が ``<version1>`` よりも低いときに例外を送出します。2つ引数をとる形では、omakeのバージョン番号は ``version1`` と ``version2`` の間になければなりません。
-
-.. index::
-   single: cmp-versions()
-.. _label13.2.3:
-
-13.2.3 cmp-versions
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-::
-
-   $(cmp-versions version1, version2)
-      version1, version2 : String
-
-.. The cmp-versions\ functions can be used to compare arbitrary version strings. It returns 0 when the two version strings are equal, a negative number when the first string represents an earlier version, and a positive number otherwise. 
-
-``cmp-versions`` 関数は任意のバージョン文字列を比較することができます。2つのバージョン文字列が等しいときには、この関数は0を返します。一方で、最初の文字列が2番めよりも若いバージョンであるときには負の値を返し、そのいづれでもないときには正の値を返します。
-
-.. index::
-   single: DefineCommandVars()
-.. _label13.2.4:
-
-13.2.4 DefineCommandVars
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-::
-
-   DefineCommandVars()
-
-.. The DefineCommandVars function redefines the variables passed on the commandline. Variables definitions are passed on the command line in the form name=value. This function is primarily for internal use by omake to define these variables for the first time. 
-
-``DefineCommandVars`` 関数はコマンドライン上から受け渡した変数を再定義します。変数定義はコマンドラインから ``name=value`` の形で受け渡されます。この関数は、これらの変数を最初の時点で定義するため、omakeが内部で使用します。
-
-.. _label13.3:
-
-13.3 依存関係グラフの調査
---------------------------------------
-
-.. index::
-   single: dependencies()
-   single: dependencies-all()
-   single: dependencies-proper()
-.. _label13.3.1:
-
-13.3.1 dependencies, dependencies-all, dependencies-proper
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-::
-
-   $(dependencies targets) : File Array
-   $(dependencies-all targets) : File Array
-   $(dependencies-proper targets) : File Array
-      targets : File Array
-   raises RuntimeException
-
-.. The dependencies function returns the set of immediate dependencies of the given targets. This function can only be used within a rule body and all the arguments to the dependency function must also be dependencies of this rule. This restriction ensures that all the dependencies are known when this function is executed.
-
-``dependencies`` 関数は与えられたターゲットの明示的な依存関係の集合を返します。この関数はルールの本体だけに使うことができます。さらに、 ``dependency`` 関数のすべての引数は、このルールの依存先でなければいけません。この制約は、関数が実行されたときにすべての依存関係が解析されていることを保証してくれます。
-
-.. The dependencies-all function is similar, but it expands the dependencies recursively, returning all of the dependencies of a target, not just the immediate ones.
-
-``dependencies-all`` 関数は似ていますが、この関数は依存関係を再帰的に展開し、明示的な依存関係だけでなくターゲットの依存関係すべてを返してくれます。
-
-.. The dependencies-proper function returns all recursive dependencies, except the dependencies that are leaf targets. A leaf target is a target that has no dependencies and no build commands; a leaf target corresponds to a source file in the current project.
-
-``dependencies-proper`` 関数は『末端』となる依存先を除く、すべての依存関係を再帰的に返します。『末端』のターゲットは依存先やビルドコマンドが存在しないターゲット、つまり、現在のプロジェクト上にあるソースファイルの集合を指しています。
-
-.. In all three functions, files that are not part of the current project are silently discarded. All three functions will return phony and scanner targets along with the “real” ones.
-
-この3つの関数では、現在のプロジェクトの一部でないファイルは無視されます。また、3つの関数はすべて『実際のファイル』に関連しているphonyやscannerターゲットも返します。
-
-.. One purpose of the dependencies-proper function is for “clean” targets. For example, one way to delete all intermediate files in a build is with a rule that uses the dependencies-proper. Note however, that the rule requires building the project before it can be deleted.
-
-``dependencies-proper`` 関数を使う一つの目的としては"clean"ターゲットを実装することが挙げられます。例えば、ビルドしたすべての明示的なファイルを削除する一つの方法としては、 ``dependencies-proper`` をルール部分に使うことです。しかしながら、このルールでは消去する前にプロジェクトをビルドすることが必要となってきます。 ::
-
-    .PHONY: clean
-
-    APP = ...     # 対象となるアプリケーション名
-    clean: $(APP)
-       rm -f $(dependencies-proper $(APP))
-
-.. Also note that the dependencies-proper function will return the phony and scanner targets in addition to real one.
-
-``dependencies-proper`` 関数はまた、実際のファイルに加えてphonyやscannerターゲットも返してしまうことに注意してください。
-
-.. For other (possibly better) alternatives, see Section 10.3.3 and filter-proper-targets function. 
-
-(さらにより良く実装している)別のサンプルについては、 :ref:`label10.3.3` か ``filter-proper-targets`` 関数を参照してください。
-
-.. index::
-   single: target()
-.. _label13.3.2:
-
-13.3.2 target
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-::
-
-   $(target targets) : Target Array
-      targets : File Sequence
-   raises RuntimeException
-
-.. The target function returns the Target object associated with each of the targets. See the Target object for more information. 
-
-``target`` 関数はそれぞれのターゲットに関連しているTargetオブジェクトを返します。詳細な情報は ``Target`` オブジェクト( :ref:`label12.1.11` )を参照してください。
-
-.. index::
-   single: find-build-targets()
-.. _label13.3.3:
-
-13.3.3 find-build-targets
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-::
-
-    $(find-build-targets tag) : Target Array
-       tag : Succeeded | Failed
-
-.. The find-build-targets allow the results of the build to be examined. The tag must specifies which targets are to be returned; the comparison is case-insensitive.
-
-``find-build-targets`` はビルドの実行結果を返します。 ``tag`` では、どのターゲットを返すべきなのかについて指定します。結果は ``tag`` の場合によって異なります。
-
-* **Succeeded**
-  
-  .. The list of targets that were built successfully. 
-  
-  ビルドが成功したターゲットのリスト
-
-* **Failed**
-  
-  .. The list of targets that could not be built. 
-  
-  ビルドできなかったターゲットのリスト
-
-.. These are used mainly in conjuction with the .BUILD_SUCCESS (Section 13.1) and .BUILD_FAILURE (Section 13.1) phony targets. For example, adding the following to your project OMakefile will print the number of targets that failed (if the build failed).
-
-これらは主に ``.BUILD_SUCCESS`` や ``.BUILD_FAILURE`` phonyターゲットと一緒に使われます。例えば、あなたのプロジェクトの ``OMakefile`` に以下を加えることで、(ビルドが失敗したときに)失敗したターゲットの数を表示します。 ::
-
-    .BUILD_FAILURE:
-        echo "Failed target count: $(length $(find-build-targets Failed))"
-
-.. index::
-   single: project-directories()
-.. _label13.3.4:
-
-13.3.4 project-directories
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-::
-
-   $(project-directories) : Dir Array
-
-.. The project-directories function returns the list of all directories that are considered to be part of the project.
-
-``project-directories`` 関数はプロジェクトの一部であると考えられる、すべてのディレクトリのリストを返します。
-
-.. To get the complete directory list, this function should be called from within a rule body. 
-
-完全なディレクトリのリストを取得するためには、この関数をルールの本体で呼び出すべきです。
-
-.. index::
-   single: rule()
-.. _label13.3.5:
-
-13.3.5 rule
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-.. The rule function is called whenever a build rule is defined. It is unlikely that you will need to redefine this function, except in very exceptional cases.
-
-``rule`` 関数はビルドルールが定義されたときにいつでも呼び出されます。非常に特別なケースを除いて、あなたはこの関数を再定義すべきではありません。 ::
-
-   rule(multiple, target, pattern, sources, options, body) : Rule
-      multiple : String
-      target   : Sequence
-      pattern  : Sequence
-      sources  : Sequence
-      options  : Array
-      body     : Body
-
-.. The rule function is called when a rule is evaluated.
-
-``rule`` 関数はルールが評価されたときに呼び出されます。
-
-* **multiple**
-  
-  .. A Boolean value indicating whether the rule was defined with a double colon ::. 
-  
-  ルールがダブルコロン ``::`` を用いて定義されているかどうかを示しています。
-
-* **target**
-  
-  .. The sequence of target names. 
-  
-  ターゲット名のシーケンスです。
-
-* **pattern**
-  
-  .. The sequence of patterns. This sequence will be empty for two-part rules. 
-  
-  パターンのシーケンスです。このシーケンスは通常の2パートのルール定義のときには空となります。
-
-* **sources**
-  
-  .. The sequence of dependencies. 
-  
-  依存関係のシーケンスです。
-
-* **options**
-  
-  .. An array of options. Each option is represented as a Map object associating each specified option with a value. 
-  
-  オプションの配列です。各々のオプションは、オプション名と値が関連付けられている ``Map`` (辞書型の)オブジェクトとして表現されます。
-
-* **body**
-  
-  .. The body expression of the rule. 
-  
-  ルールの内容を表しています。
-
-.. Consider the following rule.
-
-以下のルールを考えてみましょう。 ::
-
-   target: pattern: sources :name1: option1 :name2: option2
-      expr1
-      expr2
-
-.. This expression represents the following function call, where square brackets are used to indicate arrays, and the curly brackets represent a Map object.
-
-上の式はまず以下の関数の呼び出しに置き換えられ、[]は配列を指定するために用いられ、さらに{}はMapオブジェクトに置き換わります。 ::
-
-   rule(false, target, pattern, sources,
-        { $|:name1:| = option1; $|:name2:| = option2 }
-        [expr1; expr2])
-
-.. index::
-   single: build()
-.. _label13.3.6:
-
-13.3.6 build
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-::
-
-    build(targets : File Array) : bool
-
-.. Build the given targets. The value is true iff the build was successful. This function can be used only in osh. 
-
-与えられたターゲットをビルドします。ビルドが成功した場合、この関数は真を返します。この関数は ``osh`` 上でのみ使うことができます。
-
-.. _label13.4:
-
-13.4 OMakerootファイル
---------------------------------------
-.. The standard OMakeroot file defines the functions are rules for building standard projects.
-
-標準のOMakerootファイルでは、普通のプロジェクトをビルドするためのルール関数を定義しています。
-
-.. index::
-   single: ROOT
-   single: CWD
-   single: EMPTY
-   single: STDROOT
-   single: ABORT_ON_COMMAND_ERROR
-   single: SCANNER_MODE
-.. _label13.4.1:
-
-13.4.1 変数
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-* **ROOT**
-  
-  .. The root directory of the current project. 
-  
-  現在のプロジェクトのルートディレクトリ
-
-* **CWD**
-  
-  .. The current working directory (the directory is set for each OMakefile in the project). 
-  
-  カレント作業ディレクトリ(このディレクトリは、プロジェクトにある各々のOMakefileの集合です)
-
-* **EMPTY**
-  
-  .. The empty string. 
-  
-  空文字列
-
-* **STDROOT**
-  
-  .. The name of the standard installed OMakeroot file. 
-  
-  標準でインストールされているOMakerootのファイル名
-
-* **ABORT_ON_COMMAND_ERROR**
-  
-  .. If set to true, the construction of a target should be aborted whenever one of the commands to build it fail. This defaults to true, and should normally be left that way.
-  
-  trueに設定した場合、たとえコマンドの一つがビルドに失敗したとしても、ターゲットはそれを無視します。デフォルトの値はtrueで、通常はそのままにしておくべきです。
-
-* **SCANNER_MODE**
-  
-  .. This variable should be defined as one of four values (defaults to enabled). 
-  
-  この変数は以下の4つの値のうちの1つを選んで定義する必要があります(デフォルトは ``enabled`` です)。
-  
-  * **enabled**
-    
-    .. Allow the use of default .SCANNER rules. Whenever a rule does not specify a :scanner: dependency explicitly, try to find a .SCANNER with the same target name. 
-    
-    デフォルトの ``.SCANNER`` ルールを使うことを許可します。たとえルールが明示的に ``:scanner:`` 依存関係を指定していなくても、omakeは同じ名前のターゲットから ``.SCANNER`` を検索します。
-  
-  * **disabled**
-    
-    .. Never use default .SCANNER rules. 
-    
-    デフォルトの ``.SCANNER`` ルールを使いません。
-  
-  * **warning**
-    
-    .. Allow the use of default .SCANNER rules, but print a warning whenever one is selected. 
-    
-    デフォルトの ``.SCANNER`` ルールを使うことを許可しますが、そのうちの一つを使うことになったとき、omakeは常に警告を表示します。
-  
-  * **error**
-    
-    .. Do not allow the use of default .SCANNER rules. If a rule does not specify a :scanner: dependency, and there is a default .SCANNER rule, the build will terminate abnormally. 
-    
-    デフォルトの ``.SCANNER`` ルールを使うことを許可しません。もしルールが明示的に ``:scanner:`` 依存関係をしておらず、さらにデフォルトの ``.SCANNER`` を使うことになったとき、このルールのビルドは異常終了します。
-
-.. index::
-   single: INSTALL
-   single: PATHSEP
-   single: DIRSEP
-   single: EXT_OBJ
-   single: EXT_LIB
-   single: EXT_DLL
-   single: EXT_ASM
-   single: EXE
-.. _label13.4.2:
-
-13.4.2 システム変数
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-.. The command to install a program (install on Unix, cp on Win32). 
-   The normal path separator (: on Unix, ; on Win32). 
-   The normal directory separator (/ on Unix, \ on Win32). 
-   File suffix for an object file (default is .o on Unix, and .obj on Win32).
-   File suffix for a static library (default is .a on Unix, and .lib on Win32). 
-   File suffix for a shared library (default is .so on Unix, and .dll on Win32).
-   File suffix for an assembly file (default is .s on Unix, and .asm on Win32).
-   File suffix for executables (default is empty for Unix, and .exe on Win32 and Cygwin).
-
-* **INSTALL** : プログラムをインストールするためのコマンド( ``Unix`` は ``install`` 、 ``Win32`` は ``cp``)
-* **PATHSEP** : 通常用いるパスのセパレータ( ``Unix`` は ``:`` 、 ``Win32`` は ``;``)
-* **DIRSEP** : 通常用いるディレクトリのセパレータ( ``Unix`` は ``/`` 、 ``Win32`` は ``\``)
-* **EXT_OBJ** : オブジェクトファイルの拡張子( ``Unix`` は ``.o`` 、 ``Win32`` は ``.obj``)
-* **EXT_LIB** : 静的ライブラリの拡張子( ``Unix`` は ``.a`` 、 ``Win32`` は ``.lib``)
-* **EXT_DLL** : 共有ライブラリの拡張子( ``Unix`` は ``.so`` 、 ``Win32`` は ``.dll``)
-* **EXT_ASM** : アセンブリファイルの拡張子( ``Unix`` は ``.s`` 、 ``Win32`` は ``.asm``)
-* **EXE** : 実行可能形式の拡張子( ``Unix`` は空文字列 、 ``Win32`` や ``Cygwin`` は ``.exe``)
-
-.. _label13.5:
-
-13.5 C/C++コードのビルド
---------------------------------------
-.. OMake provides extensive support for building C and C++ programs. In order to use the functions defined in this section, you need to make sure the line is present in your OMakeroot file.
-
-OMakeではCやC++のプログラムのビルドを広範囲にわたってサポートする機能を提供しています。このセクションで列挙している関数を使うためには、まずあなたの ``OMakeroot`` ファイルに、以下の一行を追加してください。 ::
-
-  open build/C
-
-.. _label13.5.1:
-
-13.5.1 自動設定変数(Autoconfiguration variables)
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-.. These variables will get defined based on the “autoconf-style” static. tests executed when you run OMake for the first time. You can use them to configure your project accordingly, and you should not redefine them.
-
-これらの変数はまず最初にOMakeを実行した時点でautoconfスタイルの ``static.`` が実行されて、その結果を元に決定されます。あなたのプロジェクトを調和の取れた状態にするためには、これらの変数を使用してください。また、あなたはこれらの変数を再定義すべきではありません。
-
-.. You can use the --configure command line option (Section A.3.9) to force re-execution of all the tests.
-
-あなたは強制的にすべてのテストを実行させるために、 ``--configure`` コマンドラインオプション( :ref:`labelA.3.9` を参照)を使うことができます。
-
-.. A different set of autoconfiguration tests is performed depending on the build environment involved — one set of tests would be performed in a Win32 environment, and another — in a Unix-like environment (including Linux, OS X and Cygwin).
-
-これらの自動設定変数の値はビルドする環境に依存します。これらの変数の一部は ``Win32`` の環境下と、(Linux, OS X, Cygwinを含む)Unixライクな環境下では異なるふるまいをします。
-
-.. index::
-   single: GCC_FOUND
-   single: GXX_FOUND
-.. _label13.5.1.1:
-
-13.5.1.1 Unixライクなシステム
-""""""""""""""""""""""""""""""""""""""
-.. A boolean flag specifying whether the gcc binary was found in your path. 
-   A boolean flag specifying whether the g++ binary was found in your path.
-
-* **GCC_FOUND** : ``gcc`` バイナリを発見したかどうかを示す真偽値
-* **GXX_FOUND** : ``g++`` バイナリを発見したかどうかを示す真偽値
-
-.. index::
-   single: CL_FOUND
-   single: LIB_FOUND
-.. _label13.5.1.2:
-
-13.5.1.2 Win32
-""""""""""""""""""""""""""""""""""""""
-.. A boolean flag specifying whether the cl binary was found in your path. 
-   A boolean flag specifying whether the lib binary was found in your path.
-
-* **CL_FOUND** : ``cl`` バイナリを発見したかどうかを示す真偽値
-* **LIB_FOUND** : ``lib`` バイナリを発見したかどうかを示す真偽値
-
-.. index::
-   single: CC
-   single: CXX
-   single: CPP
-   single: CFLAGS
-   single: CXXFLAGS
-   single: INCLUDES
-   single: LIBS
-   single: CCOUT
-   single: AS
-   single: ASFLAGS
-   single: ASOUT
-   single: AR
-   single: LD
-   single: LDFLAGS
-   single: LDFLAGS_DLL
-   single: LDOUT
-   single: YACC
-   single: LEX
-.. _label13.5.2:
-
-13.5.2 C/C++用の設定変数
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-.. The following variables can be redefined in your project.
-
-以下の変数があなたのプロジェクト上で定義されています。
-
-* **CC**
-  
-  .. The name of the C compiler (on Unix it defaults to gcc when gcc is present and to cc otherwise; on Win32 defaults to cl /nologo).
-  
-  Cコンパイラの名前( ``Unix`` では ``gcc`` が発見されたときはデフォルトの値として ``gcc`` が使われます。そうでない場合は ``cc`` が使われます。 ``Win32`` ではデフォルトの値は ``cl /nologo`` です。)
-
-* **CXX**
-  
-  .. The name of the C++ compiler (on Unix it defaults to gcc when gcc is present and to c++ otherwise; on Win32 defaults to cl /nologo). 
-  
-  C++コンパイラの名前( ``Unix`` では ``gcc`` が発見されたときはデフォルトの値として ``gcc`` が使われます。そうでない場合は ``c++`` が使われます。 ``Win32`` ではデフォルトの値は ``cl /nologo`` です。)
-
-* **CPP**
-  
-  .. The name of the C preprocessor (defaults to cpp on Unix, and cl /E on Win32). 
-  
-  Cプリプロセッサの名前( ``Unix`` ではデフォルトの値は ``cpp`` 、 ``Win32`` の場合は ``cl /E`` )
-
-* **CFLAGS**
-  
-  .. Compilation flags to pass to the C compiler (default empty on Unix, and /DWIN32 on Win32). 
-  
-  Cコンパイラに渡すコンパイルフラグ( ``Unix`` ではデフォルトの値は空文字列、 ``Win32`` の場合は ``/DWIN32`` )
-
-* **CXXFLAGS**
-  
-  .. Compilation flags to pass to the C++ compiler (default empty on Unix, and /DWIN32 on Win32). 
-  
-  C++コンパイラに渡すコンパイルフラグ( ``Unix`` ではデフォルトの値は空文字列、 ``Win32`` の場合は ``/DWIN32`` )
-
-* **INCLUDES**
-  
-  .. Additional directories that specify the search path to the C and C++ compilers (default is .). The directories are passed to the C and C++ compilers with the -I option. The include path with -I prefixes is defined in the PREFIXED_INCLUDES variable. 
-  
-  C/C++コンパイラに渡す、追加する検索パスを指定しているディレクトリの値(デフォルトの値は ``.`` )。これらのディレクトリは ``-I`` オプションを追加してC/C++コンパイラに受け渡されます。また、 ``-I`` 接頭辞を追加したインクルードパスは ``PREFIXED_INCLUDES`` 変数で定義されます。
-
-* **LIBS**
-  
-  .. Additional libraries needed when building a program (default is empty). 
-  
-  プログラムをビルドするときに必要となる追加ライブラリ(デフォルトの値は空文字列)
-
-* **CCOUT**
-  
-  .. The option to use for specifying the output file in C and C++ compilers (defaults to -o on Unix and /Fo on Win32). 
-  
-  C/C++コンパイラの出力ファイルの場所を指定するオプション( ``Unix`` ではデフォルトの値は ``-o`` 、 ``Win32`` の場合は ``/Fo`` )
-
-* **AS**
-  
-  .. The name of the assembler (defaults to as on Unix, and ml on Win32)
-  
-  アセンブラの名前( ``Unix`` ではデフォルトの値は ``as`` 、 ``Win32`` の場合は ``ml`` )
-
-* **ASFLAGS**
-  
-  .. Flags to pass to the assembler (default is empty on Unix, and /c /coff on Win32). 
-  
-  アセンブラに渡すフラグ( ``Unix`` ではデフォルトの値は空文字列、 ``Win32`` の場合は ``/c /coff`` )
-
-* **ASOUT**
-  
-  .. The option string that specifies the output file for AS (defaults to -o on Unix and /Fo on Win32). 
-  
-  ``AS`` の出力ファイルの場所を指定するオプション文字列( ``Unix`` ではデフォルトの値は ``-o`` 、 ``Win32`` の場合は ``/Fo`` )
-
-* **AR**
-  
-  .. The name of the program to create static libraries (defaults to ar cq on Unix, and lib on Win32). 
-  
-  静的ライブラリを生成するためのプログラム名( ``Unix`` ではデフォルトの値は ``ar cq`` 、 ``Win32`` の場合は ``lib`` )
-
-* **LD**
-  
-  .. The name of the linker (defaults to ld on Unix, and cl on Win32). 
-  
-  リンカの名前( ``Unix`` ではデフォルトの値は ``ld`` 、 ``Win32`` の場合は ``cl`` )
-
-* **LDFLAGS**
-  
-  .. Options to pass to the linker (default is empty). 
-  
-  リンカに渡すオプション(デフォルトの値は空文字列)
-
-* **LDFLAGS_DLL**
-  
-  .. Options to pass to the linker when compiling a shared library (defaults to -shared on Unix and /DLL on Win32). 
-  
-  共有ライブラリをコンパイルするときにリンカに受け渡すオプション( ``Unix`` ではデフォルトの値は ``-shared`` 、 ``Win32`` の場合は ``/DLL`` )
-
-* **LDOUT**
-  
-  .. The option to use for specifying the output file in C and C++ linkers (defaults to -o on Unix and /Fe on Win32).
-  
-  C/C++リンカが生成する出力ファイルの場所を指定するオプション( ``Unix`` ではデフォルトの値は ``-o`` 、 ``Win32`` の場合は ``/Fe`` )
-
-* **YACC**
-  
-  .. The name of the yacc parser generator (default is yacc on Unix, empty on Win32). 
-  
-  ``yacc`` パーサジェネレータの名前( ``Unix`` ではデフォルトの値は ``yacc`` 、 ``Win32`` の場合は空文字列)
-
-* **LEX**
-  
-  .. The name of the lex lexer generator (default is lex on Unix, empty on Win32). 
-  
-  ``lex`` レキサジェネレータの名前( ``Unix`` ではデフォルトの値は ``lex`` 、 ``Win32`` の場合は空文字列)
-
-.. _label13.5.3:
-
-13.5.3 Cファイルの生成
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-.. Because the C scanners do not normally know anything about generated source files (such as generated header files), these files may need to be created before running the scanner. 
-
-Cのスキャナは(生成されたヘッダファイルのような)生成されたソースファイルについては何も知りません。よって、これらのファイルはスキャナが実行される前に生成される必要があります。
-
-.. index::
-   single: CGeneratedFiles()
-   single: LocalCGeneratedFiles()
-.. _label13.5.3.1:
-
-13.5.3.1 CGeneratedFiles, LocalCGeneratedFiles
-""""""""""""""""""""""""""""""""""""""""""""""""""""
-::
-
-  CGeneratedFiles(files)
-  LocalCGeneratedFiles(files)
-
-.. The CGeneratedFiles and LocalCGeneratedFiles functions specify files that need to be generated before any C files are scanned for dependencies. For example, if config.h and inputs.h are both generated files, specify:
-
-``CGeneratedFiles`` と ``LocalCGeneratedFiles`` 関数は、Cファイルについての依存関係をスキャンする前に生成される必要があるファイルを指定します。例えば、 ``config.h`` と ``inputs.h`` が両方とも生成されるファイルである場合、以下のように指定します。 ::
-
-  CGeneratedFiles(config.h inputs.h)
-
-.. The CGeneratedFiles function is global — its arguments will be generated before any C files anywhere in the project are scanned for dependencies. The LocalCGeneratedFiles function follows the normal scoping rules of OMake.
-
-``CGeneratedFiles`` 関数は *グローバル* です。この関数で指定したファイルは、任意の場所にある任意のCファイルの依存関係をスキャンする前に生成されます。 ``LocalCGeneratedFiles`` 関数はOMakeの通常のスコープルールに従います。
-
-.. _label13.5.4:
-
-13.5.4 Cプログラムとライブラリをビルド
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-.. index::
-   single: StaticCLibrary()
-   single: DynamicCLibrary()
-   single: EXT_LIB
-   single: EXT_DLL
-   single: EXT_OBJ
-   single: CDLL_IMPLIES_STATIC
-.. _label13.5.4.1:
-
-13.5.4.1 StaticCLibrary, DynamicCLibrary
-"""""""""""""""""""""""""""""""""""""""""""""""
-.. The StaticCLibrary builds a static library and the DynamicCLibrary function builds a shared library (DLL).
-
-``StaticCLibrary`` は静的ライブラリをビルドし、 ``DynamicCLibrary`` 関数は共有ライブラリ(DLL)をビルドします。 ::
-
-  StaticCLibrary(<target>, <files>)
-  DynamicCLibrary(<target>, <files>)
-
-.. The <target> does not include the library suffix, and The <files> list does not include the object suffix. These are obtained from the EXT_LIB (EXT_DLL) and EXT_OBJ variables.
-
-``<target>`` にライブラリの拡張子は *含めません* 。また、同様にして ``<files>`` のリストにもオブジェクトの拡張子は含めません。これらの拡張子は ``EXT_LIB`` ( ``EXT_DLL`` )や ``EXT_OBJ`` 変数によって決定されます。
-
-.. This function returns the library filename.
-
-この関数はライブラリのファイル名を返します。
-
-.. The following command builds the library libfoo.a from the files a.o b.o c.o on Unix, or the library libfoo.lib from the files a.obj b.obj c.obj on Win32.
-
-以下のコマンドは ``Unix`` 上のファイル ``a.o b.o c.o`` からライブラリ ``libfoo.a`` をビルドします。あるいは、 ``Win32`` 上のファイル ``a.obj b.obj c.obj`` からライブラリ ``libfoo.lib`` をビルドします。 ::
-
-  StaticCLibrary(libfoo, a b c)
-  .DEFAULT: $(StaticCLibrary libbar, a b c d)
-
-**CDLL_IMPLIES_STATIC**
-
-.. If the CDLL_IMPLIES_STATIC variable is enabled (this is default on Win32), all the DynamicC functions would assume that creating a shared library automatically created a static one. 
-
-もし ``CDLL_IMPLIES_STATIC`` 変数が真である( ``Win32`` 上でこれはデフォルトの値です)ならば、すべての ``DynamicC`` 関数は共有ライブラリを自動的に生成し、さらに静的ライブラリを生成することを保障してくれます。
-
-.. index::
-   single: StaticCLibraryCopy()
-   single: DynamicCLibraryCopy()
-.. _label13.5.4.2:
-
-13.5.4.2 StaticCLibraryCopy, DynamicCLibraryCopy
-"""""""""""""""""""""""""""""""""""""""""""""""""""""
-.. The StaticCLibraryCopy and DynamicCLibraryCopy functions copy a library to an install location.
-
-``StaticCLibraryCopy`` と ``DynamicCLibraryCopy`` 関数はインストール先にライブラリをコピーします。 ::
-
-  StaticCLibraryCopy(<tag>, <dir>, <lib>)
-  DynamicCLibraryCopy(<tag>, <dir>, <lib>)
-
-.. The <tag> is the name of a target (typically a .PHONY target); the <dir> is the installation directory, and <lib> is the library to be copied (without the library suffix).
-
-``<tag>`` はターゲットの名前を指定します(大抵は ``.PHONY`` ターゲットです)。 ``<dir>`` はインストール先のディレクトリで、 ``<lib>`` はコピーするライブラリ(拡張子は除く)を指定します。
-
-.. This function returns the filename of the library in the target directory.
-
-この関数はターゲットディレクトリ内でのライブラリのファイル名を返します。
-
-.. For example, the following code copies the library libfoo.a to the /usr/lib directory.
-
-例えば、以下のコードではライブラリ ``libfoo.a`` を ``/usr/lib`` ディレクトリにコピーします。 ::
-
-  .PHONY: install
-
-  StaticCLibraryCopy(install, /usr/lib, libfoo)
-
-.. index::
-   single: StaticCLibraryInstall()
-   single: DynamicCLibraryInstall()
-.. _label13.5.4.3:
-
-13.5.4.3 StaticCLibraryInstall, DynamicCLibraryInstall
-"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
-.. The StaticCLibraryInstall and DynamicCLibraryInstall functions build a library, and set the install location in one step. Return the filename of the library in the target directory.
-
-``StaticCLibraryInstall`` と ``DynamicCLibraryInstall`` 関数はライブラリをビルドし、さらに出力先にインストール先を指定します。これらの関数はターゲットディレクトリ内でのライブラリのファイル名を返します。 ::
-
-  StaticCLibraryInstall(<tag>, <dir>, <libname>, <files>)
-  DynamicCLibraryInstall(<tag>, <dir>, <libname>, <files>)
-
-::
-
-  StaticCLibraryInstall(install, /usr/lib, libfoo, a b c)
-
-.. index::
-   single: StaticCObject()
-   single: StaticCObjectCopy()
-   single: StaticCObjectInstall()
-.. _label13.5.4.4:
-
-13.5.4.4 StaticCObject, StaticCObjectCopy, StaticCObjectInstall
-""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
-.. These functions mirror the StaticCLibrary, StaticCLibraryCopy, and StaticCLibraryInstall functions, but they build an object file (a .o file on Unix, and a .obj file on Win32).
-
-これらの関数は ``StaticCLibrary`` , ``StaticCLibraryCopy`` , ``StaticCLibraryInstall`` 関数と似ていますが、これらは *オブジェクト* ファイルをビルドします( ``Unix`` では ``.o`` ファイル、 ``Win32`` では ``.obj`` ファイル)。
-
-.. index::
-   single: CProgram()
-   single: CFLAGS
-   single: LDFLAGS
-   single: LIBS
-.. _label13.5.4.5:
-
-13.5.4.5 CProgram
-"""""""""""""""""""""""""
-.. The CProgram function builds a C program from a set of object files and libraries.
-
-``CProgram`` 関数はオブジェクトファイルやライブラリの集合からCプログラムをビルドします。 ::
-
-  CProgram(<name>, <files>)
-
-.. The <name> argument specifies the name of the program to be built; the <files> argument specifies the files to be linked. The function returns the filename of the executable.
-
-``<name>`` にはビルドするプログラムの名前を指定します。 ``<files>`` にはリンクするファイル名を指定します。この関数は実行可能なファイル名を返します。
-
-.. Additional options can be passed through the following variables. 
-
-オプションは以下の変数を受け渡すことで指定できます。
-
-.. Flags used by the C compiler during the link step. 
-   Flags to pass to the loader. 
-   Additional libraries to be linked.
-
-* **CFLAGS** : リンクする際にCコンパイラに受け渡すフラグ
-* **LDFLAGS** : ローダー(loader)に受け渡すフラグ
-* **LIBS** : リンクするための追加ライブラリ
-
-.. For example, the following code specifies that the program foo is to be produced by linking the files bar.o and baz.o and libraries libfoo.a.
-
-例えば、以下のコードはプログラム ``foo`` がファイル ``bar.o`` と ``baz.o`` 、そしてライブラリ ``libfoo.a`` をリンクすることによって生成します。 ::
-
-  section
-     LIBS = libfoo
-     LDFLAGS += -lbar
-     CProgram(foo, bar baz)
-
-.. index::
-   single: CProgramCopy()
-.. _label13.5.4.6:
-
-13.5.4.6 CProgramCopy
-""""""""""""""""""""""""""""""""""""""
-.. The CProgramCopy function copies a file to an install location.
-
-``CProgramCopy`` 関数はインストール先にファイルをコピーします。 ::
-
-  CProgramCopy(<tag>, <dir>, <program>)
-
-  CProgramCopy(install, /usr/bin, foo)
-
-.. index::
-   single: CProgramInstall()
-.. _label13.5.4.7:
-
-13.5.4.7 CProgramInstall
-""""""""""""""""""""""""""""""""""""""
-.. The CProgramInstall function specifies a program to build, and a location to install, simultaneously.
-
-``CProgramInstall`` 関数は同様にプログラムをビルドし、さらに出力先にインストール先を指定します。 ::
-
-  CProgramInstall(<tag>, <dir>, <name>, <files>)
-
-  section
-     LIBS = libfoo
-     LDFLAGS += -lbar
-     CProgramInstall(install, /usr/bin, foo, bar baz)
-
-.. index::
-   single: CXXProgram()
-   single: CXXProgramInstall()
-   single: CXX
-   single: CXXFLAGS
-.. _label13.5.4.8:
-
-13.5.4.8 CXXProgram, CXXProgramInstall
-""""""""""""""""""""""""""""""""""""""""""
-.. The CXXProgram and CXXProgramInstall functions are equivalent to their C counterparts, except that would use $(CXX) and $(CXXFLAGS) for linking instead of $(CC) and $(CFLAGS). 
-
-``CXXProgram`` と ``CXXProgramInstall`` 関数は ``$(CC)`` や ``$(CFLAGS)`` の代わりに ``$(CXX)`` と ``$(CXXFLAGS)`` を使う点を除いて、対応するCの関数と等価です。
-
-.. index::
-   single: StaticCXXLibrary()
-   single: StaticCXXLibraryCopy()
-   single: StaticCXXLibraryInstall()
-   single: DynamicCXXLibrary()
-   single: DynamicCXXLibraryCopy()
-   single: DynamicCXXLibraryInstall()
-.. _label13.5.4.9:
-
-13.5.4.9 StaticCXXLibrary, StaticCXXLibraryCopy, StaticCXXLibraryInstall, DynamicCXXLibrary, DynamicCXXLibraryCopy, DynamicCXXLibararyInstall
-""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
-.. Similarly, the six CXXLibrary functions the C++ equivalents of the corresponding CLibrary functions.
-
-同様にして、6つの ``CXXLibrary`` 関数は関連する ``CLibrary`` 関数と等価です。
-
-.. _label13.6:
-
-13.6 OCamlコードのビルド
---------------------------------------
-.. OMake provides extensive support for building OCaml code, including support for tools like ocamlfind, ocamlyacc and menhir. In order to use the functions defined in this section, you need to make sure the line
-
-OMakeではOCamlコードをビルドするための、広範的なサポートを提供しています。このサポートには ``ocamlfind`` 、 ``ocamlyacc`` 、 ``menhir`` のようなツールへのサポートも含まれています。このセクションで列挙している関数を使うためには、まずあなたの ``OMakeroot`` ファイルに、以下の一行を追加してください。 ::
-
-  open build/OCaml
-
-.. index::
-   single: OCAMLOPT_EXISTS
-   single: OCAMLFIND_EXISTS
-   single: OCAMLDEP_MODULES_AVAILABLE
-   single: MENHIR_AVAILABLE
-.. _label13.6.1:
-
-13.6.1 OCamlコンパイルに用いる自動設定用の変数
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-.. These variables will get defined based on the “autoconf-style” tests executed when you run OMake for the first time. You can use them to configure your project accordingly, and you should not redefine them.
-
-これらの変数はまず最初にOMakeを実行した時点で『自動設定スタイル(autoconf-style)』が実行されて、その結果を元に決定されます。あなたのプロジェクトを調和の取れた状態にするためには、これらの変数を使用してください。また、あなたはこれらの変数を再定義すべきではありません。
-
-.. You can use the --configure command line option (Section A.3.9) to force re-execution of all the tests.
-
-あなたは強制的にすべてのテストを実行させるために、 ``--configure`` コマンドラインオプション( :ref:`labelA.3.9` を参照)を使うことができます。
-
-* **OCAMLOPT_EXISTS**
-  
-  .. True when ocamlopt (or ocamlopt.opt) is available on your machine. 
-  
-  あなたのマシン上で ``ocamlopt`` (あるいは ``ocamlopt.opt`` )が利用可能である場合は真となります。
-
-* **OCAMLFIND_EXISTS**
-  
-  .. True when the ocamlfind is available on your machines. 
-  
-  あなたのマシン上で ``ocamlfind`` が利用可能である場合は真となります。
-
-* **OCAMLDEP_MODULES_AVAILABLE**
-  
-  .. True when a version of ocamldep that understands the -modules option is available on your machine. 
-  
-  あなたのマシン上で ``-modules`` オプションが理解できるバージョンの ``ocamldep`` が利用可能である場合は真となります。
-
-* **MENHIR_AVAILABLE**
-  
-  .. True when the Menhir parser-generator is available on your machine.
-  
-  あなたのマシン上でMenhirパーサジェネレータが利用可能である場合は真となります。
-
-.. index::
-   single: USE_OCAMLFIND
-   single: OCAMLC
-   single: OCAMLOPT
-   single: CAMLP4
-   single: OCAMLLEX
-   single: OCAMLLEXFLAGS
-   single: OCAMLYACC
-   single: OCAMLYACCFLAGS
-   single: OCAMLDEP
-   single: OCAMLDEP_MODULES
-   single: OCAMLDEP_MODULES_ENABLED
-   single: OCAMLMKTOP
-   single: OCAMLLINK
-   single: OCAMLOPTLINK
-   single: OCAMLINCLUDES
-   single: OCAMLFIND
-   single: OCAMLFINDFLAGS
-   single: OCAMLPACKS
-   single: BYTE_ENABLED
-   single: NATIVE_ENABLED
-   single: MENHIR_ENABLED
-.. _label13.6.2:
-
-13.6.2 OCamlコンパイルに用いる設定用の変数
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-.. The following variables can be redefined in your project. 
-
-以下の変数はあなたのプロジェクト上で再定義可能な変数です。
-
-* **USE_OCAMLFIND**
-  
-  .. Whether to use the ocamlfind utility (default false) 
-  
-  ``ocamlfind`` ユーティリティを利用するかどうか(デフォルトは ``false`` )
-
-* **OCAMLC**
-  
-  .. The OCaml bytecode compiler (default ocamlc.opt if it exists and USE_OCAMLFIND is not set, otherwise ocamlc). 
-  
-  OCamlバイトコードコンパイラ( ``ocamlc.opt`` が存在していてかつ ``USE_OCAMLFIND`` が設定されていない場合は ``ocamlc.opt`` 。そうでない場合は ``ocamlc`` )
-
-* **OCAMLOPT**
-  
-  .. The OCaml native-code compiler (default ocamlopt.opt if it exists and USE_OCAMLFIND is not set, otherwise ocamlopt). 
-  
-  OCamlネイティブコードコンパイラ( ``ocamlc.opt`` が存在していてかつ ``USE_OCAMLFIND`` が設定されていない場合は ``ocamlc.opt`` 。そうでない場合は ``ocamlopt`` )
-
-* **CAMLP4**
-  
-  .. The camlp4 preprocessor (default camlp4). 
-  
-  ``camlp4`` プリプロセッサ(デフォルトは ``camlp4`` )
-
-* **OCAMLLEX**
-  
-  .. The OCaml lexer generator (default ocamllex). 
-  
-  OCamlレキサジェネレータ(デフォルトは ``ocamllex`` )
-
-* **OCAMLLEXFLAGS**
-  
-  .. The flags to pass to ocamllex (default -q). 
-  
-  ``ocamllex`` に渡すフラグ(デフォルトは ``-q`` )
-
-* **OCAMLYACC**
-  
-  .. The OCaml parser generator (default ocamlyacc). 
-  
-  OCamlパーサジェネレータ(デフォルトは ``ocamlyacc`` )
-
-* **OCAMLYACCFLAGS**
-  
-  .. Additional options to pass to $(OCAMLYACC). 
-  
-  ``$(OCAMLYACC)`` に渡す追加オプション
-
-* **OCAMLDEP**
-  
-  .. The OCaml dependency analyzer (default ocamldep). 
-  
-  OCaml依存関係解析器(dependency analyzer)(デフォルトは ``ocamldep`` )
-
-* **OCAMLDEP_MODULES**
-  
-  .. The OCaml dependency analyzer that understands the -module option (default ocamldep, if ocamldep -modules works, or ocamlrun ocamldep-omake, if ocamlrun ocamldep-omake -modules works, and empty when neither works).
-  
-  ``-module`` オプションが理解できるOCaml依存解析器(デフォルトの値は ``ocamldep`` 、ただし ``ocamldep`` が ``-modules`` で動いた場合のみ。 ``ocamlrun ocamldep-omake -module`` が動く場合は ``ocamlrun ocamldep-omake`` が使われる。どちらでもない場合は空となる)
-
-* **OCAMLDEP_MODULES_ENABLED**
-  
-  .. Instead of using OCAMLDEP in a traditional make-style fashion, run $(OCAMLDEP_MODULES) -modules and then postprocess the output internally to discover all the relevant generated .ml and .mli files. See Section 13.6.5 for more information on interactions between OMake, OCAMLDEP and generated files. Set to $(OCAMLDEP_MODULES_AVAILABLE) by default. 
-  
-  従来の伝統的な ``make -style`` の形で ``OCAMLDEP`` を使う代わりに ``$(OCAMLDEP_MODULES) -modules`` を実行させて、 関連しているすべての ``.ml`` と ``.mli`` ファイルを探しだし、その出力を内部で後処理します。OMakeと、 ``OCAMLDEP`` や生成されたファイルの相互間の動作に関して、より詳しく知りたい方は ":ref:`label13.6.5`" を参照してください。
-
-* **OCAMLMKTOP**
-  
-  .. The OCaml toploop compiler (default ocamlmktop). 
-  
-  OCamlトップループコンパイラ(デフォルトは ``ocamlmktop`` )
-
-* **OCAMLLINK**
-  
-  .. The OCaml bytecode linker (default $(OCAMLC)). 
-  
-  OCamlバイトコードリンカ(デフォルトは ``$(OCAMLC)`` )
-
-* **OCAMLOPTLINK**
-  
-  .. The OCaml native-code linker (default $(OCAMLOPT)). 
-  
-  OCamlネイティブコードリンカ(デフォルトは ``$(OCAMLOPT)`` )
-
-* **OCAMLINCLUDES**
-  
-  .. Search path to pass to the OCaml compilers (default .). The search path with the -I prefix is defined by the PREFIXED_OCAMLINCLUDES variable. 
-  
-  OCamlコンパイラに受け渡す検索パス(デフォルトは ``.`` )。 ``-I`` 接頭辞を加えた検索パスについては、 ``PREFIXED_OCAMLINCLUDES`` 変数で定義されています。
-
-* **OCAMLFIND**
-  
-  .. The ocamlfind utility (default ocamlfind if USE_OCAMLFIND is set, otherwise empty). 
-  
-  ``ocamlfind`` ユーティリティ( ``USE_OCAMLFIND`` が設定されている場合は ``ocamlfind`` 。そうでない場合は空文字)
-
-* **OCAMLFINDFLAGS**
-  
-  .. The flags to pass to ocamlfind (default empty, USE_OCAMLFIND must be set). 
-  
-  ``ocamlfind`` に渡すフラグ(デフォルトは空文字で、 ``USE_OCAMLFIND`` が設定されていなければならない)
-
-* **OCAMLPACKS**
-  
-  .. Package names to pass to ocamlfind (USE_OCAMLFIND must be set). 
-  
-  ``ocamlfind`` に渡すパッケージ名( ``USE_OCAMLFIND`` が設定されていなければならない)
-
-* **BYTE_ENABLED**
-  
-  .. Flag indicating whether to use the bytecode compiler (default true, when no ocamlopt found, false otherwise).
-  
-  バイトコードコンパイラを使用するかどうかを示すフラグ( ``ocamlopt`` が見つからない場合は ``true`` 。そうでない場合は ``false`` )
-
-* **NATIVE_ENABLED**
-  
-  .. Flag indicating whether to use the native-code compiler (default true, when ocamlopt is found, false otherwise). Both BYTE_ENABLED and NATIVE_ENABLED can be set to true; at least one should be set to true.
-  
-  ネイティブコードコンパイラを使用するかどうかを示すフラグ( ``ocamlopt`` が見つかる場合は ``true`` 。そうでない場合は ``false`` )。 ``BYTE_ENABLED`` と ``NATIVE_ENABLED`` の両方はどちらとも真にすることができます。また、最低でも一つの変数は真であるべきです。
-
-* **MENHIR_ENABLED**
-  
-  .. Define this as true if you wish to use menhir instead of ocamlyacc (default false). 
-  
-  ``ocamlyacc`` の代わりに ``menhir`` を使いたい場合は ``true`` に設定してください(デフォルトは ``false`` )。
-
-.. index::
-   single: OCAMLDEPFLAGS
-   single: OCAMLPPFLAGS
-   single: OCAMLCFLAGS
-   single: OCAMLOPTFLAGS
-   single: OCAMLFLAGS
-   single: OCAML_BYTE_LINK_FLAGS
-   single: OCAML_NATIVE_LINK_FLAGS
-   single: OCAML_LINK_FLAGS
-   single: MENHIR_FLAGS
-.. _label13.6.3:
-
-13.6.3 OCamlコマンドフラグ
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-.. The following variables specify additional options to be passed to the OCaml tools. 
-
-以下の変数はOCamlのツールに渡す *追加* オプションを示しています。
-
-* **OCAMLDEPFLAGS**
-  
-  .. Flags to pass to OCAMLDEP and OCAMLDEP_MODULES. 
-  
-  ``OCAMLDEP`` と ``OCAMLDEP_MODULES`` に渡すフラグ
-
-* **OCAMLPPFLAGS**
-  
-  .. Flags to pass to CAMLP4. 
-  
-  ``CAMLP4`` に渡すフラグ
-
-* **OCAMLCFLAGS**
-  
-  .. Flags to pass to the byte-code compiler (default -g). 
-  
-  バイトコードコンパイラに渡すフラグ(デフォルトは ``-g`` )
-
-* **OCAMLOPTFLAGS**
-  
-  .. Flags to pass to the native-code compiler (default empty). 
-  
-  ネイティブコードコンパイラに渡すフラグ(デフォルトは空)
-
-* **OCAMLFLAGS**
-  
-  .. Flags to pass to either compiler (default -warn-error A). 
-  
-  両方のコンパイラに渡すフラグ(デフォルトは ``-warn-error A`` )
-
-* **OCAML_BYTE_LINK_FLAGS**
-  
-  .. Flags to pass to the byte-code linker (default empty). 
-  
-  バイトコードリンカに渡すフラグ(デフォルトは空)
-
-* **OCAML_NATIVE_LINK_FLAGS**
-  
-  .. Flags to pass to the native-code linker (default empty).
-  
-  ネイティブコードリンカに渡すフラグ(デフォルトは空)
-
-* **OCAML_LINK_FLAGS**
-  
-  .. Flags to pass to either linker. 
-  
-  両方のリンカに渡すフラグ
-
-* **MENHIR_FLAGS**
-  
-  .. Additional flags to pass to menhir.
-  
-  ``menhir`` に渡す追加フラグ
-
-.. index::
-   single: OCAML_LIBS
-   single: OCAML_OTHER_LIBS
-   single: OCAML_CLIBS
-   single: OCAML_LIB_FLAGS
-   single: ABORT_ON_DEPENDENCY_ERRORS
-.. _label13.6.4:
-
-13.6.4 ライブラリ変数
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-.. The following variables are used during linking.
-
-以下の変数がリンクの際に用いられます。
-
-* **OCAML_LIBS**
-  
-  .. Libraries to pass to the linker. These libraries become dependencies of the link step. 
-  
-  リンカに渡すライブラリ。これらのライブラリはリンク作業時に依存先となります。
-
-* **OCAML_OTHER_LIBS**
-  
-  .. Additional libraries to pass to the linker. These libraries are not included as dependencies to the link step. Typical use is for the OCaml standard libraries like unix or str. 
-  
-  リンカに渡す追加ライブラリ。これらのライブラリはリンク作業時に依存先には *含まれません* 。一般的な使用方法としては、OCamlの ``unix`` や ``str`` のような標準ライブラリに用いられます。
-
-* **OCAML_CLIBS**
-  
-  .. C libraries to pass to the linker. 
-  
-  リンカに渡すCライブラリ
-
-* **OCAML_LIB_FLAGS**
-  
-  .. Extra flags for the library linker. 
-  
-  ライブラリリンカに渡すその他のフラグ
-
-* **ABORT_ON_DEPENDENCY_ERRORS**
-  
-  .. OCaml linker requires the OCaml files to be listed in dependency order. Normally, all the functions presented in this section will automatically sort the list of OCaml modules passed in as the <files> argument. However, this variable is set to true, the order of the files passed into these function will be left as is, but OMake will abort with an error message if the order is illegal.
-  
-  OCamlのリンカは依存する順番でリストされたOCamlのファイルを必要としています。通常、このセクションにあるすべての関数は ``<files>`` 引数として渡したOCamlのモジュールリストを自動的にソートします。しかし、この変数が ``true`` に設定してある場合、これらの関数に受け渡されたファイルの順番はそのままになります。また、OMakeはこの順番が正しくなかったとしても、生じたエラーメッセージを無視します。
-
-.. _label13.6.5:
-
-13.6.5 OCamlファイルを生成
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-.. As of OCaml version 3.09.2, the standard ocamldep scanner is “broken”. The main issue is that it finds only those dependencies that already exist. If foo.ml contains a dependency on Bar, 
-
-OCaml バージョン 3.09.2に関しては、標準の ``ocamldep`` スキャナは『壊れています』。これに関しての主な問題は、既に存在している依存関係しか検索しないという点です。例えば、 ``foo.ml`` が ``Bar`` に依存しているものとしましょう。 ::
-
-  foo.ml:
-     open Bar
-
-.. then the default ocamldep will only find the dependency if a file bar.ml or bar.ml exists in the include path. It will not find (or print) the dependency if, for example, only bar.mly exists at the time ocamldep is run, even though bar.ml and bar.mli can be generated from bar.mly.
-
-この場合、ファイル ``bar.ml`` あるいはインクルードパス上の ``bar.ml`` が存在しているときには、デフォルトの ``ocamldep`` はそのファイルの依存関係しか調べません。つまり、もし ``ocamldep`` を実行した時点では ``bar.mly`` しか存在しなかったとしたら、たとえ ``bar.ml`` と ``bar.mli`` が ``bar.mly`` から生成されたとしても、これらの依存関係は調べない(あるいは出力しない)のです。
-
-.. OMake currently provides two methods for addressing this problem — one that requires manually specifying the generated files, and an experimental method for discovering such “hidden” dependencies automatically. The OCAMLDEP_MODULES_ENABLED variable controls which method is going to be used. When this variable is false, the manual specifications are expected and when it is true, the automated discovery will be attempted.
-
-現状のOMakeでは、この問題を解決するための2つの方法を提供しています。一つは生成されるファイルを手動で指定してあげることです。二つめは実験的な方法ですが、自動的に『隠れた』依存関係を調査することです。 ``OCAMLDEP_MODULES_ENABLED`` 変数はどちらの方法を使うのか、制御する変数です。この変数が偽であるときには、手動で指定するという方法が期待されます。また、真であるときには、自動的な調査を試みます。
-
-.. index::
-   single: OCamlGeneratedFiles()
-   single: LocalOCamlGeneratedFiles()
-.. _label13.6.5.1:
-
-13.6.5.1 OCamlGeneratedFiles, LocalOCamlGeneratedFiles
-"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
-::
-
-  OCamlGeneratedFiles(files)
-  LocalOCamlGeneratedFiles(files)
-
-.. When the OCAMLDEP_MODULES_ENABLED variable variable is set to false, the OCamlGeneratedFiles and LocalOCamlGeneratedFiles functions specify files that need to be generated before any OCaml files are scanned for dependencies. For example, if parser.ml and lexer.ml are both generated files, specify: 
-
-``OCAMLDEP_MODULES_ENABLED`` 変数が ``false`` に設定してある場合、 ``OCamlGeneratedFiles`` と ``LocalOCamlGeneratedFiles`` 関数は任意のOCamlファイルが依存関係をスキャンする前に、生成される必要のあるファイルを指定します。例えば、 ``parser.ml`` と ``lexer.ml`` の両方が生成されるファイルであった場合、以下のように指定します。 ::
-
-  OCamlGeneratedFiles(parser.ml lexer.ml)
-
-.. The OCamlGeneratedFiles function is global — its arguments will be generated before any OCaml files anywhere in the project are scanned for dependencies. The LocalOCamlGeneratedFiles function follows the normal scoping rules of OMake.
-
-``OCamlGeneratedFiles`` 関数は *グローバル* です。この関数の引数は、プロジェクト上の任意の場所にある任意のOCamlファイルの依存関係をスキャンする前に生成されます。 ``LocalOCamlGeneratedFiles`` 関数はOMakeの通常のスコープルールに従います。
-
-.. These functions have no effect when the OCAMLDEP_MODULES_ENABLED variable is true.
-
-これらの関数は ``OCAMLDEP_MODULES_ENABLED`` 変数が真であるときにはなんの影響も与えません。
-
-.. _label13.6.5.2:
-
-13.6.5.2 依存関係の解析中に生成されるファイルを自動的に調査
-"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
-.. Having to specify the generated files manualy when OMake could discover them automatically is obviously suboptimal. To address this, we tell ocamldep to only find the free module names in a file and then post-process the results internally.
-
-OMakeが自動的に調査してくれるときに、いちいち手動で生成されるファイルを指定してあげるのは明らかに最適とは言えません。まずこれについて話すために、ファイルの自由なモジュール名 *のみ* を探しだす ``ocamldep`` について話し、その後内部でその結果を後処理することを伝えました。
-
-.. This automated functionality is enabled when the OCAMLDEP_MODULES_ENABLED variable is set to true. By default, OCAMLDEP_MODULES_ENABLED variable will be set to $(OCAMLDEP_MODULES_AVAILABLE).
-
-この自動的な機構は ``OCAMLDEP_MODULES_ENABLED`` 変数が ``true`` に設定されているときに許可されます。通常、 ``OCAMLDEP_MODULES_ENABLED`` 変数は ``$(OCAMLDEP_MODULES_AVAILABLE)`` に設定されています。
-
-.. Note that the ocamldep functionality this relies upon is only included in the OCaml version 3.10 and higher. Temporarily, we distribute a bytecode version ocamldep-omake of the appropriately modified ocamldep. The appropriate ocamldep will be discovered automatically — see and the OCAMLDEP_MODULES_AVAILABLE and OCAMLDEP_MODULES variables will be set accordingly.
-
-この処理に依存している ``ocamldep`` の機構はバージョン3.10のOCamlかそれ以降のみに含まれています。一時的に、私たちは ``ocamldep`` を似せて修正したバイトコードバージョンの ``ocamldep-omake`` を用意しました。この似せて作った ``ocamldep`` は自動的に依存関係を調査してくれます。詳細は ``OCAMLDEP_MODULES_AVAILABLE`` と ``OCAMLDEP_MODULES`` 変数の項を参照し、さらにこれらの変数を正しく設定し、利用してください。
-
-.. index::
-   single: Menhir
-.. _label13.6.6:
-
-13.6.6 Menhirパーサジェネレータを使用
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-.. Menhir is a parser generator that is mostly compatible with ocamlyacc, but with many improvements. A few of these are listed here (excerpted from the Menhir home page http://cristal.inria.fr/~fpottier/menhir/).
-
-Menhirは ``ocamlyacc`` とほとんど互換性がとれており、かつ様々な改良がなされているパーサジェネレータです。機能の一部を以下にリストします(さらに知りたい方はMenhirのホームページ http://cristal.inria.fr/~fpottier/menhir/ を参照してください)。
-
-.. Menhir's explanations are believed to be understandable by mere humans. 
-   Menhir allows grammar specifications to be split over multiple files. It also allows several grammars to share a single set of tokens. 
-   Menhir is able to produce parsers that are parameterized by Objective Caml modules. 
-   Added by jyh With the --infer option, Menhir can typecheck the semantic actions in your grammar at generation time. 
-
-* Menhirの解釈(explanations)は、多くの人間が分かりやすくなるように改良されています。
-* Menhirは複数のファイルにわたって文法を記述できます。これはまた、トークンの集合を複数のgrammerが共有できることを意味しています。
-* MenhirはObjective Camlモジュールによって記述されたパーサを提供することができます。
-* jyhによって ``-infer`` オプションが追加されました。これによって、Menhirは生成時にあなたの文法における意味動作(semantic actions)をチェック(typecheck)することができます。
-
-.. note::
-   訳注: 見ての通り、訳が安定していません。すいませんがあまり信用しないでください
-
-.. What do you need to do to use Menhir instead of ocamlyacc? 
-
-どのようにして ``ocamlyacc`` の代わりにMenhirを使用できるのでしょうか?
-
-.. Place the following definition before the relevant section of your project (or at the top of your project OMakefile if you want to use Menhir everywhere).
-
-1. あなたのプロジェクトの適切な位置(Menhirをどこでも使いたいのならプロジェクトトップの ``OMakefile`` )に、以下の定義を追加してください。 ::
-
-     MENHIR_ENABLED = true
-
-.. Optionally, add any desired Menhir options to the MENHIR_FLAGS variable.
-
-2. 必要ならば、Menhirに追加させたいオプションを ``MENHIR_FLAGS`` に追加してください。 ::
-
-     MENHIR_FLAGS += --infer
-
-.. With this setup, any file with a .mly suffix will be compiled with Menhir.
-
-このセットアップによって、任意の ``.mly`` 拡張子のファイルはMenhirでコンパイルされます。
-
-.. If your grammar is split across several files, you need to specify it explicitly, using the MenhirMulti function.
-
-もしあなたの文法(grammar)がいくつかのファイルにわたって分割されているのなら、あなたは ``MenhirMulti`` 関数を用いて、そのことを明示的に指定してあげる必要があります。 ::
-
-    MenhirMulti(target, sources)
-        target : 拡張子を除いたファイル名
-        sources : 拡張子を除いた、文法を定義しているファイル群
-
-.. For example, if you want to generate the parser files parse.ml and parse.mli, from the grammar specified in files a.mly and b.mly, you would use the following.
-
-例えば、文法を指定しているファイル ``a.mly`` と ``b.mly`` からパーサファイル ``parse.ml`` と ``parse.mli`` を生成したい場合は、以下のように記述します。 ::
-
-    MenhirMulti(parse, a b)
-
-.. index::
-   single: OCamlLibrary()
-.. _label13.6.6.1:
-
-13.6.6.1 OCamlLibrary
-""""""""""""""""""""""""""""""""""""""
-.. The OCamlLibrary function builds an OCaml library.
-
-``OCamlLibrary`` 関数はOCamlライブラリをビルドします。 ::
-
-  OCamlLibrary(<libname>, <files>)
-
-.. The <libname> and <files> are listed without suffixes.
-
-``<libname>`` と ``<files>`` は拡張子を *付けないで* 指定してください。
-
-.. This function returns the list of all the targets that it defines the rules for (including the $(name)$(EXT_LIB) file when NATIVE_ENABLED is set).
-
-この関数はルールを定義しているすべてのターゲットのリスト( ``NATIVE_ENABLED`` が設定されているときは ``$(name)$(EXT_LIB)`` を含む)を返します。
-
-.. The following code builds the libfoo.cmxa library from the files foo.cmx and bar.cmx (if NATIVE_ENABLED is set), and libfoo.cma from foo.cmo and bar.cmo (if BYTE_ENABLED is set).
-
-以下のコードは( ``NATIVE_ENABLED`` が設定されている場合は) ``foo.cmx`` と ``bar.cmx`` から ``libfoo.cmxa`` ライブラリをビルドし、( ``BYTE_ENABLED`` が設定されている場合は) ``foo.cmo`` と ``bar.cmo`` から ``libfoo.cma`` をビルドします。 ::
-
-  OCamlLibrary(libfoo, foo bar)
-
-.. index::
-   single: OCamlPackage()
-.. _label13.6.6.2:
-
-13.6.6.2 OCamlPackage
-""""""""""""""""""""""""""""""""""""""
-.. The OCamlPackage function builds an OCaml package.
-
-``OCamlPackage`` 関数はOCamlパッケージをビルドします。 ::
-
-  OCamlPackage(<name>, <files>)
-
-.. The <name> and <files> are listed without suffixes. The <files> must have been compiled with the -for-pack <ident> flag to the OCaml compiler.
-
-``<name>`` と ``<files>`` は拡張子を *付けないで* 指定してください。 ``<files>`` はOCamlコンパイラに ``-for-pack <ident>`` フラグを加えた状態でコンパイルされます。
-
-.. This function returns the list of all the targets that it defines the rules for (including the $(name)$(EXT_LIB) file when NATIVE_ENABLED is set).
-
-この関数はルールを定義しているすべてのターゲットのリスト( ``NATIVE_ENABLED`` が設定されているときは ``$(name)$(EXT_LIB)`` を含む)を返します。
-
-.. The following code builds the libfoo.cmx package from the files package.cmx and bar.cmx (if NATIVE_ENABLED is set), and package.cmo from foo.cmo and bar.cmo (if BYTE_ENABLED is set).
-
-以下のコードは( ``NATIVE_ENABLED`` が設定されている場合は) ``foo.cmx`` と ``bar.cmx`` から ``package.cmx`` パッケージをビルドし、( ``BYTE_ENABLED`` が設定されている場合は) ``foo.cmo`` と ``bar.cmo`` から ``package.cmo`` をビルドします。 :: 
-
-  OCamlPackage(package, foo bar)
-
-.. index::
-   single: OCamlLibraryCopy()
-.. _label13.6.6.3:
-
-13.6.6.3 OCamlLibraryCopy
-""""""""""""""""""""""""""""""""""""""
-.. The OCamlLibraryCopy function copies a library to an install location.
-
-``OCamlLibraryCopy`` 関数はライブラリをインストール先にコピーします。 ::
-
-  OCamlLibraryCopy(<tag>, <libdir>, <libname>, <interface-files>)
-
-.. The <interface-files> specify additional interface files to be copied if the INSTALL_INTERFACES variable is true.
-
-``<interface-files>`` では ``INSTALL_INTERFACES`` 変数が真である場合にコピーする、追加のインターフェイスファイルを指定します。
-
-.. index::
-   single: OCamlLibraryInstall()
-.. _label13.6.6.4:
-
-13.6.6.4 OCamlLibraryInstall
-""""""""""""""""""""""""""""""""""""""
-.. The OCamlLibraryInstall function builds a library and copies it to an install location in one step.
-
-``OCamlLibraryInstall`` 関数はライブラリをビルドし、加えてインストール先にコピーします。 ::
-
-  OCamlLibraryInstall(<tag>, <libdir>, <libname>, <files>)
-
-.. index::
-   single: OCamlProgram()
-   single: OCAML_LIBS
-   single: OCAML_OTHER_LIBS
-   single: OCAML_CLIBS
-   single: OCAML_BYTE_LINK_FLAGS
-   single: OCAML_NATIVE_LINK_FLAGS
-   single: OCAMLE_LINK_FLAGS
-.. _label13.6.6.5:
-
-13.6.6.5 OCamlProgram
-""""""""""""""""""""""""""""""""""""""
-.. The OCamlProgram function builds an OCaml program. It returns the array with all the targets for which it has defined the rules ($(name)$(EXE) and $(name).run and/or $(name).opt, depending on the NATIVE_ENABLED and BYTE_ENABLED variables).
-
-``OCamlProgram`` 関数はOCamlプログラムをビルドします。この関数はルールを定義している、すべてのターゲットの配列を返します( ``$(name)$(EXE)`` , ``$(name).run`` ``$(name).opt`` は ``NATIVE_ENABLED`` と ``BYTE_ENABLED`` 変数の値に依存しています)。 ::
-
-  OCamlProgram(<name>, <files>)
-
-.. Additional variables used:
-
-以下の変数が利用されます。
-
-* **OCAML_LIBS**
-  
-  .. Additional libraries passed to the linker, without suffix. These files become dependencies of the target program. 
-  
-  リンカに渡す追加ライブラリ(拡張子を除く)。これらのファイルは対象のプログラムの依存先となります。
-
-* **OCAML_OTHER_LIBS**
-  
-  .. Additional libraries passed to the linker, without suffix. These files do not become dependencies of the target program. 
-  
-  リンカに渡す追加ライブラリ(拡張子を除く)。これらのファイルは対象のプログラムの依存先に *なりません* 。
-
-* **OCAML_CLIBS**
-  
-  .. C libraries to pass to the linker. 
-  
-  リンカに渡すCライブラリ
-
-* **OCAML_BYTE_LINK_FLAGS**
-  
-  .. Flags to pass to the bytecode linker. 
-  
-  バイトコードリンカに渡すフラグ
-
-* **OCAML_NATIVE_LINK_FLAGS**
-  
-  .. Flags to pass to the native code linker. 
-  
-  ネイティブコードリンカに渡すフラグ
-  
-* **OCAML_LINK_FLAGS**
-  
-  .. Flags to pass to both linkers. 
-  
-  両方のリンカに渡すフラグ
-
-.. index::
-   single: OCamlProgramCopy()
-   single: NATIVE_ENABLED
-.. _label13.6.6.6:
-
-13.6.6.6 OCamlProgramCopy
-""""""""""""""""""""""""""""""""""""""
-.. The OCamlProgramCopy function copies an OCaml program to an install location.
-
-``OCamlProgramInstall`` 関数はOCamlプログラムをインストール先にコピーします。 ::
-
-  OCamlProgramCopy(<tag>, <bindir>, <name>)
-
-.. Additional variables used: 
-
-以下の変数が利用されます。
-
-* **NATIVE_ENABLED**
-  
-  .. If the NATIVE_ENABLED variable is set, the native-code executable is copied; otherwise the byte-code executable is copied. 
-  
-  ``NATIVE_ENABLED`` 変数が設定されている場合、ネイティブコードの実行形式がコピーされます。そうでない場合はバイトコードの実行形式がコピーされます。
-
-.. index::
-   single: OCamlProgramInstall()
-.. _label13.6.6.7:
-
-13.6.6.7 OCamlProgramInstall
-""""""""""""""""""""""""""""""""""""""
-.. The OCamlProgramInstall function builds a programs and copies it to an install location in one step.
-
-``OCamlProgramInstall`` 関数はプログラムをビルドし、加えてインストール先にコピーします。 ::
-
-  OCamlProgramInstall(<tag>, <bindir>, <name>, <files>)
-
-.. _label13.7:
-
-13.7 LaTeXファイルのビルド
---------------------------------------
-.. OMake provides support for building LATEX documents, including support for automatically running BiBTex and for producing PostScript and PDF files. In order to use the functions defined in this section, you need to make sure the line is present in your OMakeroot file.
-
-OMakeではLaTeXドキュメントのビルドをサポートします。このサポートには自動的にBiBTexを実行させ、PostScriptやPDFファイルを生成するためのサポートも含まれます。このセクションで列挙している関数を使うためには、まずあなたの ``OMakeroot`` ファイルに、以下の一行を追加してください。 ::
-
-  open build/LaTeX
-
-.. index::
-   single: LATEX
-   single: TETEX2_ENABLED
-   single: LATEXFLAGS
-   single: BIBTEX
-   single: MAKEINDEX
-   single: DVIPS
-   single: DVIPSFLAGS
-   single: DVIPDFM
-   single: DVIPDFMFLAGS
-   single: PDFLATEX
-   single: PDFLATEXFLAGS
-   single: USEPDFLATEX
-.. _label13.7.1:
-
-13.7.1 設定用の変数
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-.. The following variables can be modified in your project. 
-
-以下の変数があなたのプロジェクト上で編集できます。
-
-* **LATEX**
-  
-  .. The LATEX command (default latex). 
-  
-  LaTeXコマンド(デフォルトは ``latex`` )
-
-* **TETEX2_ENABLED**
-  
-  .. Flag indicating whether to use advanced LATEX options present in TeTeX v.2 (default value is determined the first time omake reads LaTeX.src and depends on the version of LATEX you have installed). 
-  
-  TeTeX v.2にある、発展的なLaTeXオプションを利用するかどうかを示すフラグです(デフォルトの値は最初にomakeが ``LaTeX.src`` を読み込むことで決定されて、さらにインストールしてあるLaTeXのバージョンに依存します)。
-
-* **LATEXFLAGS**
-  
-  .. The LATEX flags (defaults depend on the TETEX2_ENABLED variable) 
-  
-  LaTexのフラグ(デフォルトの値は ``TETEX2_ENABLED`` 変数に依存する)
-
-* **BIBTEX**
-  
-  .. The BibTeX command (default bibtex). 
-  
-  BibTeXコマンド(デフォルトは ``bibtex`` )
-
-* **MAKEINDEX**
-  
-  .. The command to build an index (default makeindex).   
-  
-  索引をビルドするコマンド(デフォルトは ``makeindex`` )
-
-* **DVIPS**
-  
-  .. The .dvi to PostScript converter (default dvips). 
-  
-  ``.dvi`` からPostScriptに変換するコンバータ(デフォルトは ``dvips`` )
-
-* **DVIPSFLAGS**
-  
-  .. Flags to pass to dvips (default -t letter). 
-  
-  ``dvips`` に渡すフラグ(デフォルトは ``-t letter`` )
-
-* **DVIPDFM**
-  
-  .. The .dvi to .pdf converter (default dvipdfm). 
-  
-  ``.dvi`` から ``.pdf`` に変換するコンバータ(デフォルトは ``dvipdfm`` )
-
-* **DVIPDFMFLAGS**
-  
-  .. Flags to pass to dvipdfm (default -p letter).
-  
-  ``dvipdfm`` に渡すフラグ(デフォルトは ``-p letter`` )
-
-* **PDFLATEX**
-  
-  .. The .latex to .pdf converter (default pdflatex). 
-  
-  ``.latex`` から ``.pdf`` に変換するコンバータ(デフォルトは ``pdflatex`` )
-
-* **PDFLATEXFLAGS**
-  
-  .. Flags to pass to pdflatex (default is $`(LATEXFLAGS)).
-  
-  ``pdflatex`` に渡すフラグ(デフォルトは ``$`(LATEXFLAGS)`` )
-
-* **USEPDFLATEX**
-  
-  .. Flag indicating whether to use pdflatex instead of dvipdfm to generate the .pdf document (default false). 
-  
-  ``.pdf`` ドキュメントを生成するのにdvipdfmではなくpdflatexを使うかどうかを示すフラグ(デフォルトは ``false`` )
-
-.. _label13.7.2:
-
-13.7.2 LaTeXドキュメントのビルド
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-.. index::
-   single: LaTeXDocument()
-   single: TEXINPUTS
-   single: TEXDEPS
-   single: TEXVARS
-.. _label13.7.2.1:
-
-13.7.2.1 LaTeXDocument
-"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
-.. The LaTeXDocument produces a LATEX document.
-
-``LaTeXDocument`` 関数はLaTeXドキュメントを生成します。 ::
-
-  LaTeXDocument(<name>, <texfiles>)
-
-.. The document <name> and <texfiles> are listed without suffixes. This function returns the filenames for the generated .ps and .pdf files.
-
-``<name>`` と ``<texfiles>`` には拡張子を *付けないで* 指定してください。この関数は生成された ``.ps`` と ``.pdf`` ファイルのファイル名を返します。
-
-.. Additional variables used: 
-
-以下の変数が利用されます。
-
-* **TEXINPUTS**
-  
-  .. The LATEX search path (an array of directories, default is taken from the TEXINPUTS environment variable). 
-  
-  LaTeXの検索パス(ディレクトリの配列で、デフォルトは ``TEXINPUTS`` 環境変数から取得される)
-
-* **TEXDEPS**
-  
-  .. Additional files this document depends on. 
-  
-  このドキュメントに依存している追加ファイル
-
-* **TEXVARS**
-  
-  .. An array of names of the environment variables that are to be updated based on the value of OMake's TEXINPUTS variable. Defaults to TEXINPUTS BIBINPUTS BSTINPUTS. 
-  
-  OMakeの ``TEXINPUTS`` 変数の値に基づいてアップデートすることになっている、環境変数の名前の配列。デフォルトは ``TEXINPUTS BIBINPUTS BSTINPUTS`` 。
-
-.. index::
-   single: TeXGeneratedFiles()
-   single: LocalTeXGeneratedFiles()
-.. _label13.7.2.2:
-
-13.7.2.2 TeXGeneratedFiles, LocalTeXGeneratedFiles
-"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
-::
-
-  TeXGeneratedFiles(files)
-  LocalTeXGeneratedFiles(files)
-
-.. The TeXGeneratedFiles and LocalTeXGeneratedFiles functions specify files that need to be generated before any LATEXfiles are scanned for dependencies. For example, if config.tex and inputs.tex are both generated files, specify: 
-
-``TeXGeneratedFiles`` と ``LocalTeXGeneratedFiles`` 関数は任意のLaTeXファイルの依存関係をスキャンする前に生成される必要のあるファイルを指定します。例えば、 ``config.tex`` と ``inputs.tex`` が両方とも生成されるファイルであった場合、以下のように指定します。 ::
-
-    TeXGeneratedFiles(config.tex inputs.tex)
-
-.. The TeXGeneratedFiles function is global — its arguments will be generated before any TeX files anywhere in the project are scanned for dependencies. The LocalTeXGeneratedFiles function follows the normal scoping rules of OMake.
-
-``TeXGeneratedFiles`` 関数は *グローバル* です。この関数で指定したファイルは、任意の場所にある任意のTeXファイルの依存関係をスキャンする前に生成されます。 ``LocalTeXGeneratedFiles`` 関数はOMakeの通常のスコープルールに従います。
-
-.. index::
-   single: LaTeXDocumentCopy()
-.. _label13.7.2.3:
-
-13.7.2.3 LaTeXDocumentCopy
-"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
-.. The LaTeXDocumentCopy copies the document to an install location.
-
-``LaTeXDocumentCopy`` 関数はインストール先にドキュメントをコピーします。 ::
-
-  LaTeXDocumentCopy(<tag>, <libdir>, <installname>, <docname>)
-
-.. This function copies just the .pdf and .ps files.
-
-この関数は ``.pdf`` と ``.ps`` ファイルだけコピーします。
-
-.. index::
-   single: LaTeXDocumentInstall()
-.. _label13.7.2.4:
-
-13.7.2.4 LaTeXDocumentInstall
-"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
-.. The LaTeXDocumentInstall builds a document and copies it to an install location in one step.
-
-``LaTeXDocumentInstall`` 関数はドキュメントをビルドし、加えてインストール先にドキュメントをコピーします。 ::
-
-  LaTeXDocumentInstall(<tag>, <libdir>, <installname>, <docname>, <files>)
diff --git a/conf.py b/conf.py
index 6cc4401..1a713ed 100644 (file)
--- a/conf.py
+++ b/conf.py
@@ -25,7 +25,7 @@ import sys, os
 extensions = ['sphinx.ext.autodoc', 'rst2pdf.pdfbuilder']
 
 # Add any paths that contain templates here, relative to this directory.
-templates_path = ['_templates']
+templates_path = ['templates']
 
 # The suffix of source filenames.
 source_suffix = '.rst'
@@ -64,7 +64,7 @@ release = '1.2.6'
 
 # List of directories, relative to source directory, that shouldn't be searched
 # for source files.
-exclude_trees = ['_build']
+exclude_trees = ['build']
 
 # The reST default role (used for this markup: `text`) to use for all documents.
 #default_role = None
@@ -120,7 +120,7 @@ html_theme = 'default'
 # Add any paths that contain custom static files (such as style sheets) here,
 # relative to this directory. They are copied after the builtin static files,
 # so a file named "default.css" will overwrite the builtin "default.css".
-html_static_path = ['_static']
+html_static_path = ['static']
 
 # If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
 # using the given strftime format.
@@ -196,7 +196,7 @@ latex_documents = [
 # USER-DEFINITION
 language = "ja"
 
-html_logo = "_static/omake.gif"
+html_logo = "static/omake.gif"
 
 html_last_updated_fmt = '%Y/%m/%d'
 
diff --git a/detail.rst b/detail.rst
deleted file mode 100644 (file)
index 73572ef..0000000
+++ /dev/null
@@ -1,453 +0,0 @@
-.. 6-detail
-
-.. index::
-   single: osh(1)
-   single: value
-.. _label6:
-
-6. 式と値
-==================================
-.. omake provides a full programming-language including many system and IO functions. The language is object-oriented – everything is an object, including the base values like numbers and strings. However, the omake language differs from other scripting languages in three main respects.
-
-      * Scoping is dynamic.
-      * Apart from IO, the language is entirely functional – there is no assignment operator in the language.
-      * Evaluation is normally eager – that is, expressions are evaluated as soon as they are encountered. 
-
-omakeは多くのシステムとIO関数を含んでいる、フル機能のプログラミング言語です。この言語はオブジェクト指向言語であり、数値や文字列のような基本の型もすべてオブジェクトで表現されます。しかしながら、このomake言語は3つの点において、他のスクリプト言語とは異なっています。
-
-* 動的なスコーピングを行います。
-* IOを除いて、この言語は全体が関数的です。この言語は代入という操作が存在しません。
-* 値の評価は通常の場合その場で行われます。これは、式が表れた瞬間に評価されるということを意味しています。
-
-.. To illustrate these features, we will use the osh(1) omake program shell. The osh(1) program provides a toploop, where expressions can be entered and the result printed. osh(1) normally interprets input as command text to be executed by the shell, so in many cases we will use the value form to evaluate an expression directly.
-
-これらの機能を確かめるため、今回私たちは ``osh(1)`` omakeプログラムを使いました。 ``osh(1)`` プログラムは式を入力したら、すぐに結果が出力されるインタープリターとなっています。 ``osh(1)`` は通常シェル上で実行するために、入力された文章をコマンド文として解釈しますので、式を直接評価するためには多くの場合 ``value`` 文を使用します。 ::
-
-    osh> 1
-    *** omake error: File -: line 1, characters 0-1 command not found: 1
-    osh> value 1
-    - : "1" : Sequence
-    osh> ls -l omake
-    -rwxrwxr-x  1 jyh jyh 1662189 Aug 25 10:24 omake*
-
-.. index::
-   single: 動的なスコーピング
-   single: CC
-   single: CFLAGS
-   single: private
-.. _label6.1:
-
-6.1 動的なスコーピング
-----------------------------------
-.. Dynamic scoping means that the value of a variable is determined by the most recent binding of the variable in scope at runtime. Consider the following program.
-
-動的なスコーピングは言い換えると、変数の値が実行されているスコープ中で、もっとも近くで束縛されている変数によって決定されることを意味しています。以下のプログラムについて考えてみましょう。 ::
-
-    OPTIONS = a b c
-    f() =
-       println(OPTIONS = $(OPTIONS))
-    g() =
-       OPTIONS = d e f
-       f()
-
-.. If f() is called without redefining the OPTIONS variable, the function should print the string OPTIONS = a b c.
-
-``f()`` が ``OPTIONS`` 変数を再定義することなく呼び出した場合、この関数は文字列 ``OPTIONS = a b c`` が出力されます。
-
-.. In contrast, the function g() redefines the OPTIONS variable and evaluates f() in that scope, which now prints the string OPTIONS = d e f.
-
-対照的に、関数 ``g()`` は ``OPTIONS`` 変数を再定義し、 ``f()`` をそのスコープ中で評価しますので、 この関数は文字列 ``OPTIONS = d e f`` が出力されます。
-
-.. The body of g defines a local scope – the redefinition of the OPTIONS variable is local to g and does not persist after the function terminates.
-
-``g`` の内容はローカルスコープを定義しています。 ``OPTIONS`` 変数の再定義は ``g`` についてローカルであり、この関数が終了した場合、この定義も終了します。 ::
-
-    osh> g()
-    OPTIONS = d e f
-    osh> f()
-    OPTIONS = a b c
-
-.. Dynamic scoping can be tremendously helpful for simplifying the code in a project. For example, the OMakeroot file defines a set of functions and rules for building projects using such variables as CC, CFLAGS, etc. However, different parts of a project may need different values for these variables. For example, we may have a subdirectory called opt where we want to use the -03 option, and a subdirectory called debug where we want to use the -g option. Dynamic scoping allows us to redefine these variables in the parts of the project without having to redefine the functions that use them.
-
-動的なスコーピングはプロジェクトでのコードを簡略化するための非常に有用なツールです。例えば、 ``OMakeroot`` ファイルでは関数の集合、 ``CC`` や ``CFLAGS`` などの変数を使ったプロジェクトのビルドルールについて定義しています。しかしながら、プロジェクト中の異なったパートでは、これらの変数がそれぞれ異なった値であってほしいと思うことがあるでしょう。例えば、サブディレクトリ ``opt`` では、私たちは ``-O3`` オプションを、サブディレクトリ ``debug`` では ``-g`` オプションを用いてビルドしたいものとします。この問題は動的なスコーピングを用いて、関数を再定義することなく、プロジェクト中の一部の変数を置き換えることができます。 ::
-
-    section
-       CFLAGS = -O3
-       .SUBDIRS: opt
-    section
-       CFLAGS = -g
-       .SUBDIRS: debug
-
-.. However, dynamic scoping also has drawbacks. First, it can become confusing: you might have a variable that is intended to be private, but it is accidentally redefined elsewhere. For example, you might have the following code to construct search paths.
-
-しかしながら、動的なスコーピングは欠点も持っています。はじめに、この機能はバグの箇所が分かり辛くなることがあります。具体的にいうと、あなたはプライベートにしたい変数があるとします。しかしこれはどこか別の場所で再定義される恐れがあります。例えば、あなたは以下の検索パスを組み立てるコードを持っていたとします。 ::
-
-   PATHSEP = :
-   make-path(dirs) =
-      return $(concat $(PATHSEP), $(dirs))
-
-   make-path(/bin /usr/bin /usr/X11R6/bin)
-   - : "/bin:/usr/bin:/usr/X11R6/bin" : String
-
-.. However, elsewhere in the project, the PATHSEP variable is redefined as a directory separator /, and your function suddenly returns the string /bin//usr/bin//usr/X11R6/bin, obviously not what you want.
-
-しかしながら、プロジェクトのどこかで ``PATHSEP`` 変数がディレクトリのセパレータ ``/`` で再定義された場合、この関数は突如文字列 ``/bin//usr/bin//usr/X11R6/bin`` を返すようになります。あなたは明らかにそれを望んでいないのにです。
-
-.. The private block is used to solve this problem. Variables that are defined in a private block use static scoping – that is, the value of the variable is determined by the most recent definition in scope in the source text.
-
-``private`` ブロックはこの問題を解決するために用いられます。 ``private`` ブロック内で定義された変数は静的なスコーピングを用います。これは、変数の値がソーステキストのスコープ中で、もっとも最近の定義によって決定されることを示しています。 ::
-
-   private
-      PATHSEP = :
-   make-path(dirs) =
-      return $(concat $(PATHSEP), $(dirs))
-
-   PATHSEP = /
-   make-path(/bin /usr/bin /usr/X11R6/bin)
-   - : "/bin:/usr/bin:/usr/X11R6/bin" : String
-
-.. _label6.2:
-
-6.2 関数評価
-----------------------------------
-.. Apart from I/O, omake programs are entirely functional. This has two parts:
-
-      * There is no assignment operator.
-      * Functions are values, and may be passed as arguments, and returned from functions just like any other value. 
-
-IOを除いて、omakeのプログラムは全体が関数的です。これは二つの意味を持っています。
-
-* 代入という操作が存在しません。
-* 関数は引数を渡して、別の値を返す『値(value)』です。
-
-.. The second item is straightforward. For example, the following program defines an increment function by returning a function value.
-
-二番目についてはそのままの説明です。例えば、以下のプログラムでは関数の値を返すことによって加算する関数を定義しています。 ::
-
-   incby(n) =
-      g(i) =
-         return $(add $(i), $(n))
-      return $(g)
-
-   f = $(incby 5)
-
-   value $(f 3)
-   - : 8 : Int
-
-.. The first item may be the most confusing initially. Without assignment, how is it possible for a subproject to modify the global behavior of the project? In fact, the omission is intentional. Build scripts are much easier to write when there is a guarantee that subprojects do not interfere with one another.
-
-一番目については恐らく最初は困惑することでしょう。代入なしで、いったいどのようにして、サブプロジェクトにプロジェクトのグローバルな振る舞いを修正することができるのでしょうか?実際、この省略された説明は意図的にされています。サブプロジェクトが他のプロジェクトの邪魔をしないことを保障されているとき、ビルドスクリプトはより書きやすくなります。
-
-.. However, there are times when a subproject needs to propagate information back to its parent object, or when an inner scope needs to propagate information back to the outer scope.
-
-しかしながら、サブプロジェクトが親のオブジェクトに情報を伝える必要がある場合や、内部のスコープが外部のスコープに情報を伝える必要がある場合が存在することも確かです。
-
-.. index::
-   single: export
-   single: .PHONY
-.. _label6.3:
-
-6.3 環境のエクスポート
-----------------------------------
-.. The export directive can be used to propagate all or part of an inner scope back to its parent. If used without arguments, the entire scope is propagated back to the parent; otherwise the arguments specify which part of the environment to propagate. The most common usage is to export some or all of the definitions in a conditional block. In the following example, the variable B is bound to 2 after the conditional. The A variable is not redefined.
-
-``export`` 文によってすべて、あるいは一部の内部スコープの情報を親スコープに伝えることができます。もし引数が存在しない場合、全体のスコープの情報が親に伝えられます。さもなければ引数の変数のみが伝えられます。もっともよく使うやり方は、条件分岐中のいくつか、あるいはすべての定義をエクスポートする場合です。以下の例では、変数 ``B`` は評価された後に、2に束縛されます。変数 ``A`` は再定義されません。 ::
-
-    if $(test)
-       A = 1
-       B = $(add $(A), 1)
-       export B
-    else
-       B = 2
-       export
-
-.. If the export directive is used without an argument, all of the following is exported: 
-
-      * The values of all the dynamically scoped variables (as described in Section 5.5).
-      * The current working directory.
-      * The current Unix environment.
-      * The current implicit rules and implicit dependencies (see also Section 8.11.1).
-      * The current set of “phony” target declarations (see Sections 8.10 and 8.11.3). 
-
-``export`` 文が引数なしに用いられた場合は、以下のすべてが出力されます。
-
-* 動的にスコープされたすべての値 (":ref:`label5.5`"で説明しました)
-* 現在のワーキングディレクトリ
-* 現在のUNIX環境
-* 現在の暗黙のルールと暗黙の依存関係 (詳細は ":ref:`label8.11.1`" を参照してください)
-* 現在の"phony"ターゲット宣言の集合 (詳細は ":ref:`label8.10`",":ref:`label8.11.3`" を参照してください)
-
-.. If the export directive is used with an argument, the argument expression is evaluated and the resulting value is interpreted as follows:
-      * If the value is empty, everything is exported, as described above.
-      * If the value represents a environment (or a partial environment) captured using the export function, then the corresponding environment or partial environment is exported.
-      * Otherwise, the value must be a sequence of strings specifying which items are to be propagated back. The following strings have special meaning:
-            o .RULE — implicit rules and implicit dependencies.
-            o .PHONY — the set of “phony” target declarations. 
-        All other strings are interpreted as names of the variables that need to be propagated back. 
-
-``export`` 文が引数ありで用いられた場合は引数の式が評価されて、返される値は以下のようになります。
-
-* もし値が空であるなら、上で説明したすべてがエクスポートされます。
-* もし値が環境(environment)、あるいは部分的な環境を表現しているのなら( 詳細は ":ref:`label9.3.41`" を参照してください)、対象の環境または部分的な環境がエクスポートされます。
-* そうでなければ、値は出力したい項目を指定している、文字列のシーケンスでなければなりません。また、以下の文字列は特別な意味を持ちます。
-  
-  * ``.RULE`` ー 暗黙のルールと、暗黙的な依存関係
-  * ``.PHONY`` ー "phony"ターゲット宣言の集合
-  
-  すべての他の文字列は、出力する必要のある変数名として解釈されます。
-
-例えば以下の(わざとらしい)例では変数 ``A`` と ``B`` がエクスポートされて、さらに暗黙のルールはこのセクションが終わった後も、環境の中で保持されます。しかし、変数 ``TMP`` とターゲット ``tmp_phony`` は変更されずに、このセクションの中にとどまります。 ::
-
-  section
-     A = 1
-     B = 2
-     TMP = $(add $(A), $(B))
-
-     .PHONY: tmp_phony
-
-     tmp_phony:
-        prepare_foo
-
-     %.foo: %.bar tmp_phony
-        compute_foo $(TMP) $< $@
-     export A B .RULE
-
-.. index::
-   single: export
-.. _label6.3.1:
-
-6.3.1 区域のエクスポート
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-.. This feature was introduced in version 0.9.8.5.
-
-*この機能はバージョン0.9.8.5で導入されました。*
-
-.. The export directive does not need to occur at the end of a block. An export is valid from the point where it is specified to the end of the block in which it is contained. In other words, the export is used in the program that follows it. This can be especially useful for reducing the amount of code you have to write. In the following example, the variable CFLAGS is exported from the both branches of the conditional.
-
-``export`` 文はブロックの最後で実行する必要はありません。エクスポートはブロック中のブロックも、ブロックの終わりでエクスポートされます。言い換えると、 ``export`` はその文の次にくるプログラムでも用いられます。これはコード量を減らすという点で特に有用です。以下の例では、変数 ``CFLAGS`` は両方の条件分岐文からエクスポートされます。 ::
-
-    export CFLAGS
-    if $(equal $(OSTYPE), Win32)
-        CFLAGS += /DWIN32
-    else
-        CFLAGS += -UWIN32
-
-.. index::
-   single: export
-   single: return
-.. _label6.3.2:
-
-6.3.2 エクスポートされた区域から値を返す
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-.. This feature was introduced in version 0.9.8.5.
-
-*この機能はバージョン0.9.8.5で導入されました。*
-
-.. The use of export does not affect the value returned by a block. The value is computed as usual, as the value of the last statement in the block, ignoring the export. For example, suppose we wish to implement a table that maps strings to unique integers. Consider the following program.
-
-ブロックによって返された値は ``export`` を使用してもエクスポートされません。この値は普通に計算された場合、ブロック最後の状態の値として解釈されるので、エクスポートを無視します。例えば、私たちはマップの文字列をユニークな整数値に改良したテーブルを作りたいと思い、以下のプログラムを考えたとします。 ::
-
-    # 空のマップ
-    table = $(Map)
-
-    # テーブルにエントリーを追加
-    intern(s) =
-        export
-        if $(table.mem $s)
-            table.find($s)
-        else
-            private.i = $(table.length)
-            table = $(table.add $s, $i)
-            value $i
-
-    intern(foo)
-    intern(boo)
-    intern(moo)
-    # "boo = 1" と出力
-    println($"boo = $(intern boo)")
-
-.. Given a string s, the function intern returns either the value already associated with s, or assigns a new value. In the latter case, the table is updated with the new value. The export at the beginning of the function means that the variable table is to be exported. The bindings for s and i are not exported, because they are private.
-
-文字列 ``s`` が与えられると、関数 ``intern`` は ``s`` に既に関連付けられている値を返し、そうでない場合は新しい値を関連付けます。この場合、このテーブルは新しい値にアップデートされます。関数の初めに ``export`` をつけることによって、 ``table`` 変数はエクスポートされます。一方、 ``s`` や ``i`` に束縛されている値はプライベートなので、エクスポートされません。
-
-.. Evaluation in omake is eager. That is, expressions are evaluated as soon as they are encountered by the evaluator. One effect of this is that the right-hand-side of a variable definition is expanded when the variable is defined.
-
-omakeでの評価は先行して行われます。これは評価文に遭遇した場合、即座に式の評価が行われることを意味しています。この効果の一つとして、変数が定義されたときに、右側の変数定義が展開されることが挙げられます。 ::
-
-    osh> A = 1
-    - : "1"
-    osh> A = $(A)$(A)
-    - : "11"
-
-.. In the second definition, A = $(A)$(A), the right-hand-side is evaluated first, producing the sequence 11. Then the variable A is redefined as the new value. When combined with dynamic scoping, this has many of the same properties as conventional imperative programming.
-
-二番目の定義文の右側 ``A = $(A)$(A)`` がまず初めに評価されて、シーケンス ``11`` が生成されました。変数 ``A`` は新しい値として再定義されます。動的なスコーピングを用いて束縛した場合、これは従来の命令型プログラミングと同じ多くの特性を持ちます。 ::
-
-    osh> A = 1
-    - : "1"
-    osh> printA() =
-        println($"A = $A")
-    osh> A = $(A)$(A)
-    - : "11"
-    osh> printA()
-    11
-
-.. In this example, the print function is defined in the scope of A. When it is called on the last line, the dynamic value of A is 11, which is what is printed.
-
-この例では、出力関数は ``A`` のスコープ中で定義されます。最後の行でこの関数が呼び出されたとき、 ``A`` の動的な値は ``11`` であるので、この値が出力されます。
-
-.. However, dynamic scoping and imperative programming should not be confused. The following example illustrates a difference. The second printA is not in the scope of the definition A = x$(A)$(A)x, so it prints the original value, 1.
-
-しかしながら、動的なスコーピングと命令型のプログラミングは混同すべきではありません。以下の例では違いについて示しています。二番目の ``printA`` は ``A = x$(A)$(A)x`` が定義されているスコープには存在していませんので、この関数は元の値 ``1`` を出力します。 ::
-
-    osh> A = 1
-    - : "1"
-    osh> printA() =
-        println($"A = $A")
-    osh> section
-             A = x$(A)$(A)x
-             printA()
-    x11x
-    osh> printA()
-    1
-
-.. See also Section 7.5 for further ways to control the evaluation order through the use of “lazy” expressions.
-
-遅延評価式の使用で評価順序を制御する詳細については、":ref:`label7.5`"を参照してください。
-
-.. index::
-   single: オブジェクト
-   single: extends
-   single: class
-   single: instanceof
-.. _label6.4:
-
-6.4 オブジェクト
-----------------------------------
-.. omake is an object-oriented language. Everything is an object, including base values like numbers and strings. In many projects, this may not be so apparent because most evaluation occurs in the default toplevel object, the Pervasives object, and few other objects are ever defined.
-
-omakeはオブジェクト指向型言語です。数や文字列のような基本的な値を含むすべてがオブジェクトで表現されます。多くのプロジェクトの場合、通常のトップレベルのオブジェクト中でほとんどの式が評価されるため、これを見ることはあまりありませんが、 ``Pervasives`` オブジェクトと、2,3個の他のオブジェクトが最初から定義されています。
-
-.. However, objects provide additional means for data structuring, and in some cases judicious use of objects may simplify your project.
-
-しかしながら、オブジェクトはデータを構築するための追加手段を提供し、さらにオブジェクトを慎重に使用することで、あなたのプロジェクトをより簡単にしてくれるでしょう。
-
-.. Objects are defined with the following syntax. This defines name to be an object with several methods an values.
-
-オブジェクトは以下の構文で定義されます。これは ``name`` をいくつかのメソッドと値を持ったオブジェクトとして定義しています。 ::
-
-    name. =                     # += も同じくらいよく使います
-       extends parent-object    # なくても構いません
-       class class-name         # なくても構いません
-
-       # フィールド
-       X = value
-       Y = value
-
-       # メソッド
-       f(args) =
-          body
-       g(arg) =
-          body
-
-.. An extends directive specifies that this object inherits from the specified parent-object. The object may have any number of extends directives. If there is more than on extends directive, then fields and methods are inherited from all parent objects. If there are name conflicts, the later definitions override the earlier definitions.
-
-``extends`` 文はこのオブジェクトが指定された ``parent-object`` に継承されていることを指定します。オブジェクトは任意の数の ``extends`` 文を含めることができます。もし多くの ``extends`` 文が存在した場合、すべての親オブジェクトのメソッドとフィールドは継承されます。もし名前が衝突していた場合、前の定義は後の定義でオーバーライドされます。
-
-.. The class directive is optional. If specified, it defines a name for the object that can be used in instanceof operations, as well as :: scoping directives discussed below.
-
-``class`` 文はなくても構いません。指定されていた場合、 ``instanceof`` 演算子を使うことでオブジェクト名を新たに定義することができるようになります。これは下で議論する ``::`` スコープ文と同様です。
-
-.. The body of the object is actually an arbitrary program. The variables defined in the body of the object become its fields, and the functions defined in the body become its methods.
-
-オブジェクトには任意の内容のプログラムを記述できます。オブジェクトの中に定義された変数はフィールドと定義され、関数はメソッドと定義されます。
-
-.. index::
-   single: フィールド
-   single: メソッド
-.. _label6.5:
-
-6.5 フィールドとメソッドの呼び出し
-----------------------------------
-.. The fields and methods of an object are named using object.name notation. For example, let's define a one-dimensional point value.
-
-オブジェクトのフィールドとメソッドは ``object.name`` 表記を用いて命名されます。例えば、一次元の点の値について定義してみましょう。 ::
-
-   Point. =
-      class Point
-
-      # 通常の値
-      x = $(int 0)
-
-      # 新しい点を生成
-      new(x) =
-         x = $(int $(x))
-         return $(this)
-
-      # ひとつ進める
-      move() =
-         x = $(add $(x), 1)
-         return $(this)
-
-   osh> p1 = $(Point.new 15)
-   osh> value $(p1.x)
-   - : 15 : Int
-
-   osh> p2 = $(p1.move)
-   osh> value $(p2.x)
-   - : 16 : Int
-
-.. The $(this) variable always represents the current object. The expression $(p1.x) fetches the value of the x field in the p1 object. The expression $(Point.new 15) represents a method call to the new method of the Point object, which returns a new object with 15 as its initial value. The expression $(p1.move) is also a method call, which returns a new object at position 16.
-
-``$(this)`` は常に現在のオブジェクトに置き換える変数です。式 ``$(p1.x)`` はオブジェクト ``p1`` の ``x`` の値を呼び出します。式 ``$(Point.new 1)`` は ``Point`` オブジェクトの ``new`` メソッドを呼び出す式で、初期値として15が保持された新しいオブジェクトを返します。 ``$(p1.move)`` もメソッドの呼び出しで、16が保持された新しいオブジェクトを返します。
-
-.. Note that objects are functional — it is not possible to modify the fields or methods of an existing object in place. Thus, the new and move methods return new objects.
-
-オブジェクトは関数的であり、その場で存在しているオブジェクトのフィールドやメソッドを修正することは不可能であることに注意してください。よって、 ``new`` と ``move`` メソッドは新しいオブジェクトを返します。
-
-.. index::
-   single: オーバーライド
-.. _label6.6:
-
-6.6 メソッドのオーバーライド
-----------------------------------
-.. Suppose we wish to create a new object that moves by 2 units, instead of just 1. We can do it by overriding the move method.
-
-1つ移動させる代わりに、2つ移動させるメソッドを持った新しいオブジェクトを作ることについて考えてみましょう。 ``move`` メソッドをオーバーライドすることでこれを実現することができます。 ::
-
-   Point2. =
-      extends $(Point)
-
-      # moveメソッドをオーバーライド
-      move() =
-         x = $(add $(x), 2)
-         return $(this)
-
-   osh> p2 = $(Point2.new 15)
-   osh> p3 = $(p2.move)
-   osh> value $(p3.x)
-   - : 17 : Int
-
-.. However, by doing this, we have completely replaced the old move method.
-
-しかし、これを行うと古い ``move`` メソッドは完全に置き換わります。
-
-.. _label6.7:
-
-6.7 親の呼び出し
-----------------------------------
-.. Suppose we wish to define a new move method that just calls the old one twice. We can refer to the old definition of move using a super call, which uses the notation $(classname::name <args>). The classname should be the name of the superclass, and name the field or method to be referenced. An alternative way of defining the Point2 object is then as follows.
-
-新しい ``move`` メソッドを、古い ``old`` メソッドを二回呼び出すことで定義したい場合について考えてみましょう。これは表記 ``$(classname::name <args>)`` を用いることで親を呼び出すことができます。 ``classname`` は親クラスの名前で、 ``name`` のメソッドやフィールドが関連付けられている必要があります。それでは、 ``Point2`` オブジェクトを別の方法で定義してみましょう。 ::
-
-   Point2. =
-      extends $(Point)
-
-      # 古いメソッドを2回呼び出す
-      move() =
-         this = $(Point::move)
-         return $(Point::move)
-
-.. Note that the first call to $(Point::move) redefines the current object (the this variable). This is because the method returns a new object, which is re-used for the second call.
-
-最初の ``$(Point::move)`` の呼び出しは現在のオブジェクト( ``this`` 変数)を再定義していることに注意してください。なぜならこのメソッドは新しいオブジェクトを返し、二回目の呼び出しで再利用されるからです。
index 0fd15fb..34ff765 100644 (file)
--- a/index.rst
+++ b/index.rst
@@ -9,7 +9,7 @@
 ==================
 .. If you are new to OMake, you the omake-quickstart presents a short introduction that describes how to set up a project. The omake-build-examples gives larger examples of build projects, and omake-language-examples presents programming examples.
 
-あなたがOMakeを始めて使うのであれば、 :doc:`quickstart` はどのようにプロジェクトを始めるべきなのかについて、簡単に説明してくれるでしょう。 :doc:`build-examples` ではプロジェクトをビルドするための、より詳細なコードサンプルを紹介しています。そして :doc:`language` では実際にプログラミングするときに役立つ、いくつかの一例を紹介しています。
+あなたがOMakeを始めて使うのであれば、 :doc:`src/quickstart` はどのようにプロジェクトを始めるべきなのかについて、簡単に説明してくれるでしょう。 :doc:`src/build-examples` ではプロジェクトをビルドするための、より詳細なコードサンプルを紹介しています。そして :doc:`src/language` では実際にプログラミングするときに役立つ、いくつかの一例を紹介しています。
 
 1.1 注意事項
 ------------------
 .. toctree::
    :hidden:
    
-   quickstart
-   build-examples
-   language
-   language-naming
-   detail
-   language-examples
-   rules
-   base
-   system
-   shell
-   pervasives
-   build
-   autoconf
-   osh
-   omake-options
-   omake-grammar
+   src/quickstart
+   src/build-examples
+   src/language
+   src/language-naming
+   src/detail
+   src/language-examples
+   src/rules
+   src/base
+   src/system
+   src/shell
+   src/pervasives
+   src/build
+   src/autoconf
+   src/osh
+   src/omake-options
+   src/omake-grammar
 
 * :ref:`2. クイックスタート<label2>`
 
diff --git a/language-examples.rst b/language-examples.rst
deleted file mode 100644 (file)
index 42fd705..0000000
+++ /dev/null
@@ -1,502 +0,0 @@
-.. 7-language-examples
-
-.. index::
-   single: osh
-.. _label7:
-
-7. さらなる言語例
-=======================================
-.. In this section, we'll explore the core language through a series of examples (examples of the build system are the topic of the Chapter 3).
-
-この章では、一連の例を通して言語の核心へと迫ります(ビルドシステムのサンプルについては :ref:`label3` を参照してください)。
-
-.. For most of these examples, we'll use the osh command interpreter. For simplicity, the values printed by osh have been abbreviated.
-
-私たちはこれらの例のほとんどに ``osh`` インタープリターを用いています。また、簡単にするため、 ``osh`` によって出力された値は省略されています。
-
-.. _label7.1:
-
-7.1 文字列と配列
----------------------------------------
-.. The basic OMake values are strings, sequences, and arrays of values. Sequences are like arrays of values separated by whitespace; the sequences are split on demand by functions that expect arrays.
-
-OMakeの基本となる型は文字列とシーケンス、そして値からなる配列です。シーケンスはホワイトスペースによって分割された配列のようなもので、関数の要求に応じて分割されます。 ::
-
-   osh> X = 1 2
-   - : "1 2" : Sequence
-   osh> addsuffix(.c, $X)
-   - : <array 1.c 2.c> : Array
-
-.. Sometimes you want to define an array explicitly. For this, use the [] brackets after the variable name, and list each array entry on a single indented line.
-
-時々あなたは明示的に配列を定義したいと思うでしょう。この場合、 ``[]`` を変数名の後に追加し、配列の成分をそれぞれインデントされた行に書くことで実現できます。 ::
-
-   osh> A[] =
-           Hello world
-           $(getenv HOME)
-   - : <array "Hello world" "/home/jyh"> : Array
-
-.. One central property of arrays is that whitespace in the elements is significant. This can be useful, especially for filenames that contain whitespace. 
-
-配列は成分にホワイトスペースを含めることができます。これは配列の主要な特徴の一つであり、重要な役割を担います。また、これはホワイトスペースを含むファイル名にとって特に役立ちます。 ::
-
-   # ディレクトリ中の現在のファイルを並べる
-    osh> ls -Q
-    "fee"  "fi"  "foo"  "fum"
-    osh> NAME[] = 
-            Hello world
-    - : <array "Hello world"> : Array
-    osh> touch $(NAME)
-    osh> ls -Q
-    "fee"  "fi"  "foo"  "fum"  "Hello world"
-
-.. _label7.2:
-
-7.2 クオート文字列
----------------------------------------
-.. A String is a single value; whitespace is significant in a string. Strings are introduced with quotes. There are four kinds of quoted elements; the kind is determined by the opening quote. The symbols ' (single-quote) and " (double-quote) introduce the normal shell-style quoted elements. The quotation symbols are included in the result string. Variables are always expanded within a quote of this kind. Note that the osh(1) (Chapter 15) printer escapes double-quotes within the string; these are only for printing, they are not part of the string itself.
-
-``String`` は単一の値です。文字列の中でホワイトスペースは重要な意味を持っています。文字列をクオートするには4通りの方法があります。まず一番目にクオートをつけることが挙げられるでしょう。シンボル ``'`` (シングルクオート)と ``"`` (ダブルクオート)を用いることで、シェルを扱うときのように成分をクオートすることができます。クオーテーションシンボルは結果の文字列に **含まれます** 。変数は常に内部にクオートを含んだ状態で展開されます。 ``osh(1)`` (15章で説明)は文字列にダブルクオートをつけて出力しますが、これは出力時だけであり、文字列の中には含まれていないことに注意してください。 ::
-
-    osh> A = 'Hello "world"'
-    - : "'Hello \"world\"'" : String
-    osh> B = "$(A)"
-    - : "\"'Hello \"world\"'\"" : String
-    osh> C = 'Hello \'world\''
-    - : "'Hello 'world''" : String
-
-.. A second kind of quote is introduced with the $' and $" quotes. The number of opening and closing quote symbols is arbitrary. These quotations have several properties: 
-      * The quote delimiters are not part of the string.
-      * Backslash \ symbols within the string are treated as normal characters.
-      * The strings may span several lines.
-      * Variables are expanded within $" sequences, but not within $' sequences. 
-
-二番目の方法は ``$'`` と ``$"`` クオートを導入することです。始まりと終わりのクオートシンボルの数は任意です。また、これらのクオーテーションはいくつかの性質をもっています。
-
-* クオートデリミタは文字列の一部では **ありません** 。
-* 文字列中のバックスラッシュ ``\`` 文字は通常の文字として扱われます。
-* 文字列は何行にわたって書くこともできます。
-* 変数は ``$"`` を用いて展開することができます。ただし、 ``$'`` では展開できません。
-
-::
-
-    osh> A = $'''Here $(IS) an '''' \(example\) string['''
-    - : "Here $(IS) an '''' \\(example\\) string[" : String
-    osh> B = $""""A is "$(A)" """"
-    - : "A is \"Here $(IS) an '''' \\(example\\) string[\" " : String
-    osh> value $(A.length)
-    - : 38 : Int
-    osh> value $(A.nth 5)
-    - : "$" : String
-    osh> value $(A.rev)
-    - : "[gnirts )\\elpmaxe(\\ '''' na )SI($ ereH" : String
-
-.. Strings and sequences both have the property that they can be merged with adjacent non-whitespace text.
-
-文字列とシーケンスの両方はホワイトスペースが含まれていない文字列とくっつけることができます。 ::
-
-    osh> A = a b c
-    - : "a b c" : Sequence
-    osh> B = $(A).c
-    - : <sequence "a b c" : Sequence ".c" : Sequence> : Sequence
-    osh> value $(nth 2, $(B))
-    - : "c.c" : String
-    osh> value $(length $(B))
-    - : 3 : Int
-
-.. Arrays are different. The elements of an array are never merged with adjacent text of any kind. Arrays are defined by adding square brackets [] after a variable name and defining the elements with an indented body. The elements may include whitespace.
-
-配列は異なります。配列の成分はどのような方法を用いても文字列とくっつけることができません。配列は括弧 ``[]`` を変数名につけ、インデントした内容を記述することで成分を定義できます。各成分にはホワイトスペースを含めることもできます。 ::
-
-    osh> A[] =
-            a b
-            foo bar
-    - : <array
-           "a b" : Sequence
-           "foo bar" : Sequence>
-           : Array
-    osh> echo $(A).c
-    a b foo bar .c
-    osh> value $(A.length)
-    - : 2 : Int
-    osh> value $(A.nth 1)
-    - : "foo bar" : Sequence
-
-.. Arrays are quite helpful on systems where filenames often contain whitespace.
-
-配列はしばしばシステム上にホワイトスペースを含んだファイル名を使う場合において、非常に有用なツールとなります。 ::
-
-    osh> FILES[] =
-             c:\Documents and Settings\jyh\one file
-             c:\Program Files\omake\second file
-
-    osh> CFILES = $(addsuffix .c, $(FILES))
-    osh> echo $(CFILES)
-    c:\Documents and Settings\jyh\one file.c c:\Program Files\omake\second file.c
-
-.. _label7.3:
-
-7.3 ファイルとディレクトリ
----------------------------------------
-.. OMake projects usually span multiple directories, and different parts of the project execute commands in different directories. There is a need to define a location-independent name for a file or directory.
-
-複数のディレクトリにまたがっており、かつ異なったパートに分かれているOMakeのプロジェクト上では、まったく違うディレクトリ上でコマンドが実行されます。これはファイル、あるいはディレクトリの名前が位置的に独立して定義されている必要があることを表しています。
-
-.. This is done with the $(file <names>) and $(dir <names>) functions.
-
-この問題は ``$(file <names>)`` や ``$(dir <names>)`` 関数を用いて解決できます。 ::
-
-   osh> mkdir tmp
-   osh> F = $(file fee)
-   osh> section:
-            cd tmp
-            echo $F
-   ../fee
-   osh> echo $F
-   fee
-
-.. Note the use of a section: to limit the scope of the cd command. The section temporarily changes to the tmp directory where the name of the file is ../fee. Once the section completes, we are still in the current directory, where the name of the file is fee.
-
-``section:`` を用いて ``cd`` コマンドのスコープに制限を加えていることに注意してください。このセクションでは一時的に ``tmp`` ディレクトリに移動しているので、ファイルの名前には ``../fee`` が用いられます。このセクションが終了してカレントディレクトリに戻ってきたとき、ファイルの名前には ``fee`` が用いられます。
-
-.. One common way to use the file functions is to define proper file names in your project OMakefile, so that references within the various parts of the project will refer to the same file.
-
-ファイル関数を使う主な目的は、あなたのプロジェクトの ``OMakefile`` で、ファイル名が正しく定義されるようにするためです。これを用いればプロジェクト上の様々なパートに移動したとしても、変数は同一のファイルを指し示します。 ::
-
-    osh> cat OMakefile
-    ROOT = $(dir .)
-    TMP  = $(dir tmp)
-    BIN  = $(dir bin)
-    ...
-
-.. note::
-   訳注: file, dirについて詳しく知りたい方は ":ref:`label10.1.1`" を参照してください。
-
-.. index::
-   single: mapprefix()
-   single: addprefix()
-   single: addsuffix()
-   single: mapsuffix()
-   single: foreach()
-.. _label7.4:
-
-7.4 イテレーション、マップ、foreach
----------------------------------------
-.. Most builtin functions operate transparently on arrays.
-
-ほとんどのビルドイン関数では配列を何も考慮することなく処理できます。 ::
-
-    osh> addprefix(-D, DEBUG WIN32)
-    - : -DDEBUG -DWIN32 : Array
-    osh> mapprefix(-I, /etc /tmp)
-    - : -I /etc -I /tmp : Array
-    osh> uppercase(fee fi foo fum)
-    - : FEE FI FOO FUM : Array
-
-.. The mapprefix and addprefix functions are slightly different (the addsuffix and mapsuffix functions are similar). The addprefix adds the prefex to each array element. The mapprefix doubles the length of the array, adding the prefix as a new array element before each of the original elements.
-
-``mapprefix`` と ``addprefix`` 関数は全く異なります( ``addsuffix`` と ``mapsuffix`` 関数も同様です)。 ``addprefix`` 関数は接頭辞を各々の成分にくっつけます。 ``mapprefix`` 関数は元の成分の前に新しい接頭辞を成分として加えるので、配列の長さは2倍になります。
-
-.. Even though most functions work on arrays, there are times when you will want to do it yourself. The foreach function is the way to go. The foreach function has two forms, but the form with a body is most useful. In this form, the function takes two arguments and a body. The second argument is an array, and the first is a variable. The body is evaluated once for each element of the array, where the variable is bound to the element. Let's define a function to add 1 to each element of an array of numbers.
-
-ほとんどの関数は配列でも動きますが、あなた自身が配列にも対応した関数を作りたいと思うこともあるでしょう。 ``foreach`` 関数はその要望を実現します。 ``foreach`` 関数は二つの表記を使いますが、このコードを伴った表記法はとても便利です。この関数は二つの引数とコードが必要です。まず、一つ目の引数は変数で、二つ目のは配列を指定します。そして ``foreach`` のコードは各々の成分を対象に、引数で指定された変数がその成分に束縛された状態で、配列の長さぶんだけ実行されます。さあ、それでは値を持った配列の各々の成分に1を加える関数を定義してみましょう。 ::
-
-   osh> add1(l) =
-            foreach(i, $l):
-                add($i, 1)
-   osh> add1(7 21 75)
-   - : 8 22 76 : Array
-
-.. Sometimes you have an array of filenames, and you want to define a rule for each of them. Rules are not special, you can define them anywhere a statement is expected. Say we want to write a function that describes how to process each file, placing the result in the tmp/ directory.
-
-あなたはファイル名を持った配列を持ち、そのそれぞれにビルドルールを定義したいと思うこともあるでしょう。ビルドルールは特別なものではなく、あなたはどの箇所でもビルドルールを定義することができます。さて、私たちは配列にある、各々のファイルの処理について記述し、さらに結果を ``tmp/`` ディレクトリの中に置く関数を書きたいものとします。 ::
-
-   TMP = $(dir tmp)
-
-   my-special-rule(files) =
-      foreach(name, $(files))
-         $(TMP)/$(name): $(name)
-            process $< > $@
-
-.. Later, in some other part of the project, we may decide that we want to use this function to process some files.
-
-後に、プロジェクトの他の部分で、私たちはこの関数を用いていくつかのファイルを処理することを決めたとしましょう。 ::
-
-   # src/libに処理するためのファイルが入っています
-   MY_SPECIAL_FILES[] =
-       fee.src
-       fi.src
-       file with spaces in its name.src
-   my-special-rule($(MY_SPECIAL_FILES))
-
-.. The result of calling my-special-rule is exactly the same as if we had written the following three rules explicitly.
-
-``my-special-rule`` を呼んだ結果は、以下の3つのルールを明示的に書いた場合と全く同じになります。 ::
-
-    $(TMP)/fee.src: fee.src
-        process fee > $@
-    $(TMP)/fi.src: fi.src
-        process fi.src > $@
-    $(TMP)/$"file with spaces in its name.src": $"file with spaces in its name.src"
-        process $< > $@
-
-.. Of course, writing these rules is not nearly as pleasant as calling the function. The usual properties of function abstraction give us the usual benefits. The code is less redundant, and there is a single location (the my-special-rule function) that defines the build rule. Later, if we want to modify/update the rule, we need do so in only one location.
-
-もちろん、これらのルールを記述することは関数を呼ぶことより好ましいものではありません。関数を抽象化することによる普通の特性は、普通の利点となります。ビルドルールを定義するためのコードが一つだけで済み、コードはさらに短くなります。後でもし私たちがルールを修正したりアップデートしたいと思ったときも、単純に一つのルールを修正するだけでよいのです。
-
-.. index::
-   single: 遅延評価変数
-.. _label7.5:
-
-7.5 遅延評価式
----------------------------------------
-.. Evaluation in omake is normally eager. That is, expressions are evaluated as soon as they are encountered by the evaluator. One effect of this is that the right-hand-side of a variable definition is expanded when the variable is defined.
-
-omakeでの評価は通常の場合先行して行われます。これは、omakeが式に遭遇した場合、即座に評価が行われることを意味しています。この効果の一つとして、変数定義式の右側は、変数が定義される時点で展開されることが挙げられます。
-
-.. There are two ways to control this behavior. The $`(v) form introduces lazy behavior, and the $,(v) form restores eager behavior. Consider the following sequence.
-
-この振る舞いをコントロールするための2つの方法があります。 ``$`(v)`` は遅延評価を行うための、 ``$,(v)`` は先行評価に戻すための表記法です。以下のシーケンスについて考えてみましょう。 ::
-
-    osh> A = 1
-    - : "1" : Sequence
-    osh> B = 2
-    - : "2" : Sequence
-    osh> C = $`(add $(A), $,(B))
-    - : $(apply add $(apply A) "2" : Sequence)
-    osh> println(C = $(C))
-    C = 3
-    osh> A = 5
-    - : "5" : Sequence
-    osh> B = 6
-    - : "6" : Sequence
-    osh> println(C = $(C))
-    C = 7
-
-.. The definition C = $`(add $(A), $,(B)) defines a lazy application. The add function is not applied in this case until its value is needed. Within this expression, the value $,(B) specifies that B is to be evaluated immediately, even though it is defined in a lazy expression.
-
-``C = $`(add $(A), $,(B))`` では遅延評価を定義しています。 ``add`` 関数はこの場合、実際に値が必要となるときまで評価しません。上の式を見てみると、 ``$,(B)`` は ``B`` が即座に評価する変数であることを指定します。これが遅延評価式の中で定義されているにもかかわらずです。
-
-.. The first time that we print the value of C, it evaluates to 3 since A is 1 and B is 2. The second time we evaluate C, it evaluates to 7 because A has been redefined to 5. The second definition of B has no effect, since it was evaluated at definition time.
-
-最初私たちが ``C`` の値を出力したとき、 ``A`` は1で ``B`` が2であったので、結果は3と評価されました。次に私たちが同様に ``C`` を出力したとき、 ``A`` は5に再定義されていたので、結果は7と評価されました。二回目の ``B`` は ``C`` の定義時に評価されているため、なんの影響も与えていません。
-
-.. _label7.5.1:
-
-7.5.1 遅延評価式についての追加例
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-.. Lazy expressions are not evaluated until their result is needed. Some people, including this author, frown on overuse of lazy expressions, mainly because it is difficult to know when evaluation actually happens. However, there are cases where they pay off.
-
-遅延評価式は実際に結果が必要とされるときまで評価されません。筆者を含む結構な人数のプログラマは、遅延評価を多用しているコードを見ると眉をひそめます。なぜならこれは実際にどこで評価が行われているのか分かりにくくなるからです。しかしながら、これらの難点をペイオフできるケースも確かに存在します。
-
-.. One example comes from option processing. Consider the specification of “include” directories on the command line for a C compiler. If we want to include files from /home/jyh/include and ../foo, we specify it on the command line with the options -I/home/jyh/include -I../foo.
-
-一つの例としてオプションの処理が挙げられます。Cコンパイラに"include"ディレクトリの指定をコマンドライン上から指定する場合を考えましょう。もし私たちが"/home/jyh/include"と"../foo"上のファイルをインクルードしたい場合、コマンドラインにはオプション ``-I/home/jyh/include -I../foo`` を指定する必要があります。
-
-.. Suppose we want to define a generic rule for building C files. We could define a INCLUDES array to specify the directories to be included, and then define a generic implicit rule in our root OMakefile.
-
-Cファイルをビルドするための通常のルールを定義する場合について考えましょう。私たちはインクルードされるディレクトリを指定するため、 ``INCLUDES`` 配列を定義し、ルートの ``OMakefile`` に通常用いる暗黙のルールを定義しました。 ::
-
-    # Cファイルをコンパイルする通常の設定
-    CFLAGS = -g
-    INCLUDES[] =
-    %.o: %.c
-       $(CC) $(CFLAGS) $(INCLUDES) -c $<
-
-    # srcディレクトリは4つのソースファイルからmy_widgetをビルドします。
-    # これはインクルードディレクトリからインクルードファイルを読み込みます。
-    .SUBDIRS: src
-        FILES = fee fi foo fum
-        OFILES = $(addsuffix .o, $(FILES))
-        INCLUDES[] += -I../include
-        my_widget: $(OFILES)
-           $(CC) $(CFLAGS) -o $@ $(OFILES)
-
-.. But this is not quite right. The problem is that INCLUDES is an array of options, not directories. If we later wanted to recover the directories, we would have to strip the leading -I prefix, which is a hassle. Furthermore, we aren't using proper names for the directories. The solution here is to use a lazy expression. We'll define INCLUDES as a directory array, and a new variable PREFIXED_INCLUDES that adds the -I prefix. The PREFIXED_INCLUDES is computed lazily, ensuring that the value uses the most recent value of the INCLUDES variable.
-
-しかしこれは全く正しいというわけではありません。問題としては、 ``INCLUDES`` はオプションが格納されてある配列であり、ディレクトリではないという点です。もし私たちが後にディレクトリ名を変更したい場合は、まず ``-I`` 接頭辞を配列から分割する必要があり、これは混乱の元となります。さらに、私たちはディレクトリの絶対パスを使用していません。この問題を解決する方法は、遅延評価式を使うことです。まず私たちは ``INCLUDES`` をディレクトリの配列として定義し、さらに新しい変数 ``PREFIXED_INCLUDES`` を定義することによって ``-I`` 接頭辞を追加します。 ``PREFIXED_INCLUDES`` は遅延評価を行うことで、最新の ``INCLUDES`` 変数値が使われることを保証してくれます。 ::
-
-    # Cファイルをコンパイルする通常の設定
-    CFLAGS = -g
-    INCLUDES[] =
-    PREFIXED_INCLUDES[] = $`(addprefix -I, $(INCLUDES))
-    %.o: %.c
-       $(CC) $(CFLAGS) $(PREFIXED_INCLUDES) -c $<
-
-    # 今回の例では、私たちはインクルードディレクトリの絶対パスを定義しました。
-    STDINCLUDE = $(dir include)
-
-    # srcディレクトリは4つのソースファイルからmy_widgetをビルドします。
-    # これはインクルードディレクトリからインクルードファイルを読み込みます。
-    .SUBDIRS: src
-        FILES = fee fi foo fum
-        OFILES = $(addsuffix .o, $(FILES))
-        INCLUDES[] += $(STDINCLUDE)
-        my_widget: $(OFILES)
-           $(CC) $(CFLAGS) -o $@ $(OFILES)
-
-.. Note that there is a close connection between lazy values and functions. In the example above, we could equivalently define PREFIXED_INCLUDES as a function with zero arguments.
-
-遅延する値と関数が密接に繋がっていることに注目してください。上の例では、私たちは ``PREFIXED_INCLUDES`` を、引数を持たない関数として定義しているのと同じことを行っています。 ::
-
-    PREFIXED_INCLUDES() =
-        addprefix(-I, $(INCLUDES))
-
-.. index::
-   single: while
-.. _label7.6:
-
-7.6 スコープとエクスポート
----------------------------------------
-.. The OMake language is functional (apart from IO and shell commands). This comes in two parts: functions are first-class, and variables are immutable (there is no assignment operator). The latter property may seem strange to users used to GNU make, but it is actually a central point of OMake. Since variables can't be modified, it is impossible (or at least hard) for one part of the project to interfere with another.
-
-OMakeの言語は(IOとシェルコマンドは除きますが)関数型言語となっています。これは、まず関数が最上級のものであることと、変数が不変なものである(代入という操作が存在しない)という2つから、そうであると言えるでしょう。後者に関しては、おそらく従来のGNU makeを使っていたユーザからすると奇妙なものに思えるかもしれません。しかしこれは実際にOMakeを使う上で非常に重要な点となります。変数は修正できませんので、プロジェクトの一部分が他の部分に干渉することは不可能(あるいは非常に困難)です。
-
-.. To be sure, pure functional programming can be awkward. In OMake, each new indentation level introduces a new scope, and new definitions in that scope are lost when the scope ends. If OMake were overly strict about scoping, we would wind up with a lot of convoluted code.
-
-これを従来の純粋な関数型言語のように実装してしまうと、非常に使いにくいものになるかもしれません。OMakeでは、インデントすることでレベルを一つ挙げた場合、新しいスコープが導入されます。そしてスコープが終わると、そのスコープで新しく定義された変数は消去されます。もしOMakeが馬鹿真面目にスコープに関して厳格な仕様であったなら、おそらくコードはもっと複雑なものになったでしょう。 ::
-
-   osh> X = 1
-   osh> setenv(BOO, 12)
-   osh> if $(equal $(OSTYPE), Win32)
-            setenv(BOO, 17)
-            X = 2
-   osh> println($X $(getenv BOO))
-   1 12
-
-.. The export command presents a way out. It takes care of “exporting” a value (or the entire variable environment) from an inner scope to an outer one.
-
-``export`` コマンドはこの制限を外に出します。このコマンドは内部のスコープの値(あるいは全体の変数環境)を外部に『エクスポート』するお世話をします。 ::
-
-   osh> X = 1
-   osh> setenv(BOO, 12)
-   osh> if $(equal $(OSTYPE), Win32)
-            setenv(BOO, 17)
-            X = 2
-            export
-   osh> println($X $(getenv BOO))
-   2 17
-
-.. Exports are especially useful in loop to export values from one iteration of a loop to the next.
-
-エクスポートは、ループ中のイテレーションから次のイテレーションへ値をエクスポートするのに特に役立ちます。 ::
-
-   # オーケー、それでは配列の各成分を足し合わせてみよう
-   osh>sum(l) =
-           total = 0
-           foreach(i, $l)
-               total = $(add $(total), $i)
-           value $(total)
-   osh>sum(1 2 3)
-   - : 0 : Int
-
-   # おっと、正常に動いていないじゃないか!
-   osh>sum(l) =
-           total = 0
-           foreach(i, $l)
-               total = $(add $(total), $i)
-               export
-           value $(total)
-   osh>sum(1 2 3)
-   - : 6 : Int
-
-.. A while loop is another form of loop, with an auto-export.
-
-``while`` ループは自動的にエクスポートしてくれる、別の形のループ文です。 ::
-
-    osh>i = 0
-    osh>total = 0
-    osh>while $(lt $i, 10)
-            total = $(add $(total), $i)
-            i = $(add $i, 1)
-    osh>println($(total))
-    45
-
-.. index::
-   single: シェルエイリアス
-   single: Shell
-.. _label7.7:
-
-7.7 シェルエイリアス
----------------------------------------
-.. Sometimes you may want to define an alias, an OMake command that masquerades as a real shell command. You can do this by adding your function as a method to the Shell object.
-
-ときどきあなたは *エイリアス* を定義したいと思うことがあるかもしれません。そのためにOMakeでは、実際にシェルコマンドが存在しているかのようにふるまうコマンドが存在します。あなたはこれを、 ``Shell`` オブジェクトに対象の関数を追加することで実現できます。
-
-.. For an example, suppose we use the awk function to print out all the comments in a file.
-
-例えば、 ``awk`` 関数を用いて、あるファイル中のすべてのコメントを出力する場合について考えてみましょう。 ::
-
-    osh>cat comment.om
-    # Comment function
-    comments(filename) =
-        awk($(filename))
-        case $'^#'
-            println($0)
-    # File finished
-    osh>include comment
-    osh>comments(comment.om)
-    # Comment function
-    # File finished
-
-.. To add it as an alias, add the method (using += to preserve the existing entries in the Shell).
-
-これをエイリアスとして追加するには、 ``Shell`` オブジェクトにメソッドを追加します。 ``+=`` を用いて、シェルの既存の内容を保存している点に注意してください。 ::
-
-   osh>Shell. +=
-           printcom(argv) =
-               comments($(nth 0, $(argv)))
-   osh>printcom comment.om > output.txt
-   osh>cat output.txt
-   # Comment function
-   # File finished
-
-.. A shell command is passed an array of arguments argv. This does not include the name of the alias.
-
-シェルコマンドは引数として配列 ``argv`` が渡されます。これはエイリアスの名前には *含まれていません* 。
-
-.. index::
-   single: リダイレクション
-   single: stdin
-   single: stdout
-   single: stderr
-.. _label7.8:
-
-7.8 簡単に入出力のリダイレクションを行う
------------------------------------------
-.. As it turns out, scoping also provides a nice alternate way to perform redirection. Suppose you have already written a lot of code that prints to the standard output channel, but now you decide you want to redirect it. One way to do it is using the technique in the previous example: define your function as an alias, and then use shell redirection to place the output where you want.
-
-結果的に、スコーピングによってリダイレクションの実行に関しての良い代替案も表れることとなりました。それでは、既に標準の出力先に出力するコードが大量にあるが、この出力先のリダイレクションを行いたいというような場合について考えてみましょう。まず一つ目の方法としては、前回のテクニックを用いることが挙げられます。具体的には、関数をエイリアスとして定義し、あなたが望む出力先にすることでシェルのリダイレクションを行うといった方法です。
-
-.. There is an alternate method that is easier in some cases. The variables stdin, stdout, and stderr define the standard I/O channels. To redirect output, redefine these variables as you see fit. Of course, you would normally do this in a nested scope, so that the outer channels are not affected.
-
-別の方法については、前者の方法よりも簡単な場合があります。変数 ``stdin`` ``stdout`` ``stderr`` は標準I/Oの出力先について定義しています。出力先をリダイレクトするには、これらの変数をあなたが望むように再定義します。もちろん、あなたはこれを普通にネストされたスコープ上で行うことができるので、外部の出力先に影響を与えることはありません。 ::
-
-    osh>f() =
-            println(Hello world)
-    osh>f()
-    Hello world
-    osh>section:
-            stdout = $(fopen output.txt, w)
-            f()
-            close($(stdout))
-    osh>cat output.txt
-    Hello world
-
-.. This also works for shell commands. If you like to gamble, you can try the following example.
-
-これはシェルコマンドに対しても同様です。もしあなたがギャンブル好きであるならば、以下の例を試してみるのもいいでしょう。 ::
-
-    osh>f() =
-            println(Hello world)
-    osh>f()
-    Hello world
-    osh>section:
-            stdout = $(fopen output.txt, w)
-            f()
-            cat output.txt
-            close($(stdout))
-    osh>cat output.txt
-    Hello world
-    Hello world
-
diff --git a/language-naming.rst b/language-naming.rst
deleted file mode 100644 (file)
index 78209e1..0000000
+++ /dev/null
@@ -1,266 +0,0 @@
-.. 5-language-naming
-
-.. index::
-   single: 修飾子
-   single: 名前空間
-.. _label5:
-
-5. 変数と名前空間
-==================================
-.. During evaluation, there are three different kinds of namespaces. Variables can be private, or they may refer to fields in the current this object, or they can be part of the global namespace. The namespace can be specified directly by including an explicit qualifier before the variable name. The three namespaces are separate; a variable can be bound in one or more simultaneously.
-
-コードを評価する際、OMakeの変数には3つの異なる種類の名前空間があります。変数は *プライベート* なものにしたり、 *現在の* オブジェクトのフィールドを参照したり、 *グローバル* な名前空間の一部として用いることができます。名前空間を指定するには、変数名の前に修飾子を直接明示する必要があります。この3つの名前空間は分割されており、変数は一つ、あるいはさらに多くの名前空間に束縛することができます。 ::
-
-    # プライベートな名前空間
-    private.X = 1
-    # 現在のオブジェクト
-    this.X = 2
-    # パブリック、グローバルに定義された名前空間
-    global.X = 3
-
-.. index::
-   single: private.
-   single: export
-.. _label5.1:
-
-5.1 private.
-----------------------------------
-.. The private. qualifier is used to define variables that are private to the current file/scope. The values are not accessible outside the scope. Private variables are statically (lexically) scoped.
-
-``private.`` 修飾子は変数が現在のファイルやスコープ上でプライベートなものであると定義したい場合に用います。値は外部のスコープから参照することができません。プライベートな変数は静的にスコープされています。 ::
-
-    Obj. =
-       private.X = 1
-
-       print() =
-          println(The value of X is: $X)
-
-    # 出力:
-    #    The private value of X is: 1
-    Obj.print()
-
-    # XはObj内のプライベート変数なので、エラーとなります
-    y = $(Obj.X)
-
-.. In addition, private definitions do not affect the global value of a variable.
-
-加えて、プライベート変数はグローバルな変数の値に影響を及ぼしません。 ::
-
-   # パブリックなxの値は1
-   x = 1
-
-   # このオブジェクトはxのプライベートな値を使用しています
-   Obj. =
-       private.x = 2
-
-       print() =
-          x = 3
-          println(The private value of x is: $x)
-          println(The public value of x is: $(public.x))
-          f()
-
-   # 出力:
-   #    The private value of x is: 3
-   #    The public value of x is: 1
-   Obj.print()
-
-.. Private variables have two additional properties.
-
-     1. Private variables are local to the file in which they are defined.
-     2. Private variables are not exported by the export directive, unless they are mentioned explicitly.
-
-プライベート変数は2つの性質を持っています。
-
-#. プライベート変数は定義されたファイルしか参照できません。
-#. プライベート変数はたとえ明示的に ``export`` 文を使用したとしてもエクスポートできません。 ::
-
-         private. =
-            FLAG = true
-
-         section
-            FLAG = false
-            export
-
-         # FLAGはまだtrueです
-         section
-            FLAG = false
-            export FLAG
-
-         # FLAGは現在falseです
-
-.. index::
-   single: this.
-.. _label5.2:
-
-5.2 this.
-----------------------------------
-.. The this. qualifier is used to define fields that are local to an object. Object variables are dynamically scoped.
-
-``this.`` 修飾子はオブジェクトのローカルなフィールドについて定義したい場合に用います。オブジェクト変数は動的にスコープされます。 ::
-
-    X = 1
-    f() =
-       println(The public value of X is: $(X))
-
-    # 出力:
-    #    The public value of X is: 2
-    section
-       X = 2
-       f()
-
-    # Xはオブジェクト中の保護されたフィールドを表しています。
-    Obj. =
-       this.X = 3
-
-       print() =
-          println(The value of this.X is: $(X))
-          f()
-
-    # 出力:
-    #    The value of this.X is: 3
-    #    The public value of X is: 1
-    Obj.print()
-
-    # この文は正しく、Yには3が束縛されます。
-    Y = $(Obj.X)
-
-.. In general, it is a good idea to define object variables as protected. The resulting code is more modular because variables in your object will not produce unexpected clashes with variables defined in other parts of the project.
-
-一般的に、保護されたオブジェクト変数を定義することは良いこととされています。プロジェクトの他の部分で定義された変数と被ってしまったために起こる、意図しないバグを生み出さないためです。結果として、コードはよりモジュール化されます。
-
-.. index::
-   single: global.
-.. _label5.3:
-
-5.3 global.
-----------------------------------
-.. The global. qualifier is used to specify global dynamically-scoped variables. In the following example, the global. definition specifies that the binding X = 4 is to be dynamically scoped. Global variables are not defined as fields of an object.
-
-``global.`` 修飾子はグローバルに動的なスコープを持つ変数を定義したい場合に用います。以下の例では、 ``global.`` 宣言は束縛文 ``X = 4`` が動的にスコープされた変数であることを指定しています。グローバル変数はオブジェクトのフィールドとして定義することが *できません* 。 ::
-
-    X = 1
-    f() =
-       println(The global value of X is: $(X))
-
-    # 出力:
-    #    The global value of X is: 2
-    section
-       X = 2
-       f()
-
-    Obj. =
-       protected.X = 3
-
-       print() =
-          println(The protected value of X is: $(X))
-          global.X = 4
-          f()
-
-    # 出力:
-    #    The protected value of X is: 3
-    #    The global value of X is: 4
-    Obj.print()
-
-.. index::
-   single: protected.
-.. _label5.4:
-
-5.4 protected.
-----------------------------------
-.. In OMake 0.9.8, protected is a synonym for this.
-
-OMake 0.9.8では、 ``protected`` は ``this`` 修飾子と同義語でした。 ::
-
-    osh>protected.x = 1
-    - : "1" : Sequence
-    osh>value $(this.x)
-    - : "1" : Sequence
-
-.. In 0.9.9, this will change, so that the qualifier protected means (in 0.9.9) that a variable is local to the current object or file, and may not be accessed outside it.
-
-0.9.9ではこの仕様は変更されて、 ``protected`` 修飾子は変数が現在のオブジェクトまたはファイルについてのローカル変数とし、外部からアクセスできないようにしたい場合に用います。
-
-.. index::
-   single: public.
-.. _label5.5:
-
-5.5 public.
-----------------------------------
-.. In OMake 0.9.8, public is a synonym for global.
-
-OMake 0.9.8では、 ``public`` は ``global`` 修飾子と同義語でした。 ::
-
-    osh>public.x = 1
-    - : "1" : Sequence
-    osh>value $(global.x)
-    - : "1" : Sequence
-
-.. In 0.9.9, this will change, so that the qualifier public means (in 0.9.9) that a variable is to be accessible from outside the current file or object.
-
-0.9.9ではこの仕様は変更されて、 ``public`` 修飾子は変数が現在のファイルまたはオブジェクトの外部からアクセスできるようにしたい場合に用います。
-
-.. _label5.6:
-
-5.6 修飾されたブロック
-----------------------------------
-.. If several qualified variables are defined simultaneously, a block form of qualifier can be defined. The syntax is similar to an object definition, where the name of the object is the qualifier itself. For example, the following program defines two private variables X and Y.
-
-いくつかの修飾された変数が同時に定義された場合、修飾子のブロックが優先的に定義されます。構文はオブジェクトの定義と似ていますが、それはオブジェクト名それ自体が修飾子だからです。例えば、以下のプログラムはプライベート変数 ``X`` と ``Y`` を定義しています。 ::
-
-    private. =
-        X = 1
-        Y = 2
-
-.. The qualifier specifies a default namespace for new definitions in the block. The contents of the block is otherwise completely general.
-
-修飾子はブロック内で新しく定義された変数の、デフォルトの名前空間を指定しています。その違いを除いて、ブロックの内容は完全に通常のコードとしてふるまいます。 ::
-
-    private. =
-        X = 1
-        Y = 2
-        public.Z = $(add $X, $Y)
-        # "The value of Z is 3" と出力される
-        echo The value of Z is $Z
-
-.. index::
-   single: declare
-   single: 明示的に修飾されていない変数
-.. _label5.7:
-
-5.7 変数宣言
-----------------------------------
-.. When a variable name is unqualified, its namespace is determined by the most recent definition or declaration that is in scope for that variable. We have already seen this in the examples, where a variable definition is qualified, but the subsequent uses are not qualified explicitly. In the following example, the first occurrence of $X refers to the private definition, because that is the most recent. The public definition of X is still 0, but the variable must be qualified explicitly.
-
-変数名が修飾されていない場合、その名前空間は最も近くで定義された名前空間か、この変数が定義されているスコープの名前空間が用いられます。私たちは以前すでにこの現象を例を通して見ています。その例では、変数の定義が修飾されていても、その後に来る変数は明示的に修飾されていなかったはずです。以下の例では、最初に宣言された ``$X`` は *プライベート* な変数 ``$(private.X)`` が関連付けられています。なぜならこれは最も近くで定義されているからです。パブリックな変数 ``X`` は未だに ``0`` であり、この変数を指定するためには明示的に修飾しなければなりません。 ::
-
-    public.X = 0
-    private.X = 1
-    
-    public.print() =
-        println(The value of private.X is: $X)
-        println(The value of public.X is: $(public.X))
-
-.. Sometimes it can be useful to declare a variable without defining it. For example, we might have a function that uses a variable X that is to be defined later in the program. The declare directive can be used for this.
-
-時々、修飾子を定義する事なしに変数宣言することが有効である場合があります。例えば、私たちはプログラムの後ろで定義された変数 ``X`` を用いる関数を持っていたとしましょう。 ``declare`` 文はこのような場合に使うことができます。 ::
-
-    declare public.X
-
-    public.print() =
-        println(The value of X is $X)
-
-    # "The value of X is 2" と出力される
-    X = 2
-    print()
-
-.. Finally, what about variables that are used but not explicitly qualified? In this case, the following rules are used.
-
-      * If the variable is a function parameter, it is private.
-      * If the variable is defined in an object, it is qualified with this..
-      * Otherwise, the variable is public. 
-
-最後に、明示的に修飾されていない変数についてはどうなるのでしょうか?このような場合、以下のルールが用いられます。
-
-* もし変数が関数の引数ならば、その変数はプライベートとなります。
-* もし変数がオブジェクト中で定義されているならば、 ``this.`` 修飾子で定義されます。
-* それ以外はすべてパブリックとなります。
diff --git a/language.rst b/language.rst
deleted file mode 100644 (file)
index c07b5d6..0000000
+++ /dev/null
@@ -1,947 +0,0 @@
-.. 4-language
-
-.. _label4:
-
-4. OMake言語の概要と構文
-==================================
-.. Projects are specified to omake with OMakefiles. The OMakefile has a format similar to a Makefile. An OMakefile has three main kinds of syntactic objects: variable definitions, function definitions, and rule definitions.
-
-プロジェクトは ``OMakefile`` を用いてomakeにどのようにビルドするのか指定しており、構文は ``Makefile`` と似ています。 ``OMakefile`` は3つの構文規則『変数の定義』『関数の定義』『ルールの定義』を持ち合わせています。
-
-.. index::
-   single: 変数
-.. _label4.1:
-
-4.1 変数
--------------
-.. Variables are defined with the following syntax. The name is any sequence of alphanumeric characters, underscore _, and hyphen -.
-
-変数は以下のような構文で定義されます。変数名は任意のアルファベットとアンダースコア ``_`` 、ハイフン ``-`` を用いることができます。 ::
-
-   <name> = <value>
-
-.. Values are defined as a sequence of literal characters and variable expansions. A variable expansion has the form $(<name>), which represents the value of the <name> variable in the current environment. Some examples are shown below.
-
-値(value)にはリテラル文字と展開された変数が定義できます。変数の展開は ``$(name)`` のような形で表されて、 ``<name>`` 変数は現在の環境下において ``<value>`` に置き換わります。いくつかの例を以下に示します。 ::
-
-   CC = gcc
-   CFLAGS = -Wall -g
-   COMMAND = $(CC) $(CFLAGS) -O2
-
-.. In this example, the value of the COMMAND variable is the string gcc -Wall -g -O2.
-
-この例では、 ``COMMAND`` 変数の値は文字列 ``gcc -Wall -g -O2`` となります。
-
-.. Unlike make(1), variable expansion is eager and pure (see also the section on Scoping). That is, variable values are expanded immediately and new variable definitions do not affect old ones. For example, suppose we extend the previous example with following variable definitions.
-
-``make(1)`` とは違い、変数の展開は *先行して(eager)* 行われ、 *純粋な(pure)* メカニズムとなっています(詳細は ":ref:`label4.8`",":ref:`label6.1`" を参照してください)。これはつまり、変数の値は即座に展開されることによって、新しい変数への束縛が古い値に影響されないことを意味しています。例えば、前回の例を以下のような変数の束縛に拡張した場合について考えてみましょう。 ::
-
-   X = $(COMMAND)
-   COMMAND = $(COMMAND) -O3
-   Y = $(COMMAND)
-
-.. In this example, the value of the X variable is the string gcc -Wall -g -O2 as before, and the value of the Y variable is gcc -Wall -g -O2 -O3.
-
-この例では、変数 ``X`` の値は前回のように文字列 ``gcc -Wall -g -O2`` が定義されて、変数 ``Y`` の値は ``gcc -Wall -g -O2 -O3`` となります。
-
-.. _label4.2:
-
-4.2 変数に値を追加
----------------------
-.. Variables definitions may also use the += operator, which adds the new text to an existing definition. The following two definitions are equivalent.
-
-変数はまた、既存の変数に新しい文字列を追加する演算子 ``+=`` を用いることができます。例えば、以下の2つの文は等価です。 ::
-
-   # CLAGS変数にオプションを追加
-   CFLAGS = $(CFLAGS) -Wall -g
-
-   # 上と下の束縛は等価です
-   CFLAGS += -Wall -g
-
-.. index::
-   single: 配列
-.. _label4.3:
-
-4.3 配列
----------------------
-.. Arrays can be defined by appending the [] sequence to the variable name and defining initial values for the elements as separate lines. Whitespace is significant on each line. The following code sequence prints c d e.
-
-配列は変数名の後ろに ``[]`` を追加し、初期値を改行を用いて要素を指定することで定義できます。各々の行でのスペースはOMakeにおいて重要な役割を担っています。例えば、以下のコードは文字列 ``c d e`` が出力されます。 ::
-
-    X[] =
-        a b
-        c d e
-        f
-
-    println($(nth 2, $(X)))
-
-.. index::
-   single: 特殊文字
-   single: クオーティング
-.. _label4.4:
-
-4.4 特殊文字とクオート
------------------------
-.. The following characters are special to omake: $():,=#\. To treat any of these characters as normal text, they should be escaped with the backslash character \.
-
-文字 ``$():,=#\`` はOMakeの特殊文字に指定されています。これらの文字を通常の文字としてOMakeで扱うためには、バックスラッシュ文字 ``\`` でエスケープする必要があります。 ::
-
-    DOLLAR = \$
-
-.. Newlines may also be escaped with a backslash to concatenate several lines.
-
-文字列を連結させるために、改行もまたエスケープする必要があります。 ::
-
-    FILES = a.c\
-            b.c\
-            c.c
-
-.. Note that the backslash is not an escape for any other character, so the following works as expected (that is, it preserves the backslashes in the string).
-
-バックスラッシュは他の文字でエスケープする必要が *ない* ことに注意してください。よって以下のような例は正常に動作します(これはつまり、文字列中のバックスラッシュが正常に保たれていることを表しています)。 ::
-
-    DOSTARGET = C:\WINDOWS\control.ini
-
-.. An alternative mechanism for quoting special text is the use $"..." escapes. The number of double-quotations is arbitrary. The outermost quotations are not included in the text.
-
-ある文章をクオーティングしたい場合は ``"#..."`` エスケープを使用します。ダブルクオーテーションの数は任意で、最も外側のクオーテーションは文字列に含まれません。 ::
-
-    A = $""String containing "quoted text" ""
-    B = $"""Multi-line
-        text.
-        The # character is not special"""
-
-.. index::
-   single: 関数定義
-   single: return
-   single: value
-.. _label4.5:
-
-4.5  関数定義
-----------------
-.. Functions are defined using the following syntax.
-
-関数は以下のような構文を用いて定義されます。 ::
-
-   <name>(<params>) =
-      <indented-body>
-
-.. The parameters are a comma-separated list of identifiers, and the body must be placed on a separate set of lines that are indented from the function definition itself. For example, the following text defines a function that concatenates its arguments, separating them with a colon.
-
-パラメータは識別のためにカンマを用いて分割し、コードは関数定義からインデントした状態で、別の行に設置する必要があります。例えば、以下のコードは引数 ``a`` と ``b`` をコロンを用いて結びつける関数について定義しています。 ::
-
-    ColonFun(a, b) =
-        return($(a):$(b))
-
-.. The return expression can be used to return a value from the function. A return statement is not required; if it is omitted, the returned value is the value of the last expression in the body to be evaluated.
-
-``return`` は関数から値を返す命令文です。 ``return`` 文は必須ではありません。この文が除外された場合、最後に関数が評価した命令文の返り値が返されます。 
-
-..  NOTE: as of version 0.9.6, return is a control operation, causing the function to immediately return. In the following example, when the argument a is true, the function f immediately returns the value 1 without evaluating the print statement.
-
-.. warning::
-  バージョン0.9.6から ``return`` 文は関数を制御する命令文となりましたので、return文が呼ばれた場合、関数はただちに値を返して終了します。以下の例では引数 ``a`` が ``true`` であったのなら、関数 ``f`` はただちにprint文を評価することなく値1を返します。 ::
-
-    f(a) =
-       if $(a)
-          return 1
-       println(The argument is false)
-       return 0
-
-.. In many cases, you may wish to return a value from a section or code block without returning from the function. In this case, you would use the value operator. In fact, the value operator is not limited to functions, it can be used any place where a value is required. In the following definition, the variable X is defined as 1 or 2, depending on the value of a, then result is printed, and returned from the function.
-
-多くの場合、あなたは関数から直接値を返さずに、セクションやネストされたコードブロックから値を返したいと思うことがあるでしょう。このような場合に、あなたは ``value`` 演算子を使用できます。実際、 ``value`` 演算子は関数だけに限らず、値が必要となった場合はどこでも使用することができます。以下の定義では、変数 ``X`` は ``a`` の値に依存して1か2が束縛されて、結果を出力し、関数から値を返します。 ::
-
-    f_value(a) =
-       X =
-          if $(a)
-             value 1
-          else
-             value 2
-       println(The value of X is $(X))
-       value $(X)
-
-.. Functions are called using the GNU-make syntax, $(<name> <args)), where <args> is a comma-separated list of values. For example, in the following program, the variable X contains the value foo:bar.
-
-関数はGNU-makeの構文 ``$(<name> <args>)`` を用いて呼び出します。 ``<args>`` はカンマで分割された値のリストです。例えば、以下のプログラムでは、変数 ``X`` は値 ``foo:bar`` を含みます。 ::
-
-   X = $(ColonFun foo, bar)
-
-.. If the value of a function is not needed, the function may also be called using standard function call notation. For example, the following program prints the string “She says: Hello world”.
-
-関数の戻り値を必要としない場合には、通常の関数表記を用いて関数を呼び出すこともできます。例えば、以下のプログラムでは文字列“She says: Hello world”を出力します。 ::
-
-    Printer(name) =
-        println($(name) says: Hello world)
-    
-    Printer(She)
-
-.. index::
-   single: コメント
-.. _label4.6:
-
-4.6 コメント
-----------------
-.. Comments begin with the # character and continue to the end of the line.
-
-コメントは ``#`` 文字から始まり、行の末尾まで続きます。
-
-.. index::
-   single: include
-   single: open
-.. _label4.7:
-
-4.7 ファイルのインクルード
------------------------------
-.. Files may be included with the include or open form. The included file must use the same syntax as an OMakefile.
-
-ファイルのインクルードには ``include`` か ``open`` 文を使います。インクルードされたファイルは ``OMakefile`` として、同じ構文で使用できます。 ::
-
-    include $(Config_file)
-
-.. The open operation is similar to an include, but the file is included at most once. 
-
-``open`` 文は ``include`` と似ていますが、一回しかインクルードされないのが特徴です。 ::
-
-    open Config
-    
-    # 2回目のopenは無視されますので、
-    # この行はなんの影響も与えません。
-    open Config
-
-.. If the file specified is not an absolute filenmame, both include and open operations search for the file based on the OMAKEPATH variable. In case of the open directive, the search is performed at parse time, and the argument to open may not contain any expressions.
-
-ファイル名が絶対パスで指定されていない場合、 ``include`` と ``open`` 文の両方は ``OMAKEPATH`` 変数上のパスを探します。 ``open`` 文の場合、この検索は *パースする際に実行される* ので、 ``open`` の引数に他の式を含める必要はありません。
-
-.. index::
-   single: section
-   single: export
-.. _label4.8:
-
-4.8 スコーピング、セクション
--------------------------------
-.. Scopes in omake are defined by indentation level. When indentation is increased, such as in the body of a function, a new scope is introduced.
-
-omakeのスコープはインデントのレベルで定義されます。インデントレベルが上がると、omakeでは新しいスコープが導入されます。
-
-.. The section form can also be used to define a new scope. For example, the following code prints the line X = 2, followed by the line X = 1.
-
-``section`` 文は新しいスコープを追加したい場合に有効です。例えば、以下のコードは ``X = 2`` を出力した後で、 ``X = 1`` を出力します。 ::
-
-    X = 1
-    section
-        X = 2
-        println(X = $(X))
-
-    println(X = $(X))
-
-.. This result may seem surprising–the variable definition within the section is not visible outside the scope of the section.
-
-この結果について驚くかもしれませんが─ ``section`` 内での変数の束縛は外部のスコープには影響を及ぼしていないのです。
-
-.. The export form, which will be described in detail in Section 6.3, can be used to circumvent this restriction by exporting variable values from an inner scope. For example, if we modify the previous example by adding an export expression, the new value for the X variable is retained, and the code prints the line X = 2 twice.
-
-":ref:`label6.3`" で説明する ``export`` 文を使えば、内部スコープの変数をエクスポートすることでこの制限から抜け出すことができます。例えば、私たちが前回のサンプルに ``export`` 文を追加した場合、変数 ``X`` の新しい値が返されて、 ``X = 2`` が2回出力されます。 ::
-
-    X = 1
-    section
-        X = 2
-        println(X = $(X))
-        export
-
-    println(X = $(X))
-
-.. There are also cases where separate scoping is quite important. For example, each OMakefile is evaluated in its own scope. Since each part of a project may have its own configuration, it is important that variable definitions in one OMakefile do not affect the definitions in another.
-
-分離されたスコープが非常に重要な結果を及ぼす場合があります。例えば、各々の ``OMakefile`` はそれ自身のスコープで評価されます。つまり各々のプロジェクトの一部は独立した設定となっているので、一つの ``OMakefile`` で変数を定義しても、これは他の ``OMakefile`` の定義に影響を及ぼしません。
-
-.. To give another example, in some cases it is convenient to specify a separate set of variables for different build targets. A frequent idiom in this case is to use the section command to define a separate scope.
-
-別の例を見てみましょう。異なったビルドターゲットを指定するために、変数を分割するほうが便利である場合を考えます。この場合の頻繁に使う慣用句として、分割されたスコープを定義する ``section`` 文を使用することが挙げられます。 ::
-
-   section
-      CFLAGS += -g
-      %.c: %.y
-          $(YACC) $<
-      .SUBDIRS: foo
-
-   .SUBDIRS: bar baz
-
-.. In this example, the -g option is added to the CFLAGS variable by the foo subdirectory, but not by the bar and baz directories. The implicit rules are scoped as well and in this example, the newly added yacc rule will be inherited by the foo subdirectory, but not by the bar and baz ones; furthermore this implicit rule will not be in scope in the current directory.
-
-この例では、 ``foo`` サブディレクトリには ``CFLAGS`` 変数に ``-g`` オプションが追加されていますが、 ``bar`` と ``baz`` ディレクトリには追加されていません。この例の場合ですとスコープのルールは非常によく働いており、 ``foo`` サブディレクトリには新しいyaccルールが追加されていますが、 ``bar`` と ``baz`` は追加されていません。さらにいうと、この追加されたルールは現在のディレクトリに影響を及ぼしていません。
-
-.. index::
-   single: 条件分岐
-   single: if
-.. _label4.9:
-
-4.9 条件分岐
-----------------
-.. Top level conditionals have the following form.
-
-トップレベルでの条件分岐は以下のような形となります。 ::
-
-    if <test>
-       <true-clause>
-    elseif <text>
-       <elseif-clause>
-    else
-       <else-clause>
-
-.. The <test> expression is evaluated, and if it evaluates to a true value (see Section 9.2 for more information on logical values, and Boolean functions), the code for the <true-clause> is evaluated; otherwise the remaining clauses are evaluated. There may be multiple elseif clauses; both the elseif and else clauses are optional. Note that the clauses are indented, so they introduce new scopes.
-
-まず ``<test>`` が評価されて、もしそれが *true* の値(真偽値についての詳細は ":ref:`label9.2`" を参照してください)であるならば ``<true-clause>`` のコードが評価されます。そうでなければ、残りの節が評価されます。また、 ``if`` 文は複数の ``elseif`` 宣言句を持たせることができます。 ``elseif`` と ``else`` 宣言句はなくても構いません。ただし、新しいスコープを導入するため、それぞれの宣言句はインデントされている必要があります。
-
-.. When viewed as a predicate, a value corresponds to the Boolean false, if its string representation is the empty string, or one of the strings false, no, nil, undefined, or 0. All other values are true.
-
-``if`` 文では、評価する文字列が空であったり、内容が ``false`` , ``no`` , ``nil`` , ``undefined`` , ``0`` であった場合、真偽値は *false* として評価されます。それ以外はすべて *true* になります。
-
-.. The following example illustrates a typical use of a conditional. The OSTYPE variable is the current machine architecture.
-
-以下の例では典型的な条件分岐の使い方を示しています。 ``OSTYPE`` 変数は現在使っているマシンのアーキテクチャを表しています。 ::
-
-    # アーキテクチャ上での主要な拡張子
-    if $(equal $(OSTYPE), Win32)
-       EXT_LIB = .lib
-       EXT_OBJ = .obj
-       EXT_ASM = .asm
-       EXE = .exe
-       export
-    elseif $(mem $(OSTYPE), Unix Cygwin)
-       EXT_LIB = .a
-       EXT_OBJ = .o
-       EXT_ASM = .s
-       EXE =
-       export
-    else
-       # 他のアーキテクチャの場合は強制終了する
-       eprintln(OS type $(OSTYPE) is not recognized)
-       exit(1)
-
-.. index::
-   single: switch
-   single: match
-   single: case
-   single: default
-   single: 正規表現
-.. _label4.10:
-
-4.10 マッチング
--------------------
-.. Pattern matching is performed with the switch and match forms.
-
-パターンマッチングは ``switch`` と ``match`` 文を使って実現できます。 ::
-
-    switch <string>
-    case <pattern1>
-        <clause1>
-    case <pattern2>
-        <clause2>
-    ...
-    default
-       <default-clause>
-
-.. The number of cases is arbitrary. The default clause is optional; however, if it is used it should be the last clause in the pattern match.
-
-``case`` の数は任意です。 ``default`` 宣言句はなくても構いませんが、使う場合は一番最後の宣言句で用いるべきです。
-
-.. For switch, the string is compared with the patterns literally.
-
-``switch`` の場合、文字列は ``<patterni>`` と『文字通りに』比較されます。 ::
-
-    switch $(HOST)
-    case mymachine
-        println(Building on mymachine)
-    default
-        println(Building on some other machine)
-
-.. Patterns need not be constant strings. The following function tests for a literal match against pattern1, and a match against pattern2 with ## delimiters.
-
-``<patternN>`` は定数である必要はありません。以下の関数は ``pattern1`` のマッチ、そして ``##`` デリミタを用いた ``pattern2`` のマッチを表しています。 ::
-
-   Switch2(s, pattern1, pattern2) =
-      switch $(s)
-      case $(pattern1)
-          println(Pattern1)
-      case $"##$(pattern2)##"
-          println(Pattern2)
-      default
-          println(Neither pattern matched)
-
-.. For match the patterns are egrep(1)-style regular expressions. The numeric variables $1, $2, ... can be used to retrieve values that are matched by \(...\) expressions.
-
-``match`` の場合、パターンとしてegrep(1)─正規表現─が使用できます。数値変数 ``$1, $2, ...`` は ``\(...\)`` 表現を使って値を取得できます。 ::
-
-    match $(NODENAME)@$(SYSNAME)@$(RELEASE)
-    case $"mymachine.*@\(.*\)@\(.*\)"
-        println(Compiling on mymachine; sysname $1 and release $2 are ignored)
-
-    case $".*@Linux@.*2\.4\.\(.*\)"
-        println(Compiling on a Linux 2.4 system; subrelease is $1)
-
-    default
-        eprintln(Machine configuration not implemented)
-        exit(1)
-
-.. index::
-   single: オブジェクト
-   single: フィールド
-   single: メソッド
-.. _label4.11:
-
-4.11 オブジェクト
----------------------
-.. OMake is an object-oriented language. Generally speaking, an object is a value that contains fields and methods. An object is defined with a . suffix for a variable. For example, the following object might be used to specify a point (1, 5) on the two-dimensional plane.
-
-OMakeはオブジェクト指向言語です。一般的に、オブジェクトはフィールド(訳注: プロパティもしくはメンバ変数と置き換えても良いです)とメソッドを持っています。オブジェクトは変数名の最後に ``.`` を加えることで定義できます。例えば、以下のオブジェクトは2次元平面上での点(1, 5)を表しています。 ::
-
-    Coord. =
-        x = 1
-        y = 5
-        print(message) =
-           println($"$(message): the point is ($(x), $(y)")
-
-    # Xに5を束縛
-    X = $(Coord.x)
-
-    # これは "Hi: the point is (1, 5)" と出力されます。
-    Coord.print(Hi)
-
-.. The fields x and y represent the coordinates of the point. The method print prints out the position of the point.
-
-オブジェクトのフィールド ``x`` と ``y`` は点の座標を表しています。 ``print`` メソッドは点の現在位置を出力します。
-
-.. index::
-   single: クラス
-   single: class
-.. _label4.12:
-
-4.12 クラス
----------------
-.. We can also define classes. For example, suppose we wish to define a generic Point class with some methods to create, move, and print a point. A class is really just an object with a name, defined with the class directive.
-
-オブジェクトと同様にして *クラス* も定義できます。例えば、私たちは現在、オブジェクトを生成したり、移動したり、位置を出力するメソッドを持った ``Point`` クラスを作りたいものとしましょう。クラスはオブジェクトの作り方と似ていますが、 ``class`` 宣言句を用いて名前を定義付ける点が異なります。 ::
-
-    Point. =
-        class Point
-
-        # フィールドの通常の値
-        x = 0
-        y = 0
-
-        # 座標から新しいクラスを生成する
-        new(x, y) =
-           this.x = $(x)
-           this.y = $(y)
-           return $(this)
-
-        # 点を右に移動する
-        move-right() =
-           x = $(add $(x), 1)
-           return $(this)
-
-        # 点を出力する
-        print() =
-           println($"The point is ($(x), $(y)")
-
-    p1 = $(Point.new 1, 5)
-    p2 = $(p1.move-right)
-
-    # "The point is (1, 5)" と出力
-    p1.print()
-
-    # "The point is (2, 5)" と出力
-    p2.print()
-
-.. Note that the variable $(this) is used to refer to the current object. Also, classes and objects are functional—the new and move-right methods return new objects. In this example, the object p2 is a different object from p1, which retains the original (1, 5) coordinates.
-
-変数 ``$(this)`` は現在のオブジェクトを参照していることに注目してください。また、クラスとオブジェクトは新しいオブジェクトを返す ``new`` と ``move-right`` メソッドを持っています。これは、オブジェクト ``p2`` とオブジェクト ``p1`` が別物であり、 ``p1`` はオリジナルの座標(1, 5)を保持していることを表しています。
-
-.. index::
-   single: 継承
-.. _label4.13:
-
-4.13 継承
----------------
-.. Classes and objects support inheritance (including multiple inheritance) with the extends directive. The following definition of Point3D defines a point with x, y, and z fields. The new object inherits all of the methods and fields of the parent classes/objects.
-
-クラスとオブジェクトは継承(多重継承を含む)を ``extends`` 文によってサポートしています。以下の ``Point3D`` では、 ``x`` , ``y`` , ``z`` フィールドを持ったクラスを定義しています。新しいオブジェクトは、親クラスやオブジェクトが持つすべてのフィールドやメソッドを継承します。 ::
-
-    Z. =
-       z = 0
-
-    Point3D. =
-       extends $(Point)
-       extends $(Z)
-       class Point3D
-
-       print() =
-          println($"The 3D point is ($(x), $(y), $(z))")
-
-    # "new"メソッドはオーバーライドされていませんので、
-    # 下のメソッドは新しく点(1, 5, 0)を返します。
-    p = $(Point3D.new 1, 5)
-
-.. index::
-   single: static.
-   single: where()
-   single: CheckProg()
-   single: ConfMsgChecking()
-   single: ConfMsgResult()
-.. _label4.14:
-
-4.14 static.
----------------
-.. The static. object is used to specify values that are persistent across runs of OMake. They are frequently used for configuring a project. Configuring a project can be expensive, so the static. object ensure that the configuration is performed just once. In the following (somewhat trivial) example, a static section is used to determine if the LATEX command is available. The $(where latex) function returns the full pathname for latex, or false if the command is not found.
-
-``static.`` オブジェクトはOMakeが動作している間、ずっと一定の値を保持していたい場合に使うオブジェクトです。このオブジェクトはプロジェクトを設定する際に頻繁に用いられます。プロジェクトを設定する変数が何回も書き換えられるのはリスクが高いので、 ``static.`` オブジェクトは設定がちょうど一回だけ行われることを保証してくれます。以下の(どこか冗長な)サンプルでは、 ``static.`` 節がLaTeXコマンドが使用可能であるかどうか調べるために使われています。 ``$(where latex)`` 関数は ``latex`` の絶対パスか、latexコマンドが存在しない場合は ``false`` を返します。 ::
-
-   static. =
-      LATEX_ENABLED = false
-      print(--- Determining if LaTeX is installed )
-      if $(where latex)
-          LATEX_ENABLED = true
-          export
-
-      if $(LATEX_ENABLED)
-         println($'(enabled)')
-      else
-         println($'(disabled)')
-
-.. The OMake standard library provides a number of useful functions for programming the static. tests, as described in Chapter 14. Using the standard library, the above can be rewritten as
-
-OMakeの標準ライブラリを用いると第14章( :ref:`label14` )にあるような ``static.`` をプログラミングするための、多くの有用な関数を試すことができます。標準ライブラリを用いると、上のコードは以下のように書き直せます。 ::
-
-   open configure/Configure
-   static. =
-      LATEX_ENABLED = $(CheckProg latex)
-
-.. As a matter of style, a static. section that is used for configuration should print what it is doing using the ConfMsgChecking and ConfMsgResult functions (of course, most of helper functions in the standard library would do that automatically).
-
-プロジェクトの設定として使われている ``static.`` 節は、 ``ConfMsgChecking`` や ``ConfMsgResult`` 関数( :ref:`label14.1.1` )を使って、 ``static.`` 節でどういう動作をしているのかについて出力すべきです(もちろん、標準ライブラリにある多くの関数が、この作業を自動的に行ってくれます)。
-
-.. index::
-   single: .STATIC
-   single: awk()
-.. _label4.14.1:
-
-4.14.1 .STATIC
-^^^^^^^^^^^^^^^^^^
-.. This feature was introduced in version 0.9.8.5.
-
-*この機能はバージョン 0.9.8.5 で搭載されました。*
-
-.. There is also a rule form of static section. The syntax can be any of the following three forms.
-
-``.STATIC`` 節の書き方は ``static.`` 節の書き方と似ています。構文は以下の3つのどれを選んでも書くことができます。 ::
-
-    # bodyで定義されたすべての変数をエクスポート
-    .STATIC:
-        <body>
-    
-    # 特にファイル依存を指定したい場合
-    .STATIC: <dependencies>
-        <body>
-    
-    # ファイル依存と同様に、どの変数をエクスポートしたいのか指定する場合
-    .STATIC: <vars>: <dependencies>
-        <body>
-
-.. The <vars> are the variable names to be defined, the <dependencies> are file dependencies—the rule is re-evaluated if one of the dependencies is changed. The <vars> and <dependencies> can be omitted; if so, all variables defined in the <body> are exported.
-
-``<vars>`` は定義する変数名、 ``<dependencies>`` はファイル依存─依存先のファイルのある一つが変更された場合、対象のルールは再評価されます─を指定します。 ``<vars>`` と ``<dependencies>`` はもし必要ならば除外することができ、 ``<body>`` 中で定義されたすべての変数はエクスポートされます。
-
-.. For example, the final example of the previous section can also be implemented as follows.
-
-たとえば、前回のセクションで示した最後のサンプルは以下のように改良できます。 ::
-
-    open configure/Configure
-    .STATIC:
-        LATEX_ENABLED = $(CheckProg latex)
-
-.. The effect is much the same as using static. (instead of .STATIC). However, in most cases .STATIC is preferred, for two reasons.
-
-効果は( ``.STATIC`` を使用する代わりに) ``static.`` を使用した場合とほとんど似ています。しかしながら、殆どの場合において ``.STATIC`` のほうが優位です。理由は2つあります。
-
-.. First, a .STATIC section is lazy, meaning that it is not evaluated until one of its variables is resolved. In this example, if $(LATEX_ENABLED) is never evaluated, the section need never be evaluated either. This is in contrast to the static. section, which always evaluates its body at least once.
-
-まず、 ``.STATIC`` 節は遅延評価されます。これはつまり、 ``.STATIC`` 内の変数が一つでも解決されないのならば、評価されることはないということを意味しています。例えばもし ``$(LATEX_ENABLED)`` が決して評価されない変数だとすると、 ``.STATIC`` 節は決して評価されることはありません。これは少なくとも一回はいつでも評価される ``static.`` 節とは対照的です。
-
-.. A second reason is that a .STATIC section allows for file dependencies, which are useful when the .STATIC section is used for memoization. For example, suppose we wish to create a dictionary from a table that has key-value pairs. By using a .STATIC section, we can perform this computation only when the input file changes (not on every fun of omake). In the following example the awk function is used to parse the file table-file. When a line is encountered with the form key = value, the key/value pair is added the the TABLE.
-
-次に、 ``.STATIC`` 節はファイル依存を指定できます。これは、 ``.STATIC`` 節がメモ化として用いられる場合に有効です。例えば、キーと値のペアを持ったテーブルから辞書を作りたい場合を考えてみましょう。 ``.STATIC`` 節を使うことによって、omakeはこの計算を(omakeが毎回動くときに計算するのではなく)入力されたファイルが変更された場合のみ計算するようにふるまいます。以下の例では、 ``awk`` 関数がファイル ``table-file`` をパースするために用いられています。 ``awk`` 関数は ``key = value`` の形をした行を発見する度に、そのキーと値のペアを ``TABLE`` 変数に追加します。 ::
-
-    .STATIC: table-file
-        TABLE = $(Map)
-        awk(table-file)
-        case $'^\([[:alnum:]]+\) *= *\(.*\)'
-            TABLE = $(TABLE.add $1, $2)
-            export
-
-.. It is appropriate to think of a .STATIC section as a rule that must be recomputed whenever the dependencies of the rule change. The targets of the rule are the variables it exports (in this case, the TABLE variable).
-
-ルールの依存関係が変わった場合はいつでも ``.STATIC`` 節は再計算されます。このルール内での対象は、エクスポートする変数となります(この場合ですと ``TABLE`` 変数が相当します)。
-
-.. index::
-   single: .MEMO
-.. _label4.14.1.1:
-
-4.14.1.1  .MEMO
-""""""""""""""""""
-.. A .MEMO rule is just like a .STATIC rule, except that the results are not saved between independent runs of omake.
-
-``.MEMO`` ルールは、その結果が独立して動いている ``omake`` インスタンス間で保存されない点を除いて、 ``.STATIC`` ルールと等価です。
-
-.. index::
-   single: :key:
-   single: .MEMO
-   single: 再帰関数
-.. _label4.14.1.2:
-
-4.14.1.2  :key:
-""""""""""""""""""
-.. The .STATIC and .MEMO rules also accept a :key: value, which specifies a “key” associated with the values being computed. It is useful to think of a .STATIC rule as a dictionary that associates keys with their values. When a .STATIC rule is evaluated, the result is saved in the table with the :key: defined by the rule (if a :key: is not specified, a default key is used instead). In other words, a rule is like a function. The :key: specifies the function “argument”, and the rule body computes the result.
-
-``.STATIC`` と ``.MEMO`` ルールはまた、計算された値とリンクしている『キー』を表す ``:key:`` を使うことができます。 ``.STATIC`` ルールを、キーと値がリンクした辞書として考えることは有用です。 ``.STATIC`` ルールが評価された場合、結果は指定されたルールによって定義された ``:key:`` がテーブル内に保存されます( ``:key:`` が指定されていない場合、デフォルトのキーが代わりに用いられます)。言い換えると、ルールは関数のようなものです。 ``:key:`` は関数の『引数』を表しており、ルール部分で結果を計算します。
-
-.. To illustrate, let's use a .MEMO rule to implement a Fibonacci function.
-
-これを確かめるために、 ``.MEMO`` ルールをフィボナッチ関数に改良してみましょう。 ::
-
-    fib(i) =
-        i = $(int $i)
-        .MEMO: :key: $i
-            println($"Computing fib($i)...")
-            result =
-                if $(or $(eq $i, 0), $(eq $i, 1))
-                    value $i
-                else
-                    add($(fib $(sub $i, 1)), $(fib $(sub $i, 2)))
-        value $(result)
-    
-    println($"fib(10) = $(fib 10)")
-    println($"fib(12) = $(fib 12)")
-
-.. When this script is run, it produces the following output.
-
-このスクリプトを実行した場合、以下のような結果となります。 ::
-
-    Computing fib(10)...
-    Computing fib(9)...
-    Computing fib(8)...
-    Computing fib(7)...
-    Computing fib(6)...
-    Computing fib(5)...
-    Computing fib(4)...
-    Computing fib(3)...
-    Computing fib(2)...
-    Computing fib(1)...
-    Computing fib(0)...
-    fib(10) = 55
-    Computing fib(12)...
-    Computing fib(11)...
-    fib(12) = 144
-
-.. Note that the Fibonacci computation is performed just once for each value of the argument, rather than an exponential number of times. In other words, the .MEMO rule has performed a memoization, hence the name. Note that if .STATIC were used instead, the values would be saved across runs of omake.
-
-フィボナッチ関数は各々の引数の場合において、一回だけしか計算されていないことに注目してください。これは普通にプログラムした場合ですと、指数関数的に計算時間が増えてしまいます。言い換えると、 ``.MEMO`` ルールは計算結果をメモ化(memoization)しているからこそ、この名前なのです。 ``.STATIC`` ルールを代わりに使った場合、すべての ``omake`` インスタンスにおいて値が保存されていることに注意してください。
-
-.. As a general guideline, whenever you use a .STATIC or .MEMO rule within a function body, you will usually want to use a :key: value to index the rule by the function argument. However, this is not required. In the following, the .STATIC rule is used to perform some expensive computation once.
-
-一般的には、あなたは ``.STATIC`` か ``.MEMO`` ルールを関数内で用いる場合はいつでも、ふつう ``:key:`` を使いたくなるでしょう。しかしながら、これは必須ではありません。以下の例では、 ``.STATIC`` ルールが、何か計算時間のかかる作業を一回だけ行う場合を表しています。 ::
-
-    f(x) =
-        .STATIC:
-            y = $(expensive-computation)
-        add($x, $y)
-
-.. Additonal care should be taken for recursive functions, like the Fibonacci function. If the :key: is omitted, then the rule would be defined in terms of itself, resulting in a cyclic dependency. Here is the output of the Fibonacci program with an omitted :key:.
-
-あなたがフィボナッチ関数のような再帰的な関数を定義する場合、さらに以下の点に注意すべきです。 ``:key:`` を除外してしまった場合、ルールは関数自体に対して定義されてしまい、循環された依存関係で評価されてしまいます。以下は ``:key:`` を除いたフィボナッチ関数の出力結果です。 ::
-
-    Computing fib(10)...
-    Computing fib(8)...
-    Computing fib(6)...
-    Computing fib(4)...
-    Computing fib(2)...
-    Computing fib(0)...
-    fib(10) = 0
-    fib(12) = 0
-
-.. The reason for this behavior is that the result value is not saved until the base case i = 0 || i = 1 is reached, so fib calls itself recursively until reaching fib(0), whereupon the result value is fixed at 0.
-
-この動作は ``i = 0 || i = 1`` の場合に達するまで ``result`` の値が保存されていないので、 ``fib`` は自身を ``fib(0)`` に達するまで再帰的に呼び出し、そして ``result`` の値は0に修正されてしまうために生じます。
-
-.. In any case, recursive definitions are perfectly acceptable, but you will usually want a :key: argument so that each recursive call has a different :key:. In most cases, this means that the :key: should include all arguments to the function.
-
-再帰的な定義が無難に動作する場合もありますが、あなたは普通 ``:key:`` 引数をつけることで、各々の再帰的な呼び出しが異なった ``:key:`` を持つようにするでしょう。これは多くの場合において、 ``:key:`` が関数の引数すべてに含めるべきであることを示しています。
-
-.. index::
-   single: 整数型
-   single: 浮動小数点型
-   single: 配列
-   single: 文字列
-   single: ファイル
-   single: ディレクトリ
-   single: マップ
-   single: 辞書
-   single: チャネル
-   single: 関数
-   single: 無名関数
-   single: 字句解析
-   single: パーサ
-.. _label4.15:
-
-4.15 定数
------------------
-.. Internally, OMake represents values in several forms, which we list here.
-
-OMakeではいろんな方法でそれぞれの値を表すことができます。私たちはこれを以下のリストにしました。
-
-.. int
-
-      * Constructor: $(int <i>) 9.4.1.
-      * Object: Int 12.1.4.
-      * An integer is a represented with finite precision using the OCaml representation (31 bits on a 32 platform, and 63 bits on a 64 bit platform).
-      * See also: arithmetic 9.4.3. 
-
-* **int** - 整数型
-
-  * コンストラクタ: ``$(int <i>)`` (:ref:`label9.4.1`)
-  * オブジェクト: ``Int`` (:ref:`label12.1.4`)
-  * 有限の値をもった整数型で、精度はプラットフォーム上のOCamlに依存します(32ビットのプラットフォーム上では31ビット、64ビットのプラットフォーム上では63ビット)(訳注: 1ビットは正負の判定に使われます)。
-  * 詳細は ":ref:`label9.4.3`" を参照してください。
-
-.. float
-
-      * Constructor: $(float <x>) 9.4.2.
-      * Object: Float 12.1.5.
-      * A float is a floating-point value, represented in IEEE 64-bit format.
-      * See also: arithmetic 9.4.3. 
-
-* **float** - 浮動小数点型
-
-  * コンストラクタ: ``$(float <x>)`` (:ref:`label9.4.2`)
-  * オブジェクト: ``Float`` (:ref:`label12.1.5`)
-  * 浮動小数点型で、精度は64ビットです。
-
-.. array
-
-      * Constructor: $(array <v1>, ..., <vn>) 9.3.1.
-      * Object: Array 12.1.7.
-      * An array is a finite list of values. Arrays are also defined with an array definition
-
-            X[] =
-                <v1>
-                ...
-                <vn>
-
-      * See also: nth 9.3.5, nth-tl 9.3.8, length 9.3.4, … 
-
-* **array** - 配列
-
-  * コンストラクタ: ``$(array <v1>, ..., <vn>)`` (:ref:`label9.3.1`)
-  * オブジェクト: ``Array`` (:ref:`label12.1.7`)
-  * 配列は有限の数の値をもったリストを表します。配列はまた以下のように定義することもできます。 ::
-    
-        X[] =
-            <v1>
-            ...
-            <vn>
-  
-  * 詳細は ":ref:`label9.3.5`", ":ref:`label9.3.8`", ":ref:`label9.3.4`" を参照してください。
-
-.. string
-
-      * Object: String 12.1.8.
-      * By default, all constant character sequences represent strings, so the simple way to construct a string is to write it down. Internally, the string may be parsed as several pieces. A string often represents an array of values separated by whitespace.
-
-            osh>S = This is a string
-            - : <sequence
-               "This" : Sequence
-               ' ' : White
-               "is" : Sequence
-               ' ' : White
-               "a" : Sequence
-               ' ' : White
-               "string" : Sequence>
-               : Sequence
-            osh>length($S)
-            - : 4 : Int
-
-      * A data string is a string where whitespace is significant. It represents a single value, not an array. The constructors are the quotations $"..." and $'...'.
-
-            osh>S = $'''This is a string'''
-            - : <data "This is a string"> : String
-
-      * See also: Quoted strings 7.2. 
-
-* **string** - 文字列
-
-  * オブジェクト: ``String`` (:ref:`label12.1.8`)
-  * 通常、すべての文字からなるシーケンスは配列として表現されるため、単純にソース中に書き表すことで初期化できます。内部で文字列はいくつかの断片としてパースされます。文字列はしばしば、ホワイトスペース(訳注: ホワイトスペースはスペース、タブを含んだ空白文字のことです)によって分割された値のシーケンスとして定義されます。 ::
-
-      osh>S = This is a string
-      - : <sequence
-         "This" : Sequence
-         ' ' : White
-         "is" : Sequence
-         ' ' : White
-         "a" : Sequence
-         ' ' : White
-         "string" : Sequence>
-         : Sequence
-      osh>length($S)
-      - : 4 : Int
-
-  * *データ* 文字列は、ホワイトスペースが重要な意味を持つ場合に用いられます。これは単純な一つの値として定義されるので、配列にはなりません。コンストラクタはクオーテーション ``$"..."`` と ``$'...'`` で表現できます。 ::
-
-      osh>S = $'''This is a string'''
-      - : <data "This is a string"> : String
-
-  * 詳細は ":ref:`label7.2`" を参照してください。
-
-.. file
-
-      * Constructor: $(file <names>) 10.1.1.
-      * Object: File 12.1.13.
-      * A file object represents the abstract name for a file. The file object can be viewed as an absolute name; the string representation depends on the current directory.
-
-            osh>name = $(file foo)
-            - : /Users/jyh/projects/omake/0.9.8.x/foo : File
-            osh>echo $(name)
-            foo
-            osh>cd ..
-            - : /Users/jyh/projects/omake : Dir
-            osh>echo $(name)
-            0.9.8.x/foo
-
-      * See also: vmount 10.6.1. 
-
-* **file** - ファイル
-
-  * コンストラクタ: ``$(file <names>)`` (:ref:`label10.1.1`)
-  * オブジェクト: ``File`` (:ref:`label12.1.13`)
-  * ファイルオブジェクトはファイルの絶対パスを表すオブジェクトです。ファイルオブジェクトは絶対パスとして見ることができます。文字列への変換はカレントディレクトリに依存しています。 ::
-
-      osh>name = $(file foo)
-      - : /Users/jyh/projects/omake/0.9.8.x/foo : File
-      osh>echo $(name)
-      foo
-      osh>cd ..
-      - : /Users/jyh/projects/omake : Dir
-      osh>echo $(name)
-      0.9.8.x/foo
-
-  * 詳細は ":ref:`label10.1.1`" を参照してください。
-  
-  .. note::
-    訳注: 原文では ":ref:`label10.6.1`" となっていますが、これはおそらく ":ref:`label10.1.1`" の間違いであると思われますので、置き換えました。
-
-.. directory
-
-      * Constructor: $(dir <names>) 10.1.1.
-      * Object: Dir 12.1.14.
-      * A directory object is like a file object, but it represents a directory. 
-
-* **directory** - ディレクトリ
-
-  * コンストラクタ: ``$(dir <names>)``
-  * オブジェクト: ``Dir`` (:ref:`label12.1.14`)
-  * ディレクトリオブジェクトはファイルオブジェクトと似ていますが、ディレクトリとしてふるまいます。
-
-* **map (dictionary)** - マップ (辞書)
-
-  * オブジェクト: ``Map`` (:ref:`label12.1.2`)
-  * マップ/辞書オブジェクトは値と値を結びつけるテーブルです。 ``Map`` オブジェクトは空のマップです。データ構造は永続的に保持されて、すべての演算は分かりやすく関数的です。特別な構文 ``$|key|`` によって文字列のキーを表現することができます。 ::
-
-      osh>table = $(Map)
-      osh>table = $(table.add x, int)
-      osh>table. +=
-              $|y| = int
-      osh>table.find(y)
-      - : "int" : Sequence
-
-.. map (dictionary)
-
-      * Object: Map 12.1.2.
-      * A map/dictionary is a table that maps values to values. The Map object is the empty map. The data structure is persistent, and all operations are pure and functional. The special syntax $|key| can be used for keys that are strings.
-
-            osh>table = $(Map)
-            osh>table = $(table.add x, int)
-            osh>table. +=
-                    $|y| = int
-            osh>table.find(y)
-            - : "int" : Sequence
-
-.. channel
-
-      * Constructor: $(fopen <filename>, <mode>) 10.8.4.
-      * Objects: InChannel 12.1.16, OutChannel 12.1.17.
-      * Channels are used for buffered input/output. 
-
-* **channel** - チャネル
-
-  * コンストラクタ: ``$(fopen <filename>, <mode>)`` (:ref:`label10.8.4`)
-  * オブジェクト: ``InChannel`` (:ref:`label12.1.16`), ``OutChannnel`` (:ref:`label12.1.17`)
-  * チャネルオブジェクトは入力や出力のバッファとして使います。
-
-.. function
-
-      * Constructor: $(fun <params>, <body>) 9.5.1.
-      * Object: Fun 12.1.9.
-      * Functions can be defined in several ways.
-            o As an anonymous function,
-
-                  $(fun i, j, $(add $i, $j))
-
-            o As a named function,
-
-                  f(i, j) =
-                      add($i, $j)
-
-            o This feature will be introduced in version 0.9.9.0.As an anonymous function argument.
-
-                  osh>foreach(i => $(add $i, 1), 1 2 3)
-                  - : <array 2 3 4> : Array
-
-* **function** - 関数
-
-  * コンストラクタ: ``$(fun <params>, <body>)`` (:ref:`label9.5.1`)
-  * オブジェクト: ``Fun`` (:ref:`label12.1.9`)
-  * 関数オブジェクトはいろんな方法で定義できます。
-
-    * 無名関数 ::
-
-        $(fun i, j, $(add $i, $j))
-
-    * 名前をつけた関数 ::
-
-        f(i, j) =
-            add($i, $j)
-
-    * *この機能はバージョン0.9.9.0で導入されました。* 無名関数の引数 ::
-
-        osh>foreach(i => $(add $i, 1), 1 2 3)
-        - : <array 2 3 4> : Array
-
-.. lexer
-
-    * Object: Lexer 10.11.9.
-    * This object represents a lexer. 
-
-* **lexer** - 字句解析
-
-  * オブジェクト: ``Lexer`` (:ref:`label10.11.9`)
-  * このオブジェクトは字句解析器(レキサ)として表現します。
-
-.. parser
-
-    * Object: Parser 10.11.13.
-    * This object represents a parser. 
-
-* **parser** - パーサ
-
-  * オブジェクト: ``Parser`` (:ref:`label10.11.13`)
-  * このオブジェクトはパーサとして表現します。
diff --git a/omake-grammar.rst b/omake-grammar.rst
deleted file mode 100644 (file)
index b87d2cd..0000000
+++ /dev/null
@@ -1,192 +0,0 @@
-.. B. OMake grammar
-
-.. _labelB:
-
-B. OMake言語の文法
-======================================
-
-.. _labelB.1:
-
-B.1 OMakeの語彙規則
----------------------------------------
-OMake言語は、2,3個の語彙規則からなるGNU/BSDのmake言語を元にしています。厳密にいうと、この言語にキーワードは存在しません。また、少数の特殊文字から成り立っています。
-
-.. _labelB.1.1:
-
-B.1.1 コメント
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-コメントは ``#`` 文字から始まり、行末まで続きます。また、コメントの中にある文字列の制限はありません。
-
-例::
-
-   # This is a comment
-   # This $comment contains a quote " character
-
-.. _labelB.1.2:
-
-B.1.2 特殊文字
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-以下の文字は、特定の文中で特殊文字となります。::
-
-   $    (    )    ,    .   =    :    "    '    `    \    #
-
-* ``$`` は変数の参照、あるいは関数を適用する際に用いられます。
-* 括弧 ``)``, ``(`` は引数のデリミタに用いられます。
-* コマンド ``,`` は引数のセパレータです。
-* ピリオドシンボル ``.`` は名前のセパレータです。
-* 等価シンボル ``=`` は定義(definition)を意味します。
-* コロンシンボル ``:`` はルール付けと、『この式はインデント先の内容に従っている』ことを示すために用いられます???ただし、後者はオプションです。
-* クオーテーションシンボル ``"`` と ``'`` は文字列の範囲を定めるために用いられます。
-* シンボル ``#`` は定数の初期文字です。
-* エスケープシンボル ``\`` は別の特殊文字を修飾するため *のみ* に用いられます。この場合、二番目の文字の特殊効果はすべて取り除かれ、一つの文字として扱われます。そうでない場合、 ``\`` は特殊文字とはなりません。
-  
-  例:
-
-  * ``\$`` : 文字 ``$`` (通常の文字列として扱われる)
-  * ``\#`` : 文字 ``#`` (通常の文字列として扱われる)
-  * ``\\`` : 文字 ``\`` (通常の文字列として扱われる)
-  * ``c\:\Windows\moo\#boo`` : 文字列 ``c:\Windows\moo#boo``
-
-.. _labelB.1.3:
-
-B.1.3 識別子
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-識別子(変数名) は ``_``, ``-``, ``@`` を含めた、ASCIIの英数字で構成されなければなりません。大文字小文字は区別されるため、以下の識別子は区別されます: ``FOO``, ``Foo``, ``foo`` 。また、識別子の一文字目は条件に当てはまる文字であればなんでも構いません。つまり、数字から始めても構いません。
-
-``egrep`` 表記を用いると、識別子の正規表現は以下のようになります。 ::
-
-    identifier ::= [-@~_A-Za-z0-9]+
-
-以下の識別子はすべて正当です。 ::
-
-    Xyz    hello_world    seventy@nine
-    79-32  Gnus~Gnats     CFLAGS
-
-以下の識別子は正当ではありません。 ::
-
-    x+y    hello&world
-
-.. _labelB.1.4:
-
-B.1.4 コマンド識別子
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-以下の単語はプログラム行の *最初に* 呼び出された場合に、特別な意味を持つ単語です。そうでない場合、これらの単語は特別な意味を持ちません。 ::
-
-    case     catch  class    declare    default
-    do       else   elseif   export     extends
-    finally  if     import   include    match
-    open     raise  return   section    switch
-    try      value  when     while
-
-.. _labelB.1.5:
-
-B.1.5 変数の参照
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-変数の参照(variable reference)は、 ``$`` 特殊文字を識別子の前に付与することによって指定できます。もし識別子名が一文字より多い文字列であった場合、括弧を使って閉じなければなりません。この括弧を使った表記法は非常によく使われます。以下はすべて正当な変数の参照です。 ::
-
-    $(Xyz)    $(hello_world)   $(seventy@nine)
-    $(79-32)  $(Gnus~Gnats)    $(CFLAGS)
-
-一文字で変数を参照する場合は、通常の識別文字に加えていくつかの追加修飾子 ``&*<^?[]`` を利用することもできます。以下はすべて正当な変数の参照です。 ::
-
-   $@   $&   $*   $<   $^   $+   $?   $[   $]
-   $A   $_   $a   $b   $x   $1   $2   $3
-
-.. note::
-   括弧を利用しない変数の参照は、たとえその後にに正当な文字が続いていたとしても、一文字のみに制限されます。例えば、変数 ``$x`` の値が17であった場合、以下の構文は次のように評価されます。 ::
-
-       $x           evaluates to    17
-       foo$xbar     evaluates to    foo17bar
-       foo$(x)bar   evaluates to    foo17bar
-
-特殊シーケンス ``$$`` はリテラル文字 ``$`` に置き換わります。これはつまり、二文字のシーケンス ``\$`` と ``$$`` は通常の場合等価であることを表しています。
-
-.. _labelB.1.6:
-
-B.1.6 文字列定数
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-リテラル文字列は対応する文字列のデリミタによって定義されます。左の文字列デリミタはダラーサイン ``$`` から始まり、0でない数のシングルクオート、またはマルチクオートを使います。また、文字列は対応するクオーテーションシンボルのシーケンスで終わります。クオーテーションの種類を混ぜることはできません。言い換えると、デリミタは必ずシングルクオートかダブルクオート文字のどちらかでなければいけません。以下の例はすべて正当な文字列です。 ::
-
-    $'Hello world'
-    $"""printf("Hello world\n")"""
-    $''''
-    Large "block" of
-    text # spanning ''multiple'' lines''''
-
-文字列のデリミタは、文字の内容には *含まれません* 。シングルクオートを用いた場合、文字列の内容は逐語的に解釈されます。言い換えると、この文字列にはなんの特殊文字も含まれていないものと解釈されます。
-
-ダブルクオートを用いた場合、文字列の内容に ``$`` シンボルを用いて式の評価を含めることができます。以下にいくつかの例を示します。 ::
-
-
-    X = Hello
-    Y = $""$X world""             # Hello world
-    Z = $'''$X world'''           # $X world
-    I = 3
-    W = $"6 > $(add $I, 2)"       # 6 > 5
-
-.. note::
-   OMakeでは、 ``$`` を付与していないクオーテーションシンボルは特別なものとして扱われません。この場合、クオーテーションシンボルはシーケンスに含まれます。 ::
-
-        osh>println('Hello world')
-        'Hello world'
-        osh>println($'Hello world')
-        Hello world
-        osh>X = Hello
-        - : "Hello" : Sequence
-        osh>println('$X world')
-        Hello world
-
-.. _labelB.2:
-
-B.2 OMakeの語彙規則
----------------------------------------
-
-.. _labelB.2.1:
-
-B.2.1 式
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-.. _labelB.2.1.1:
-
-B.2.1.1 インライン参照
-"""""""""""""""""""""""""""""""""""""""
-
-.. _labelB.2.2:
-
-B.2.2 構文とプログラム
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-.. _labelB.2.2.1:
-
-B.2.2.1 特殊構文
-"""""""""""""""""""""""""""""""""""""""
-
-.. _labelB.2.2.2:
-
-B.2.2.2 変数定義
-"""""""""""""""""""""""""""""""""""""""
-
-.. _labelB.2.2.3:
-
-B.2.2.3 参照と関数定義
-"""""""""""""""""""""""""""""""""""""""
-
-.. _labelB.2.2.4:
-
-B.2.2.4 オブジェクト
-"""""""""""""""""""""""""""""""""""""""
-
-.. _labelB.2.2.5:
-
-B.2.2.5 ルール
-"""""""""""""""""""""""""""""""""""""""
-
-.. _labelB.2.2.6:
-
-B.2.2.6 シェルコマンド
-"""""""""""""""""""""""""""""""""""""""
-
-.. _labelB.3:
-
-B.3 ダラー修飾子
----------------------------------------
diff --git a/omake-options.rst b/omake-options.rst
deleted file mode 100644 (file)
index 756450d..0000000
+++ /dev/null
@@ -1,610 +0,0 @@
-.. A. OMake command-line options
-
-.. _labelA:
-
-A. OMake コマンドラインオプション
-======================================
-
-``omake [-j <count>] [-k] [-p] [-P] [-n] [-s] [-S] [-w] [-t] [-u] [-U] [-R] [--verbose] [--project] [--depend] [--progress] [--print-status] [--print-exit] [--print-dependencies] [--show-dependencies <target>] [--all-dependencies] [--verbose-dependencies] [--force-dotomake] [--dotomake <dir>] [--flush-includes] [--configure] [--save-interval <seconds>] [--install] [--install-all] [--install-force] [--version] [--absname] [--output-normal] [--output-postpone] [--output-only-errors] [--output-at-end] filename... [var-definition...]``
-
-.. _labelA.1:
-
-A.1 一般的な使い方
-----------------------------------
-.. For Boolean options (for example, -s, --progress, etc.) the option can include a prefix --no, which inverts the usual sense of the option. For example, the option --progress means “print a progress bar,” while the option --no--progress means “do not print a progress bar.”
-
-ブーリアンオプション(例えば ``-s`` , ``--progress`` など…)は意味を逆転させる接頭辞 ``--no`` を付与することができます。例えば、オプション ``--progress`` は『プログレスバーを表示する』ことを示していますが、オプション ``--no--progress`` は『プログレスバーを表示しない』ことを示しています。
-
-.. If multiple instances of an option are specified, the final option determines the behavior of OMake. In the following command line, the final --no-S cancels the earlier -S.
-
-複数の重複するオプションが指定されていた場合、最後のオプションがOMakeでのふるまいを決定します。以下のコマンドラインでは、最後の ``--no-S`` が前の ``-S`` オプションを打ち消します。 ::
-
-    % omake -S --progress --no-S
-
-.. _labelA.2:
-
-A.2 出力のコントロール
-----------------------------------
-
-.. index::
-   single: -s
-.. _labelA.2.1:
-
-A.2.1 -s
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-``-s``
-
-.. Never not print commands as they are executed (be “silent”).
-
-コマンドが実行された場合でも、決してコマンドの内容を表示しません("silent")。
-
-.. index::
-   single: -S
-.. _labelA.2.2:
-
-A.2.2 -S
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-``-S``
-
-.. Do not print commands as they are executed unless they produce output and/or fail. This is the default.
-
-コマンドが出力を生成したり、失敗したりするまでは、コマンドの内容を表示しません。このオプションはデフォルトで有効です。
-
-.. index::
-   single: -w
-.. _labelA.2.3:
-
-A.2.3 -w
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-``-w``
-
-.. Print directory information in make format as commands are executed. This is mainly useful for editors that expect make-style directory information for determining the location of errors.
-
-コマンドが実行される時点でのディレクトリの情報を ``make`` フォーマットで表示します。これはエラー場所を特定するため、makeスタイルのディレクトリの情報を切望しているエディターにとって、とても有用なオプションです。
-
-.. index::
-   single: --progress
-.. _labelA.2.4:
-
-A.2.4 -progress
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-``--progress``
-
-.. Print a progress indicator. This option is enabled by default when the OMake's output (stdout) is on a terminal and disabled by default (except on Windows) when the OMake's output is redirected.
-
-進捗状況(プログレスバー)を表示します。このオプションは、OMakeの出力先( ``stdout`` )がターミナルとなっている場合はデフォルトで有効となり、OMakeの出力先がリダイレクトされている場合はデフォルトで無効となります(Windowsを除く)。
-
-.. index::
-   single: --print-status
-.. _labelA.2.5:
-
-A.2.5 -print-status
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-``--print-status``
-
-.. Print status lines (the + and - lines).
-
-ステータスライン( ``+`` と ``-`` ライン)を表示します。
-
-.. index::
-   single: --print-exit
-.. _labelA.2.6:
-
-A.2.6 -print-exit
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-``--print-exit``
-
-.. Print termination codes when commands complete.
-
-コマンドが成功した場合には終了コードを表示します。
-
-.. index::
-   single: --verbose
-.. _labelA.2.7:
-
-A.2.7 -verbose
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-``--verbose``
-
-.. Make OMake very verbose. This option is equivalent to --no-S --print-status --print-exit VERBOSE=true
-
-OMakeの出力を詳細に表示します。このオプションは ``--no-S --print-status --print-exit VERBOSE=true`` と等価です。
-
-.. index::
-   single: --output-normal
-.. _labelA.2.8:
-
-A.2.8 -output-normal
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-``--output-normal``
-
-.. As rule commands are executed, relay their output to the OMake output right away. This is enabled by default, unless --output-postpone or --output-only-errors is enabled.
-
-ルールコマンドを実行した時点で、コマンドの出力をOMakeの出力へと即座に受け渡します。これは ``--output-postpone`` か ``--output-only-errors`` が有効になっていない限りデフォルトで有効です。
-
-.. index::
-   single: --output-postpone
-.. _labelA.2.9:
-
-A.2.9 -output-postpone
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-``--output-postpone``
-
-.. When a rule finishes, print the output as a single block. This is useful in combination -j option (see Section A.3.12), where the output of multiple subprocesses can be garbled. The diversion is printed as a single coherent unit.
-
-ルールが完了した際に、出力を一つのブロックとして一気に表示します。これは複数のサブプロセスの出力をまとめてくれる(garbled) ``-j`` オプション( :ref:`labelA.3.12` を参照)と一緒に使うと有用です。コマンドの出力は一つにまとめられて表示します。
-
-.. Note that enabling --output-postpone will by default disable the --output-normal option. This might be problematic if you have a command that decides to ask for interactive input. If the --output-postpone is enabled, but the --output-normal is not, the prompt of such a command will not be visible and it may be hard to figure out why the build appears “stuck”. You might also consider using the --progress flag (see Section A.2.4) so that you can see when the build is active. 
-
-.. note::
-   ``--output-postpone`` を有効にした際、デフォルトで ``--output-normal`` オプションが無効になります。この仕様は、インタラクティブな入力を要請するコマンドを使いたいような場合に問題となるでしょう。 ``--output-postpone`` が有効になって、さらに ``--output-normal`` が無効になっているような場合、このようなコマンドのプロンプトを表示することはなくなるので、ビルドがなぜ『固まって』いるのか理解することは殆ど困難となります。このような状況に直面した際、あなたは ``--process`` フラグ( :ref:`labelA.2.4` を参照)を用いて、ビルドが実行されているのかどうか確認すべきです。
-
-.. index::
-   single: --output-only-errors
-.. _labelA.2.10:
-
-A.2.10 -output-only-errors
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-``--output-only-errors``
-
-.. Similar to --output-postpone, except that the postponed output from commands that were successful will be discarded. This can be useful in reducing unwanted output so that you can concentrate on any errors.
-
-``--output-postpone`` と似ていますが、このオプションは成功したコマンドの出力を表示しません。つまりユーザが望んでいない出力を減らすことができるので、あなたは任意のエラーが出た箇所のみに集中できます。
-
-.. index::
-   single: --output-at-end
-.. _labelA.2.11:
-
-A.2.11 -output-at-end
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-``--output-at-end``
-
-.. If any rules/commands fail, re-print the output of the failed commands when OMake finishes the build. This is especially useful when any of the -k, -p, or -P options are enabled.
-
-任意のルールやコマンドが失敗した場合、失敗したコマンドの出力をOMakeのビルドが終了した際に表示します。これは ``-k`` , ``-p`` , ``-P`` オプションのうち一つでも有効としている場合に、特に有用となります。
-
-.. This option is off by default. However, when -k is enabled — either explicitly or via one of the -p/-P options — --output-at-end will be enabled by default.
-
-このオプションはデフォルトで無効となっています。しかしながら、 ``-k`` オプションが有効となっているような場合ー明示的、あるいは ``-p``/``-P`` オプションを経由した場合ー ``--output-at-end`` オプションはデフォルトで有効となります。
-
-.. index::
-   single: -o
-.. _labelA.2.12:
-
-A.2.12 -o
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-``-o [01jwWpPxXsS]``
-
-.. For brevity, the -o option is also provided to duplicate the above output options. The -o option takes a argument consisting of a sequence of characters. The characters are read from left-to-right; each specifies a set of output options. In general, an uppercase character turns the option on; a lowercase character turns the option off.
-
-上記の出力オプションを簡単に指定するために、 ``-o`` オプションが出力オプションの代替手段として提供されています。 ``-o`` オプションは文字のシーケンスで構成された引数が必要となります。文字は左から右へ読み込まれ、各々の文字は出力オプションの集合を指定しています。一般的に、大文字はオプションを有効にして、小文字はオプションを無効化します。
-
-* **0**
-  
-  .. Equivalent to -s --output-only-errors --no-progress
-  
-  ``-s --output-only-errors --no-progress`` と等価です。
-  
-  .. This option specifies that omake should be as quiet as possible. If any errors occur during the build, the output is delayed until the build terminates. Output from successful commands is discarded.
-  
-  このオプションは ``omake`` の出力ができるだけサイレントとなるように指定します。任意のエラーがビルド中に生じた場合、出力はビルドが終了するまで延期されます。成功したコマンドの出力は表示されません。
-
-* **1**
-  
-  .. Equivalent to -S --progress --output-only-errors
-  
-  ``-S --progress --output-only-errors`` と等価です。
-  
-  .. This is a slightly more relaxed version of “quiet” output. The output from successful commands is discarded. The output from failed commands is printed immediately after the command complete. The output from failed commands is displayed twice: once immediately after the command completes, and again when the build completes. A progress bar is displayed so that you know when the build is active. Include the `p' option if you want to turn off the progress bar (for example omake -o 1p).
-  
-  このオプションは上の『サイレント』なバージョンよりも、もう少し寛容な形になっています。成功したコマンドの出力は表示しません。失敗したコマンドの出力はコマンドが完了した後で、即座に表示します。失敗したコマンドの出力は2回表示します。まず1回目はコマンドが完了した際に表示し、2回目はビルドが完了した際に表示します。また、プログレスバーも表示するので、あなたはビルドが実行されているのかどうか確認することができます。もしプログレスバーを表示したくないのであれば、 ``p`` オプションを含めてください(例: ``omake -o 1p`` )。
-
-* **2**
-  
-  .. Equivalent to --progress --output-postpone
-  
-  ``--progress --output-postpone`` と等価です。
-  
-  .. The is even more relaxed, output from successful commands is printed. This is often useful for deinterleaving the output when using -j.
-  
-  このオプションはさらに寛容な形となっており、成功したコマンドの出力も表示します。これは ``-j`` オプションを用いて出力を重ね合わせたくない(deinterleaving)ような場合にしばしば有用となります。
-
-* **W**
-  
-  ``-w`` と等価です。
-
-* **w**
-  
-  ``--no-w`` と等価です。
-
-* **P**
-  
-  ``-progress`` と等価です。
-
-* **p**
-  
-  ``--no--progress`` と等価です。
-
-* **X**
-  
-  ``--print-exit`` と等価です。
-
-* **x**
-  
-  ``--no-print-exit`` と等価です。
-
-* **S**
-  
-  ``-S`` と等価です。
-
-* **s**
-  
-  ``--no-S`` と等価です。
-
-.. _labelA.3:
-
-A.3 ビルドオプション
-----------------------------------
-
-.. index::
-   single: -k
-.. _labelA.3.1:
-
-A.3.1 -k
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-``-k``
-
-.. Do not abort when a build command fails; continue to build as much of the project as possible. This option is implied by both -p and -P options. In turn, this option would imply the --output-at-end option.
-
-ビルドコマンドが失敗したとしても中断せず、可能な限りプロジェクトのビルドを続けます。このオプションは ``-p`` あるいは ``-P`` オプションを指定した場合、暗黙的に有効となります。さらに、このオプションは暗黙的に ``--output-at-end`` オプションを有効にします。
-
-.. index::
-   single: -n
-.. _labelA.3.2:
-
-A.3.2 -n
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-``-n``
-
-.. This can be used to see what would happen if the project were to be built.
-
-このオプションによって、プロジェクトがビルドされる場合にどのような手順が踏まれるのか、実際に確認することができます。
-
-.. index::
-   single: -p
-.. _labelA.3.3:
-
-A.3.3 -p
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-``-p``
-
-.. Watch the filesystem for changes, and continue the build until it succeeds. If this option is specified, omake will restart the build whenever source files are modified. Implies -k.
-
-ファイルシステムの変化を監視し、ビルドが成功するまで実行し続けます。このオプションを指定した場合、 ``omake`` はソースファイルが変更された際にはいつでもビルドを開始します。また、暗黙的に ``-k`` オプションを有効にします。
-
-.. index::
-   single: -P
-.. _labelA.3.4:
-
-A.3.4 -P
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-``-P``
-
-.. Watch the filesystem for changes forever. If this option is specified, omake will restart the build whenever source files are modified. Implies -k.
-
-ファイルシステムの変更点を永久に監視します。このオプションを指定した場合、 ``omake`` はソースファイルが変更された際にはいつでもビルドを開始します。また、暗黙的に ``-k`` オプションを有効にします。
-
-.. index::
-   single: -R
-.. _labelA.3.5:
-
-A.3.5 -R
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-``-R``
-
-.. Ignore the current directory and build the project from its root directory. When omake is run in a subdirectory of a project and no explicit targets are given on the command line, it would normally only build files within the current directory and its subdirectories (more precisely, it builds all the .DEFAULT targets in the current directory and its subdirectories). If the -R option is specified, the build is performed as if omake were run in the project root.
-
-カレントディレクトリを無視し、ルートディレクトリからプロジェクトをビルドします。 ``omake`` をプロジェクトのサブディレクトリから実行し、さらに明示的なターゲットをコマンドライン上から与えていないような場合、OMakeは通常カレントディレクトリとそのサブディレクトリ内にあるファイルのみをビルドします(正確には、すべてのカレントディレクトリ内の ``.DEFAULT`` ターゲットをビルドします)。 ``-R`` オプションを指定した場合、まるで ``omake`` がプロジェクトのルート上から実行しているかのようにビルドを行います。
-
-.. In other words, with the -R option, all the relative targets specified on the command line will be taken relative to the project root (instead of relative to the current directory). When no targets are given on the command line, all the .DEFAULT targets in the project will be built (regardless of the current directory).
-
-言い換えると、 ``-R`` オプションを用いることで、コマンドライン上から指定したすべての関連するターゲットを、(カレントディレクトリに関連付ける代わりに)プロジェクトのルートに関連付けます。なんのターゲットもコマンドライン上に指定していない場合には、プロジェクト上のすべての ``.DEFAULT`` ターゲットが(カレントディレクトリに関係なく)ビルドされます。
-
-.. index::
-   single: -t
-.. _labelA.3.6:
-
-A.3.6 -t
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-``-t``
-
-.. Update the omake database to force the project to be considered up-to-date.
-
-強制的に ``omake`` のデータベースを更新します。
-
-.. index::
-   single: -U
-.. _labelA.3.7:
-
-A.3.7 -U
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-``-U``
-
-.. Do not trust cached build information. This will force the entire project to be rebuilt.
-
-キャッシュされたビルド情報を用いません。このオプションを指定した場合、強制的にプロジェクト全体をリビルドします。
-
-.. index::
-   single: --depend
-.. _labelA.3.8:
-
-A.3.8 -depend
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-``--depend``
-
-.. Do not trust cached dependency information. This will force files to be rescanned for dependency information.
-
-キャッシュされた依存関係の情報を用いません。このオプションを指定した場合、強制的にファイルの依存関係を再スキャンします。
-
-.. index::
-   single: --configure
-.. _labelA.3.9:
-
-A.3.9 -configure
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-``--configure``
-
-.. Re-run static. sections of the included omake files, instead of trusting the cached results.
-
-OMakeファイルに含まれている ``static.`` セクションを、キャッシュされた結果を用いる代わりに再実行します。
-
-.. index::
-   single: --force-dotomake
-.. _labelA.3.10:
-
-A.3.10 -force-dotomake
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-``--force-dotomake``
-
-.. Always use the $HOME/.omake for the .omc cache files.
-
-常に ``$HOME/.omake`` の ``.omc`` キャッシュファイルを用います。
-
-.. index::
-   single: --dotomake
-.. _labelA.3.11:
-
-A.3.11 -dotomake
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-``--dotomake <dir>``
-
-.. Use the specified directory instead of the $HOME/.omake for the placement of the .omc cache files.
-
-``$HOME/.omake`` を用いる代わりに、指定したディレクトリに置かれた ``.omc`` キャッシュファイルを用います。
-
-.. index::
-   single: -j
-   single: 並列ビルド
-.. _labelA.3.12:
-
-A.3.12 -j
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-``-j <count>``
-
-.. Run multiple build commands in parallel. The count specifies a bound on the number of commands to run simultaneously. In addition, the count may specify servers for remote execution of commands in the form server=count. For example, the option -j 2:small.host.org=1:large.host.org=4 would specify that up to 2 jobs can be executed locally, 1 on the server small.host.org and 4 on large.host.org. Each remote server must use the same filesystem location for the project.
-
-平行して複数のビルドコマンドを実行します。 ``count`` では同時に実行するコマンドの限界数を指定します。加えて、 ``server=count`` の形でリモートサーバのコマンドを実行することもできます。例えば、オプション ``-j 2:small.host.org=1:large.host.org=4`` は2つのジョブをローカルで実行し、さらに1つをサーバ ``small.host.org`` 上、4つを ``large.host.org`` 上で実行します。それぞれのリモートサーバはプロジェクト上の同一の場所で実行しなければなりません。
-
-.. Remote execution is currently an experimental feature. Remote filesystems like NFS do not provide adequate file consistency for this to work.
-
-リモートサーバでの実行は現在実験的な機能として搭載しています。NFSのようなリモートファイルシステムでは、十分なファイルの整合性を保つことはできません。
-
-.. index::
-   single: --print-dependencies
-.. _labelA.3.13:
-
-A.3.13 -print-dependencies
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-``--print-dependencies``
-
-.. Print dependency information for the targets on the command line.
-
-コマンドライン上でのターゲットの、依存関係に関する情報を表示します。
-
-.. index::
-   single: --show-dependencies
-.. _labelA.3.14:
-
-A.3.14 -show-dependencies
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-``--show-dependencies <target>``
-
-.. Print dependency information if the target is built.
-
-``target`` をビルドする場合、依存関係に関する情報を表示します。
-
-.. index::
-   single: --all-dependencies
-.. _labelA.3.15:
-
-A.3.15 -all-dependencies
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-``--all-dependencies``
-
-.. If either of the options --print-dependencies or --show-dependencies is in effect, print transitive dependencies. That is, print all dependencies recursively. If neither option --print-dependencies, --show-dependencies is specified, this option has no effect.
-
-オプション ``--print-dependencies`` あるいは ``--show-dependencies`` が指定されている場合、動的な依存関係も表示します。これは、すべての依存関係を再帰的に表示することを表しています。オプション ``--print-dependencies`` , ``--show-dependencies`` のどちらも指定していない場合、このオプションはなんの影響も与えません。
-
-.. index::
-   single: --verbose-dependencies
-.. _labelA.3.16:
-
-A.3.16 -verbose-dependencies
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-``--verbose-dependencies``
-
-.. If either of the options --print-dependencies or --show-dependencies is in effect, also print listings for each dependency. The output is very verbose, consider redirecting to a file. If neither option --print-dependencies, --show-dependencies is specified, this option has no effect.
-
-オプション ``--print-dependencies`` あるいは ``--show-dependencies`` が指定されている場合、各々の依存関係のリストを表示します。出力はとても冗長となり、ファイルへのリダイレクトも考慮されるようになります。オプション ``--print-dependencies`` , ``--show-dependencies`` のどちらも指定していない場合、このオプションはなんの影響も与えません。
-
-.. index::
-   single: --install
-.. _labelA.3.17:
-
-A.3.17 -install
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-``--install``
-
-.. Install default files OMakefile and OMakeroot into the current directory. You would typically do this to start a project in the current directory.
-
-デフォルトのファイル ``OMakefile`` と ``OMakeroot`` をカレントディレクトリにインストールします。典型的な使い方としては、カレントディレクトリ内でOMakeのプロジェクトを開始しようとする際に、このオプションを用います。
-
-.. index::
-   single: --install-all
-.. _labelA.3.18:
-
-A.3.18 -install-all
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-``--install-all``
-
-.. In addition to installing files OMakefile and OMakeroot, install default OMakefiles into each subdirectory of the current directory. cvs(1) rules are used for filtering the subdirectory list. For example, OMakefiles are not copied into directories called CVS, RCCS, etc.
-
-``OMakefile`` と ``OMakeroot`` をインストールし、さらにデフォルトの ``OMakefile`` をカレントディレクトリ内のサブディレクトリにインストールします。その際に、サブディレクトリのリストをフィルタリングするため ``cvs(1)`` のルールが用いられます。例えば、 ``OMakefile`` は ``CVS`` , ``RCCS`` などのディレクトリ内にはコピーされません。
-
-.. index::
-   single: --install-force
-.. _labelA.3.19:
-
-A.3.19 -install-force
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-``--install-force``
-
-.. Normally, omake will prompt before it overwrites any existing OMakefile. If this option is given, all files are forcibly overwritten without prompting.
-
-通常、 ``omake`` は既存の ``OMakefile`` を上書きする前に警告を行います。このオプションが与えられている場合、すべてのファイルは強制的に警告を発することなく上書きされます。
-
-.. index::
-   single: --absname
-.. _labelA.3.20:
-
-A.3.20 -absname
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-``--absname``
-
-.. Filenames should expand to absolute pathnames.
-
-ファイル名は絶対パスとして展開されるようになります。
-
-.. N.B. This is an experimental option. It may become deprecated.
-
-.. note::
-   これは実験的なオプションで、廃止される恐れがあります。
-
-.. _labelA.3.21:
-
-A.3.21 変数の定義
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-``name=[value]``
-
-.. omake variables can also be defined on the command line in the form name=value. For example, the CFLAGS variable might be defined on the command line with the argument CFLAGS="-Wall -g".
-
-``omake`` の変数は ``name=value`` の形で、コマンドライン上から指定することもできます。例えば、 ``CFLAGS`` 変数はコマンドライン上から、引数に ``CFLAGS="-Wall -g"`` を指定することで定義することもできます。
-
-.. _labelA.4:
-
-A.4 さらなるオプション
-----------------------------------
-.. In addition, omake supports a number of debugging flags on the command line. Run omake --help to get a summary of these flags.
-
-これらのオプションに加えて、 ``omake`` ではコマンドライン上で利用できる、数多くのデバッグフラグをサポートしています。これらのフラグの概要について知りたい方は、 ``omake --help`` を実行してください。
-
-.. index::
-   single: 環境変数
-.. _labelA.5:
-
-A.5 環境変数
-----------------------------------
-
-.. index::
-   single: OMAKEFLAGS
-.. _labelA.5.1:
-
-A.5.1 OMAKEFLAGS
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-.. If defines, the OMAKEFLAGS should specify a set of options exactly as they are specified on the command line.
-
-``OMAKEFLAGS`` 変数が定義されている場合、 ``OMAKEFLAGS`` で指定したオプションの集合が、コマンドライン上から指定したものと同様に扱われます。
-
-.. index::
-   single: OMAKELIB
-.. _labelA.5.2:
-
-A.5.2 OMAKELIB
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-.. If defined, the OMAKELIB environment variable should refer to the installed location of the OMake standard library. This is the directory that contains Pervasives.om etc. On a Unix system, this is often /usr/lib/omake or /usr/local/lib/omake, and on Win32 systems it is often c:\Program Files\OMake\lib.
-
-``OMAKELIB`` が定義されている場合、 ``OMAKELIB`` の環境変数はOMakeでの標準ライブラリの場所を表しています。これは ``Pervasives.om`` などを含んだディレクトリとなっています。Unixシステム上では、これは大まかに ``/usr/lib/omake`` か ``/usr/local/lib/omake`` へ関連付けられ、Win32システム上では ``c:\Program Files\OMake\lib`` へ関連付けられます。
-
-.. If not defined, omake uses the default configured location. You should normally leave this unset.
-
-この環境変数が定義されていない場合、 ``omake`` は設定されたデフォルトのパスを用います。通常はこの環境変数を未定義のままにしておいて構いません。
-
-.. _labelA.6:
-
-A.6 関数
-----------------------------------
-
-.. index::
-   single: OMakeFlags()
-.. _labelA.6.1:
-
-A.6.1 OMakeFlags
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-.. The OMakeFlags function can be used within an OMakefile to modify the set of options. The options should be specified exactly as they are on the command line. For example, if you want some specific project to be silent and display a progress bar, you can add the following line to your OMakefile.
-
-``OMakeFlags`` 関数はオプションの集合を ``OMakefile`` の内部で修正するために用いられます。このオプションはコマンドライン上で指定するのと同様にして指定する必要があります。例えば、ある特定のプロジェクト内で出力をサイレント、かつプログレスバーを表示したい場合、あなたは ``OMakefile`` 上に以下の行を追加します。 ::
-
-    OMakeFlags(-S --progress)
-
-.. For options where it makes sense, the options are scoped like variables. For example, if you want OMake to be silent for a single rule (instead of for the entire project), you can use scoping the restrict the range of the option.
-
-この関数によって指定したオプションは、まるで変数のようにスコープ化されます。例えば、OMakeでの出力を(プロジェクト全体で有効にする代わりに)一つのルール上でサイレントにしたい場合は、オプションを適用させる範囲をそのままスコープ化します。 ::
-
-    section
-        # fooが生成される際に、コマンドラインの出力を表示しません
-        OMakeFlags(-S)
-
-        foo: fee
-           echo "This is a generated file" > foo
-           cat fee >> foo
-           chmod 555 foo
-
-.. _labelA.7:
-
-A.7 オプションの処理過程
-----------------------------------
-.. When omake is invoked, the options are processed in the following order.
-
-``omake`` が実行された際、オプションは以下の順に処理されます。
-
-..   1. All options specified by the OMAKEFLAGS environment variable are defined globally.
-     2. All options from the command line are defined globally.
-     3. Any individual calls the the OMakeFlags function modify the options locally. 
-
-1. ``OMAKEFLAGS`` 環境変数によって指定したすべてのオプションが、プロジェクト全体に作用します。
-2. コマンドラインによって指定したすべてのオプションが、プロジェクト全体に作用します。
-3. ``OMakeFlags`` 関数によって呼び出された任意のオプションが、プロジェクトの一部分に作用します。
-
-.. index::
-   single: .omakerc
-.. _labelA.8:
-
-A.8 .omakerc
-----------------------------------
-.. If the $(HOME)/.omakerc exists, it is read before any of the OMakefiles in your project. The .omakerc file is frequently used for user-specific customization. For example, instead of defining the OMAKEFLAGS environment variable, you could add a line to your .omakerc.
-
-``$(HOME)/.omakerc`` が存在する場合、任意の ``OMakefiles`` が読み込まれる前にまず  ``$(HOME)/.omakerc`` が読み込まれます。このファイルは、ユーザが自由にOMakeをカスタマイズする用途として頻繁に用いられます。例えば、 ``OMAKEFLAGS`` 環境変数を定義する代わりに、以下の行を ``.omakerc`` に加えることもできます。 ::
-
-    $(HOME)/.omakerc:
-        # プライベートなオプションを記述
-        OMakeFlags(-S --progress)
diff --git a/osh.rst b/osh.rst
deleted file mode 100644 (file)
index aa5d731..0000000
--- a/osh.rst
+++ /dev/null
@@ -1,100 +0,0 @@
-.. 15-osh
-
-.. _label15:
-
-15. OSHシェル
-==================================
-.. OMake also includes a standalone command-line interpreter osh that can be used as an interactive shell. The shell uses the same syntax, and provides the same features on all platforms omake supports, including Win32.
-
-OMakeはまた、独立して動くコマンドラインインタープリタ ``osh`` を含んでいます。これはインタラクティブなシェルとして使うことができます。このシェルはomakeと同様の構文で利用することができ、さらにWin32を含む、omakeがサポートしているすべてのプラットフォーム上で同様の機能を提供します。
-
-.. index::
-   single: prompt
-   single: ignoreeof
-.. _label15.1:
-
-15.1 起動時
-----------------------------------
-.. On startup, osh reads the file ~/.oshrc if it exists. The syntax of this file is the same as an OMakefile. The following additional variables are significant.
-
-起動時に、oshは存在しているのであれば ``~/.oshrc`` を読み込みます。このファイルの構文は ``OMakefile`` と同様です。また、以下の追加された変数は、osh上で重要な意味を持ちます。
-
-* **prompt**
-  
-  .. The prompt variable specifies the command-line prompt. It can be a simple string.
-  
-  ``prompt`` 変数はコマンドラインプロンプトを指定します。この変数は単純な文字列を指定できます。 ::
-  
-      prompt = osh>
-  
-  .. Or you may choose to define it as a function of no arguments.
-  
-  あるいは、引数をもたない関数として定義することもできます。 ::
-  
-      prompt() =
-          return $"<$(USER):$(HOST) $(homename $(CWD))>"
-  
-  .. An example of the latter prompt is as follows.
-  
-  後者のプロンプトの例は以下のようになります。 ::
-
-      <jyh:kenai.yapper.org ~>cd links/omake
-      <jyh:kenai.yapper.org ~/links/omake>
-  
-  .. If you include any "invisible" text in the prompt (such as various terminal escape sequences), they must be wrapped using the prompt-invisible function. For example, to create a bold prompt on terminals that support it, you can use the following.
-  
-  プロンプト上にターミナルのエスケープ文字のような『見えない』文字を含ませたい場合は、 ``prompt-invisible`` 関数( :ref:`label10.11.26` )を使ってラップさせなければなりません。例えば、サポートしているターミナル上でプロンプトを太字にしたい場合、以下のように書くことができます。 ::
-
-        prompt =
-           bold-begin = $(prompt-invisible $(tgetstr bold))
-           bold-end = $(prompt-invisible $(tgetstr sgr0))
-           value $(bold-begin)$"osh>"$(bold-end)
-
-* **ignoreeof**
-  
-  .. If the ignoreeof is true, then osh will not exit on a terminal end-of-file (usually ^D on Unix systems).
-  
-  ``ignoreeof`` が ``true`` の場合、 ``osh`` はターミナルの"end-of-file(EOF)"で終了しません(Unixシステム上では通常 ``^D`` となります)。
-
-.. index::
-   single: Shell
-.. _label15.2:
-
-15.2 エイリアス
-----------------------------------
-.. Command aliases are defined by adding functions to the Shell. object. The following alias adds the -AF option to the ls command.
-
-コマンドのエイリアスは ``Shell.`` オブジェクトに関数を追加することによって定義できます。以下のエイリアスは ``-AF`` オプションを ``ls`` コマンドに追加します。 ::
-
-    Shell. +=
-       ls(argv) =
-          "ls" -AF $(argv)
-
-.. Quoted commands do not undergo alias expansion. The quotation "ls" prevents the alias from being recursive.
-
-クオートされたコマンドはエイリアス展開の影響を受けません。 ``"ls"`` のようにクオーテーションをつけることで、再帰的にエイリアスとなることを防ぎます。
-
-.. _label15.3:
-
-15.3 インタラクティブな構文
--------------------------------------
-.. The interactive syntax in osh is the same as the syntax of an OMakefile, with one exception in regard to indentation. The line before an indented block must have a colon at the end of the line. A block is terminated with a . on a line by itself, or ^D. In the following example, the first line if true has no body, because there is no colon.
-
-``osh`` でのインタラクティブな構文はインデントという一つの例外を除いて、 ``OMakefile`` の構文と同様です。まず、インデントされたブロックの前にある行は、必ず行の終わりにコロン:をつける必要があります。次に、 ``.`` を行の終わりにつけるか ``^D`` を使うことで、対象のブロックを終了させます。以下の例では、最初の行の ``if true`` はコロンをつけていないため、内容のブロックを持つことはできません。 ::
-
-   # 以下のifは内容を持ちません
-   osh>if true
-   # 以下のifは内容を持ちます
-   osh>if true:
-   if>       if true:
-   if>          println(Hello world)
-   if>          .
-   Hello world
-
-.. Note that osh makes some effort to modify the prompt while in an indented body, and it auto-indents the text.
-
-インデントされたブロックの中にいる際には、プロンプトをいくらか修正する必要があり、かつ ``osh`` は自動的にテキストをインデントすることに注意してください。
-
-.. The colon signifier is also allowed in files, although it is not required.
-
-また、コロン修飾子はファイルにも適用できますが、必須ではありません。
diff --git a/pervasives.rst b/pervasives.rst
deleted file mode 100644 (file)
index 7581da4..0000000
+++ /dev/null
@@ -1,836 +0,0 @@
-.. 12-prevasives
-
-.. _label12:
-
-12. 標準的なオブジェクト群
-==================================
-.. Pervasives defines the objects that are defined in all programs. The following objects are defined.
-
-ここでの『広く使われている』は、すべてのプログラムで使われているオブジェクトを意味しています。以下のオブジェクトが定義されています。
-
-.. _label12.1:
-
-12.1 広く使われているオブジェクト
-----------------------------------
-
-.. index::
-   single: Object
-.. _label12.1.1:
-
-12.1.1 Object
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-親オブジェクト : 無し
-
-.. The Object object is the root object. Every class is a subclass of Object.
-
-``Object`` オブジェクトはルートとなるオブジェクトです。すべてのクラスは ``Object`` のサブクラスです。
-
-.. It provides the following fields:
-
-以下のフィールドやメソッドを提供します。
-
-.. the number of fields and methods in the object. 
-   returns true iff the <var> is a field or method of the object.
-   adds the field to the object, returning a new object. 
-   fetches the field or method from the object; it is equivalent to $(o.<var>), but the variable can be non-constant. 
-   maps a function over the object. The function should take two arguments; the first is a field name, the second is the value of that field. The result is a new object constructed from the values returned by the function. 
-   the object-foreach form is equivalent to object-map, but with altered syntax.
-
-* ``$(o.object-length)`` : オブジェクトのメソッドとフィールドの総数
-* ``$(o.object-mem <var>)`` : <var>がオブジェクトのフィールドやメソッドであった場合は ``true`` を返します。
-* ``$(o.object-add <var, <value>)`` : オブジェクトにフィールドを追加した新しいオブジェクトを返します。
-* ``$(o.object-find <var>)`` : オブジェクトのメソッドやフィールドを取得します。これは ``$(o.<var>)`` と等価ですが、変数は定数でなくても構いません。
-* ``$(o.object-map <fun>)`` : オブジェクト全体に対して関数を適用します。この関数は二つの引数を取り、一つ目はフィールドの名前で、二番目にはフィールドの値を指定します。結果は関数によって返される値が適用された、新しいオブジェクトを返します。
-* ``$(o.object-foreach)`` : ``object-foreach`` は ``object-map`` と等価ですが、別の構文を適用できます。 ::
-
-     o.object-foreach(<var1>, <var2>)
-        <body>
-  
-  .. For example, the following function prints all the fields of an object o.
-  
-  例えば、以下の関数はオブジェクト ``o`` のすべてのフィールドを表示します。 ::
-
-       PrintObject(o) =
-        o.object-foreach(v, x)
-           println($(v) = $(x))
-
-  .. The export form is valid in a object-foreach body. The following function collects just the field names of an object.
-
-  ``export`` 文は ``object-foreach`` の内部に適用できます。以下の関数ではオブジェクトのフィールド名を収集します。 ::
-  
-     FieldNames(o) =
-        names[] =
-        o.object-foreach(v, x)
-           names[] += $(v)
-           export
-        return $(names)
-
-.. index::
-   single: Map
-.. _label12.1.2:
-
-12.1.2 Map
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-親オブジェクト : ``Object``
-
-.. A Map object is a dictionary from values to values. The <key> values are restricted to simple values: integers, floating-point numbers, strings, files, directories, and arrays of simple values.
-
-``Map`` オブジェクトは値から値を返す辞書です。 ``<key>`` の値は単純な型のみが使用できます。具体的には、整数型、浮動小数点型、文字列型、ファイル型、辞書型、そして単純な型で構成された配列です。
-
-.. The Map object provides the following methods.
-
-Mapオブジェクトは以下のメソッドを提供します。
-
-.. the number of items in the map. 
-   returns true iff the <key> is defined in the map. 
-   adds the field to the map, returning a new map. 
-   fetches the field from the map. 
-   fetches an array of all the keys in the map, in alphabetical order. 
-   fetches an array of all the values in the map, in the alphabetical order of the corresponding keys.
-   maps a function over the map. The function should take two arguments; the first is a field name, the second is the value of that field. The result is a new object constructed from the values returned by the function. 
-   the foreach form is equivalent to map, but with altered syntax.
-
-* ``$(o.length)`` : 辞書に格納されているアイテムの総数
-* ``$(o.mem <key>)`` : ``<key>`` が辞書に定義されている場合は ``true`` を返します。
-* ``$(o.add <key>, <value>)`` : 辞書にフィールドを追加した、新しい辞書を返します。
-* ``$(o.find <key>)`` : 辞書から対象のフィールドを取得します。
-* ``$(o.keys)`` : 辞書の中にあるすべてのキーの配列をアルファベット順で取得します。
-* ``$(o.values)`` : 辞書の中にあるすべての値の配列を、キーのアルファベット順で取得します。
-* ``$(o.map <fun>)`` : 一つ目はフィールドの名前で、二番目にはフィールドの値を指定します。結果は関数によって返される値が適用された、新しいオブジェクトを返します。
-* ``$(o.foreach)`` : ``foreach`` 文は ``map`` と等価ですが、別の構文を適用できます。 ::
-
-     o.foreach(<var1>, <var2>)
-        <body>
-  
-  .. For example, the following function prints all the fields of an object o.
-  
-  例えば、以下の関数はオブジェクト ``o`` のすべてのフィールドを表示します。 ::
-
-     PrintObject(o) =
-        o.foreach(v, x)
-           println($(v) = $(x))
-  
-  .. The export form is valid in a foreach body. The following function collects just the field names of the map.
-   
-  ``export`` 文は ``object-foreach`` の内部に適用できます。以下の関数では辞書のフィールド名を収集します。 ::
-
-     FieldNames(o) =
-        names =
-        o.foreach(v, x)
-           names += $(v)
-           export
-        return $(names)
-
-.. There is also simpler syntax when the key is a string. The table can be defined using definitions with the form $|key| (the number of pipe symbols | is allowed to vary).
-
-キーが文字列である場合には単純な記法が用意されています。キー-値のテーブルは ``$|key|`` の文を用いて定義することができます(パイプシンボル ``|`` の数は、多様性のためにいくらでも使うことができます)。 ::
-
-    $|key 1| = value1
-    $||key1|key2|| = value2    # キーは key1|key2
-    X = $|key 1|               # Xにフィールドの値 $|key 1| を定義
-
-.. The usual modifiers are also allowed. The expression $`|key| represents lazy evaluation of the key, and $,|key| is normal evaluation.
-
-通常用いる修飾子も適用できます。式 ``$`|key|`` はキーの遅延評価として解釈されて、また式 ``$,|key|`` は通常の評価を行います。
-
-.. index::
-   single: Number
-.. _label12.1.3:
-
-12.1.3 Number
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-親オブジェクト : ``Object``
-
-.. The Number object is the parent object for integers and floating-point numbers. 
-
-``Number`` オブジェクトは整数や浮動小数点の親オブジェクトです。
-
-.. index::
-   single: Int
-.. _label12.1.4:
-
-12.1.4 Int
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-親オブジェクト : ``Number``
-
-.. The Int object represents integer values. 
-
-``Int`` オブジェクトは整数を表現します。
-
-.. index::
-   single: Float
-.. _label12.1.5:
-
-12.1.5 Float
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-親オブジェクト : ``Number``
-
-.. The Float object represents floating-point numbers. 
-
-``Float`` オブジェクトは浮動小数点を表現します。
-
-.. index::
-   single: Sequence
-.. _label12.1.6:
-
-12.1.6 Sequence
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-親オブジェクト : ``Object``
-
-.. The Sequence object represents a generic object containing sequential elements. It provides the following methods.
-
-``Sequence`` オブジェクトは一次元的に成分が格納されている、一般的なオブジェクトを表現します。このオブジェクトは以下のメソッドを提供しています。
-
-.. the number of elements in the sequence. 
-   maps a function over the fields in the sequence. The function should take one argument. The result is a new sequence constructed from the values returned by the function.
-   the foreach form is equivalent to map, but with altered syntax.
-
-* ``$(s.length)`` : シーケンスの長さを返します。
-* ``$(s.map <fun>)`` : シーケンスのフィールド全体に対して関数を適用します。この関数は一つの引数を取ります。結果は関数によって返される値からなる、新しいシーケンスを返します。
-* ``$(s.foreach)`` : ``foreach`` 文は ``map`` と等価ですが、別の構文を適用できます。 ::
-
-     s.foreach(<var>)
-        <body>
-  
-  .. For example, the following function prints all the elements of the sequence.
-  
-  例えば、以下の関数ではシーケンスのすべての成分を表示します。 ::
-
-     PrintSequence(s) =
-        s.foreach(x)
-           println(Elem = $(x))
-  
-  .. The export form is valid in a foreach body. The following function counts the number of zeros in the sequence.
-  
-  ``export`` 文は ``foreach`` の内部に適用できます。以下の関数はシーケンスの0の数を数えます。 ::
-  
-     Zeros(s) =
-        count = $(int 0)
-        s.foreach(v)
-           if $(equal $(v), 0)
-              count = $(add $(count), 1)
-              export
-           export
-        return $(count)
-
-.. tests whether each element of the sequence satifies a predicate. 
-
-* ``$(s.forall <fun>)`` : シーケンスの各々の成分が、与えられた関数の評価を満足しているかどうか調べます。
-
-.. tests whether the sequence contains an element that satisfies a predicate. 
-
-* ``$(s.exists <fun>)`` : シーケンスに与えられた関数の評価を満足するような成分があるかどうか調べます。
-
-.. sorts a sequence. The <fun> is a comparison function. It takes two elements (x, y) of the sequence, compares them, and returns a negative number if x < y, a positive number if x > y, and zero if the two elements are equal.
-
-* ``$(s.sort <fun>)`` : シーケンスをソートします。 ``<fun>`` は比較用の関数です。この関数は二つの成分 ``(x, y)`` を持つシーケンスを引数に取り、x,yを比較して、もし x < y であったのなら負の値を返し、 x > y であったなら正の値を返し、二つの成分が等価であったなら0を返します。 ::
-
-    osh> items = $(int 0 3 -2)
-    osh> items.forall(x => $(gt $x, 0))
-    - : bool = false
-    osh> items.exists(x => $(gt $x, 0))
-    - : bool = true
-    osh> items.sort($(compare))
-    - : Array = -2 3 0
-
-
-.. index::
-   single: Array
-.. _label12.1.7:
-
-12.1.7 Array
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-親オブジェクト : ``Sequence``
-
-.. The Array is a random-access sequence. It provides the following additional methods.
-
-``Array`` は自由にアクセスできるシーケンスです。このオブジェクトは以下の追加メソッドを提供しています。
-
-.. returns element i of the sequence. 
-   returns the reversed sequence. 
-
-* ``$(s.nth <i>)`` : シーケンスの ``i`` 番めの成分を返します。
-* ``$(s.rev <i>)`` : 逆転させたシーケンスを返します。
-
-.. index::
-   single: String
-.. _label12.1.8:
-
-12.1.8 String
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-親オブジェクト : ``Array``
-
-.. index::
-   single: Fun
-.. _label12.1.9:
-
-12.1.9 Fun
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-親オブジェクト : ``Object``
-
-.. The Fun object provides the following methods. 
-
-``Fun`` オブジェクトは以下のメソッドを提供しています。
-
-.. the arity if the function. 
-
-* ``$(f.arity)`` : 関数の場合はアリティ(関数が取る引数の個数)を返します。
-
-.. index::
-   single: Rule
-.. _label12.1.10:
-
-12.1.10 Rule
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-親オブジェクト : ``Object``
-
-.. The Rule object represents a build rule. It does not currently have any methods. 
-
-``Rule`` オブジェクトはビルドルールを表現します。これは現在なんのメソッドも持っていません。
-
-.. index::
-   single: Target
-.. _label12.1.11:
-
-12.1.11 Target
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-親オブジェクト : ``Object``
-
-.. The Target object contains information collected for a specific target file.
-
-``Target`` オブジェクトは指定したターゲットファイルの情報を収集しているオブジェクトです。
-
-.. the target file. 
-   the files that may be modified by a side-effect when this target is built. 
-   static dependencies that must be built before this target can be scanned. 
-   statically-defined build dependencies of this target. 
-   all the build dependencies for the target, including static and scanned dependencies. 
-   all the value dependencies associated with the build.
-   the commands to build the target. 
-   if output was diverted to a file, with one of the --output-* options A, this field names that file. Otherwise it is false. 
-
-* ``target`` : ターゲットファイル
-* ``effects`` : ターゲットがビルドされたときに、副次的に修正されるであろうファイル群
-* ``scanner_deps`` : ターゲットがスキャンできるようになる前にビルドしなければならない静的な依存関係
-* ``static-deps`` : 静的に定義されている、ターゲットの依存関係
-* ``build-deps`` : 静的、あるいはスキャンされた依存関係を含む、ターゲットに対するすべての依存関係
-* ``build-values`` : ビルドに関係している、すべての依存関係の値
-* ``build-commands`` : ターゲットをビルドするためのコマンド
-* ``output-file`` : ``--output-*`` オプション( :ref:`labelA.2.8` 以降を参照)を用いて、出力が適当なファイルに書き込まれるような場合、このフィールドはファイル名を表します。そうでない場合は ``false`` を示します。
-
-.. The object supports the following methods.
-
-このオブジェクトは以下のメソッドをサポートしています。
-
-.. returns a Target object for the given file. Raises a RuntimeException if the specified target is not part of the project. 
-   returns a Target object for the given file, or false if the file is not part of the project. 
-
-* ``find(file)`` : 与えられたファイルのターゲットオブジェクトを返します。指定したターゲットがプロジェクトの一部でない場合は ``RuntimeException`` を送出します。
-* ``find-optional(file)`` : 与えられたファイルのターゲットオブジェクトを返します。指定したターゲットがプロジェクトの一部でない場合は ``false`` を返します。
-
-.. NOTE: the information for a target is constructed dynamically, so it is possible that the Target object for a node will contain different values in different contexts. The easiest way to make sure that the Target information is complete is to compute it within a rule body, where the rule depends on the target file, or the dependencies of the target file.
-
-.. note::
-  ターゲットの情報は動的に構築されるので、あるノードの ``Target`` オブジェクトは異なる箇所で異なった値を含む場合があります。 ``Target`` の情報が完全にするためのもっとも簡単な方法は、対象のターゲットファイルに依存しているルール中、もしくは対象のターゲットファイルの依存関係の中で ``Target`` オブジェクトを計算することです。
-
-.. index::
-   single: Node
-.. _label12.1.12:
-
-12.1.12 Node
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-親オブジェクト : ``Object``
-
-.. The Node object is the parent object for files and directories. It supports the following operations. 
-
-``Node`` オブジェクトはファイルやディレクトリの親オブジェクトです。このオブジェクトは以下の操作をサポートしています。
-
-.. returns a stat object for the file. If the file is a symbolic link, the stat information is for the destination of the link, not the link itself.
-   returns a stat object for the file or symbolic link.
-   removes the file. 
-   renames the file. 
-   creates a hard link <dst> to this file. 
-   create a symbolic link <dst> to this file. 
-   change the permission of this file. 
-   change the owner and group id of this file. 
-
-* ``$(node.stat)`` : ファイルの ``stat`` オブジェクトを返します。もしファイルがシンボリックリンクであったなら、 ``stat`` の情報はリンク先になります。リンク自身ではありません。
-* ``$(node.lstat)`` : ファイルか、シンボリックリンクの ``stat`` オブジェクトを返します。
-* ``$(node.unlink)`` : ファイルを消去します。
-* ``$(node.rename <file>)`` : ファイルをリネームします。
-* ``$(node.link <dst>)`` : このファイルのハードリンクを ``<dst>`` に生成します。
-* ``$(node.symlink <file>)`` : このファイルのシンボリックリンクを ``<dst>`` に生成します。
-* ``$(node.chmod <perm>)`` : このファイルのパーミッションを変更します。
-* ``$(node.chown <uid>, <gid>)`` : このファイルの所有者とグループIDを変更します。
-
-.. index::
-   single: File
-.. _label12.1.13:
-
-12.1.13 File
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-親オブジェクト : ``Node``
-
-.. The file object represents the name of a file. 
-
-``File`` オブジェクトはファイル名を表現します。
-
-.. index::
-   single: Dir
-.. _label12.1.14:
-
-12.1.14 Dir
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-親オブジェクト : ``Node``
-
-.. The Dir object represents the name of a directory. 
-
-``Dir`` オブジェクトはディレクトリ名を表現します。
-
-.. index::
-   single: Channel
-.. _label12.1.15:
-
-12.1.15 Channel
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-親オブジェクト : ``Object``
-
-.. A Channel is a generic IO channel. It provides the following methods. 
-
-``Channel`` オブジェクトは一般的なIOチャネルを表現します。このオブジェクトは以下のメソッドを提供しています。
-
-.. close the channel. 
-   returns the file name associated with the channel. 
-
-* ``$(o.close)`` : チャネルを閉じます。
-* ``$(o.name)`` : チャネルに関係しているファイル名を返します。
-
-.. index::
-   single: InChannel
-.. _label12.1.16:
-
-12.1.16 InChannel
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-親オブジェクト : ``Channel``
-
-.. A InChannel is an input channel. The variable stdin is the standard input channel.
-
-``InChannel`` は入力チャネルです。変数 ``stdin`` は標準入力チャネルです。
-
-.. It provides the following methods. 
-
-このオブジェクトは以下のメソッドを提供しています。
-
-.. open a new input channel. 
-   open a new input channel, using a string as input. 
-   reads the given number of characters from the channel 
-   reads a line from the channel 
-
-* ``$(InChannel.fopen <file>)`` : 新しい入力チャネルを開きます。
-* ``$(InChannel.of-string <string>)`` : 文字列を入力として、新しい入力チャネルを開きます。
-* ``$(o.read <number>)`` : チャネルから、与えられた数だけ文字を読み込みます。
-* ``$(o.readln)`` : チャネルから一行を読み込みます。
-
-.. index::
-   single: OutChannel
-.. _label12.1.17:
-
-12.1.17 OutChannel
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-親オブジェクト : ``Channel``
-
-.. A OutChannel is an output channel. The variables stdout and stderr are the standard output and error channels.
-
-``OutChannel`` は出力チャネルです。変数 ``stdout`` と ``stderr`` は標準出力とエラーチャネルです。
-
-.. It provides the following methods. 
-
-このオブジェクトは以下のメソッドを提供しています。
-
-.. open a new output channel. 
-   open a new output channel, writing to a string. 
-   get the current string of output, for an output channel created as OutChannel.open-string. 
-   opens a new output channel, appending to the file. 
-   flush the output channel. 
-   print a string to the channel. 
-   print a string to the channel, followed by a line terminator. 
-
-* ``$(OutChannel.fopen <file>)`` : 新しい出力チャネルを開きます。
-* ``$(OutChannel.string)`` : 文字列を書き込む、新しい出力チャネルを開きます。
-* ``$(OutChannel.to-string)`` : 現在の出力チャネルの文字列を取得します。これは ``OutChannel.open-string`` を使って作られた、出力チャネル用のメソッドです。
-* ``$(OutChannel.append)`` : ファイルを追加した、新しい出力チャネルを開きます。
-* ``$(c.flush)`` : 出力チャネルをクリアします。
-* ``$(c.print <string>)`` : チャネルに文字列を出力します。
-* ``$(c.print <string>)`` : チャネルに、改行コードを付与した文字列を出力します。
-
-.. index::
-   single: Location
-.. _label12.1.18:
-
-12.1.18 Location
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-親オブジェクト : ``Location``
-
-.. The Location object represents a location in a file. 
-
-``Location`` オブジェクトはファイルの位置を表現します。
-
-.. index::
-   single: Exception
-.. _label12.1.19:
-
-12.1.19 Exception
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-親オブジェクト : ``Object``
-
-.. The Exception object is used as the base object for exceptions. It has no fields. 
-
-``Exception`` オブジェクトは例外の基底となるオブジェクトとして用いられます。このオブジェクトはなんのフィールドやメソッドを持ちません。
-
-.. index::
-   single: RuntimeException
-.. _label12.1.20:
-
-12.1.20 RuntimeException
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-親オブジェクト : ``Exception``
-
-.. The RuntimeException object represents an exception from the runtime system. It has the following fields.
-
-``RuntimeException`` オブジェクトはランタイムシステムからの例外を表現します。このオブジェクトは以下のフィールドを持ちます。
-
-.. a string representing the location where the exception was raised.
-   a string containing the exception message. 
-
-* ``position`` : 例外が送出された位置を表現している文字列
-* ``message`` : 例外のメッセージを保持している文字列
-
-.. index::
-   single: UnbuildableException
-.. _label12.1.21:
-
-12.1.21 UnbuildableException
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-親オブジェクト : ``Exception``
-
-.. The UnbuildableException object should be used to signal that a target is not buildable. It will be caught by functions such as target-exists. This exception has the following fields:
-
-``UnbuildableException`` オブジェクトはターゲットがビルドできないことを知らせるために用いられます。このオブジェクトは ``target-exists()`` のような関数を使った場合に捕えられます。この例外は以下のフィールドを持ちます。
-
-.. indicates which target is not buildable. 
-   a string containing the exception message. 
-
-* ``target`` : どのターゲットがビルドできないのかを示します。
-* ``message`` : 例外のメッセージを含んでいる文字列
-
-.. index::
-   single: Shell
-   single: echo()
-   single: jobs()
-   single: cd()
-   single: bg()
-   single: fg()
-   single: stop()
-   single: wait()
-   single: kill()
-   single: which()
-   single: where()
-   single: rehash()
-   single: ln-or-cp()
-   single: history()
-   single: digest()
-   single: grep()
-   single: pwd()
-   single: mkdir()
-   single: cp()
-   single: mv()
-   single: rm()
-   single: chmod()
-   single: cat()
-   single: test()
-   single: find()
-.. _label12.1.22:
-
-12.1.22 Shell
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-親オブジェクト : ``Object``
-
-.. The Shell object contains the collection of builtin functions available as shell commands.
-
-``Shell`` オブジェクトはシェルコマンドとして利用できるビルドイン関数のコレクションを含んでいます。
-
-.. You can define aliases by extending this object with additional methods. All methods in this class are called with one argument: a single array containing an argument list.
-
-あなたはこのオブジェクトにメソッドを追加し拡張することで、エイリアスを定義することができます。このクラスの中にあるすべてのメソッドは一つの引数をとる必要があります。引数には引数のリストが含まれた、単純な配列が与えられます。
-
-* ``echo``
-  
-  .. The echo function prints its arguments to the standard output channel. 
-  
-  ``echo`` 関数は引数を標準出力チャネルに表示します。
-
-* ``jobs``
-  
-  .. The jobs method prints the status of currently running commands. 
-
-  ``jobs`` メソッドは現在実行しているコマンドの状態を表示します。
-  
-* ``cd``
-  
-  .. The cd function changes the current directory. Note that the current directory follows the usual scoping rules. For example, the following program lists the files in the foo directory, but the current directory is not changed.
-  
-  ``cd`` 関数はカレントディレクトリを変更します。カレントディレクトリは現在のスコーピングルールに従うことに注意してください。例えば、以下のプログラムでは ``foo`` ディレクトリのファイルをリストしていますが、カレントディレクトリは変更されません。 ::
-  
-     section
-        echo Listing files in the foo directory...
-        cd foo
-        ls
-
-     echo Listing files in the current directory...
-     ls
-
-* ``bg``
-  
-  .. The bg method places a job in the background. The job is resumed if it has been suspended. 
-  
-  ``bg`` メソッドはバックグラウンドにジョブを移します。ジョブが中断(suspended)されている場合、そのジョブは再開されます。
-
-* ``fg``
-  
-  .. The fg method brings a job to the foreground. The job is resumed if it has been suspended. 
-  
-  ``fg`` メソッドはジョブをフォアグラウンドに持っていきます。ジョブが中断されている場合、そのジョブは再開されます。
-  
-* ``stop``
-  
-  .. The stop method suspends a running job. 
-  
-  ``stop`` 関数は実行しているジョブを中断します。
-
-* ``wait``
-  
-  .. The wait function waits for a running job to terminate. It is not possible to wait for a suspended job.
-  
-  ``wait`` 関数は実行しているジョブが終了するまで待機します。この関数は、中断しているジョブを待機することができません。
-  
-  .. The job is not brought to the foreground. If the wait is interrupted, the job continues to run in the background. 
-  
-  ジョブをフォアグラウンドに持っていくことはしません。また、 ``wait`` が割り込まれた場合、ジョブはバックグラウンド上で実行し続けます。
-
-* ``kill``
-  
-  .. The kill function signal a job.
-  
-  ``kill`` 関数はジョブにシグナルを送ります。 ::
-  
-    kill [signal] <pid...>.
-  
-  .. The signals are either numeric, or symbolic. The symbolic signals are named as follows.
-  
-  シグナルは数値かシンボリックのどちらでも構いません。シンボリックシグナルは以下のように命名されています。
-  
-  ABRT, ALRM, HUP, ILL, KILL, QUIT, SEGV, TERM, USR1, USR2, CHLD, STOP, TSTP, TTIN, TTOU, VTALRM, PROF
-
-* ``exit``
-  
-  .. The exit function terminates the current session. 
-  
-  ``exit`` 関数は現在のセッションを終了します。
-
-* ``which`` , ``where``
-  
-  .. See the documentation for the corresponding functions. 
-  
-  相当する関数のドキュメントを参照してください。
-
-* ``rehash``
-  
-  .. Reset the search path. 
-  
-  検索パスをリセットします。
-
-* ``ln-or-cp`` *src dst*
-  
-  .. Links or copies src to dst, overwriting dst. Namely, ln-or-cp would first delete the dst file (unless it is a directory), if it exists. Next it would try to create a symbolic link dst poiting to src (it will make all the necessary adjustmnents of relative paths). If symbolic link can not be created (e.g. the OS or the filesystem does not support symbolic links), it will try to create a hard link. If that fails too, it will try to forcibly copy src to dst. 
-  
-  *src* を *dst* にリンクもしくはコピーします。 *dst* は上書きされます。通常、 ``ln-or-cp`` は初めに出力先のファイルを(存在している場合は)消去します。次にこの関数は入力先のファイルを指し示しているシンボリックリンクを出力先に生成します(パスはできる限り相対パスとして設定されます)。シンボリックリンクが生成できない場合(例. OSやファイルシステムがシンボリックリンクをサポートしていない場合)、この関数はハードリンクを生成しようと試みます。もしこの試みも失敗したのなら、強制的に入力先のファイルを出力先にコピーしようと試みます。
-
-* ``history``
-  
-  .. Print the current command-line history. 
-  
-  現在のコマンドライン履歴を表示します。
-
-* ``digest``
-  
-  .. Print the digests of the given files. 
-  
-  与えられたファイルの要約を出力します。
-
-* Win32 関数群
-  
-  .. Win32 doesn't provide very many programs for scripting, except for the functions that are builtin to the DOS cmd.exe. The following functions are defined on Win32 and only on Win32. On other systems, it is expected that these programs already exist.
-  
-  Win32ではスクリプトのために使える、多くのプログラム(DOS ``cmd.exe`` に含まれている関数を除く)を提供しています。以下の関数はWin32で定義されており、Win32上でしか使えません。他のシステム上では、この関数はすでに存在している他のプログラムに置き換わることになるでしょう。
-  
-  * ``grep``
-    ::
-
-       grep [-q] [-n] pattern files...
-    
-    .. The grep function calls the omake grep function. 
-    
-    ``grep`` 関数はomakeの ``grep`` 関数を呼び出します。
-
-.. Internal versions of standard system commands.
-
-* omake内部の標準システムコマンド
-  
-  .. By default, omake uses internal versions of the following commands: cp, mv, cat, rm, mkdir, chmod, test, find. If you really want to use the standard system versions of these commands, set the USE_SYSTEM_COMMANDS as one of the first definitions in your OMakeroot file.
-  
-  通常、以下のコマンドはomakeが内部に保有している関数を使います: ``cp`` , ``mv`` , ``cat`` , ``rm`` , ``mkdir`` , ``chmod`` , ``test`` , ``find`` 。もしあなたがどうしてもこれらのコマンドを、システムが標準で使っているコマンドで呼び出したいのなら、 ``USE_SYSTEM_COMMANDS`` を ``OMakeroot`` ファイルの先頭に設定してください。
-  
-  * ``pwd``
-    ::
-    
-        pwd
-    
-    .. The pwd alias would print the absolute path to current directory.
-    
-    ``pwd`` エイリアスはカレントディレクトリの絶対パスを表示します。
-  
-  * ``mkdir``
-    ::
-    
-        mkdir [-m <mode>] [-p] files
-    
-    .. The mkdir function is used to create directories. The -verb+-m+ option can be used to specify the permission mode of the created directory. If the -p option is specified, the full path is created. 
-    
-    ``mkdir`` 関数はディレクトリを生成します。 ``-m`` オプションには生成されるディレクトリのパーミッションを指定します。 ``-p`` オプションが指定された場合、存在しない親ディレクトリもまとめて生成します。
-  
-  * ``cp``
-    
-  * ``mv``
-    ::
-    
-        cp [-f] [-i] [-v] src dst
-        cp [-f] [-i] [-v] files dst
-        mv [-f] [-i] [-v] src dst
-        mv [-f] [-i] [-v] files dst
-    
-    .. The cp function copies a src file to a dst file, overwriting it if it already exists. If more than one source file is specified, the final file must be a directory, and the source files are copied into the directory.
-    
-    ``cp`` 関数は ``src`` ファイルを ``dst`` ファイルにコピーします。出力先のファイルが存在している場合は上書きします。一つ以上の入力ファイルが指定された場合、最後のファイルはディレクトリでなければならず、入力ファイルはそのディレクトリの内部にコピーされます。
-
-    * **-f**
-      
-      .. Copy files forcibly, do not prompt. 
-      
-      確認をしないで、強制的にファイルをコピーします。
-    
-    * **-i**
-      
-      .. Prompt before removing destination files. 
-      
-      出力先のファイルを消去する前に確認します。
-    
-    * **-v**
-      
-      .. Explain what is happening. 
-      
-      実際になにが行われているのか表示します。
-  
-  * ``rm``
-    ::
-    
-       rm [-f] [-i] [-v] [-r] files
-       rmdir [-f] [-i] [-v] [-r] dirs
-    
-    .. The rm function removes a set of files. No warnings are issued if the files do not exist, or if they cannot be removed.
-    
-    ``rm`` 関数はファイルの集合を消去します。ファイルが存在しなかった場合、もしくはファイルが消去できなかった場合、なんの警告も表示しません。
-    
-    オプション:
-    
-    * **-f**
-      
-      .. Forcibly remove files, do not prompt. 
-      
-      確認をしないで、強制的にファイルを消去します。
-    
-    * **-i**
-      
-      .. Prompt before removal. 
-      
-      ファイルを消去する前に確認します。
-    
-    * **-v**
-      
-      .. Explain what is happening. 
-      
-      実際になにが行われているのか表示します。
-    
-    * **-r**
-      
-      .. Remove contents of directories recursively. 
-      
-      再帰的にディレクトリの内容を消去します。
-  
-  * ``chmod``
-    ::
-    
-        chmod [-r] [-v] [-f] mode files
-    
-    .. The chmod function changes the permissions on a set of files or directories. This function does nothing on Win32. The mode may be specified as an octal number, or in symbolic form [ugoa]*[-=][rwxXstugo]+. See the man page for chmod for details.
-    
-    ``chmod`` 関数はファイルの集合やディレクトリのパーミッションを変更します。この関数はWin32上ではなにも行いません。 ``mode`` には8進数か、シンボリックフォーム ``[ugoa]*[-=][rwxXstugo]+`` を指定します。詳細は ``chmod`` のmanを参照してください。
-    
-    オプション:
-    
-    * **-r**
-      
-      .. Change permissions of all files in a directory recursively. 
-      
-      ディレクトリ内のすべてのファイルのパーミッションを再帰的に変更します。
-    
-    * **-v**
-      
-      .. Explain what is happening. 
-      
-      実際になにが行われているのか表示します。
-      
-    * **-f**
-      
-      .. Continue on errors. 
-      
-      エラーが生じても実行し続けます。
-  
-  * ``cat``
-    ::
-    
-       cat files...
-    
-    .. The cat function prints the contents of the files to stdout 
-    
-    ``cat`` 関数はファイルの内容をstdoutに出力します。
-  
-  * ``test``
-    ::
-    
-      test expression
-      [ expression +]+
-      [ --help
-      [ --version
-    
-    .. See the documentation for the test function.
-    
-    詳細は ":ref:`label10.7.1`" を参照してください。
-  
-  * ``find``
-    ::
-    
-      find expression
-    
-    .. See the documentation for the find function.
-    
-    詳細は ":ref:`label10.7.2`" を参照してください。
diff --git a/quickstart.rst b/quickstart.rst
deleted file mode 100644 (file)
index c46fb2d..0000000
+++ /dev/null
@@ -1,575 +0,0 @@
-.. 2-quickstart
-
-.. _label2:
-
-2. OMakeクイックスタートガイド
-==================================
-
-.. _label2.1:
-
-2.1 概要
-----------------------------------
-.. omake is designed for building projects that might have source files in several directories. Projects are normally specified using an OMakefile in each of the project directories, and an OMakeroot file in the root directory of the project. The OMakeroot file specifies general build rules, and the OMakefiles specify the build parameters specific to each of the subdirectories. When omake runs, it walks the configuration tree, evaluating rules from all of the OMakefiles. The project is then built from the entire collection of build rules.
-
-OMakeは複数のディレクトリにまたがって存在するソースファイルをビルドするために製作されたツールです。OMakeを使用したプロジェクトは通常、 ``OMakefile`` を各々のプロジェクトディレクトリに置き、 ``OMakeroot`` をプロジェクトのルートディレクトリに置きます。 ``OMakeroot`` には一般的なビルドルールを指定し、 ``OMakefiles`` にはそれぞれのサブディレクトリに固有のビルドパラメータを指定します。いったんOMakeを起動すると、OMakeはまず設定ファイルのあるディレクトリをスキャンし、すべての ``OMakefile`` を評価します。そしてプロジェクトは全体のビルドルールの集合としてビルドされます。
-
-.. index::
-   single: .SCANNER
-.. _label2.1.1:
-
-2.1.1 自動的な依存関係の解析
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-.. Dependency analysis has always been problematic with the make(1) program. omake addresses this by adding the .SCANNER target, which specifies a command to produce dependencies. For example, the following rule
-
-従来のmake(1)プログラムでは以前から依存関係の解析が問題となっていました。OMakeではこの問題を、依存関係を生成するコマンドを指定した ``.SCANNER`` ターゲットを追加することで解決しました。たとえば、以下のルール ::
-
-    .SCANNER: %.o: %.c
-        $(CC) $(INCLUDE) -MM $<
-
-.. is the standard way to generate dependencies for .c files. omake will automatically run the scanner when it needs to determine dependencies for a file.
-
-は ``.c`` ファイルの依存関係を生成する常套手段です。OMakeはソースファイルの依存関係を知る必要がある時点で、自動的にソースファイルをスキャンし、依存関係を特定します。
-
-.. index::
-   single: MD5
-   single: .omakedb
-.. _label2.1.2:
-
-2.1.2 ファイル内容から依存関係を解析
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-.. Dependency analysis in omake uses MD5 digests to determine whether files have changed. After each run, omake stores the dependency information in a file called .omakedb in the project root directory. When a rule is considered for execution, the command is not executed if the target, dependencies, and command sequence are unchanged since the last run of omake. As an optimization, omake does not recompute the digest for a file that has an unchanged modification time, size, and inode number.
-
-どのファイルの依存関係が変更されたかを知るために、OMakeではMD5による要約を用いてチェックを行います。各々のディレクトリでOMakeが実行された後に、 OMakeは依存関係の情報をプロジェクトルートディレクトリの ``.omakedb`` ファイルに保存します。いったんOMakeが依存関係のルールファイルを保存したのであれば、OMakeが最後に実行された時点で、ターゲット、依存関係、ソースコードに関して変更がない場合、ビルドは実行されません。また最適化としてOMakeはMD5の再計算を、修正日時、サイズ、ノード番号に変更のないファイルに関しては実行しません。
-
-.. index::
-   single: make
-   single: .PHONY
-   single: .SUBDIRS
-   single: .SUFFIXES
-.. _label2.2:
-
-2.2 既にmakeに慣れている人向けの注意事項
-------------------------------------------
-.. For users already familiar with the make(1) command, here is a list of differences to keep in mind when using omake.
-
-既にmakeコマンドに慣れているユーザがomakeを使う際には、以下のmakeとomakeの違いを列挙したリストについて留意しておきましょう。
-
-..  * In omake, you are much less likely to define build rules of your own. The system provides many standard functions (like StaticCLibrary and CProgram), described in Chapter 13, to specify these builds more simply.
-    * Implicit rules using .SUFFIXES and the .suf1.suf2: are not supported. You should use wildcard patterns instead %.suf2: %.suf1.
-    * Scoping is significant: you should define variables and .PHONY targets (see Section 8.10) before they are used.
-    * Subdirectories are incorporated into a project using the .SUBDIRS: target (see Section 8.8). 
-
-* omakeを用いると、あなたがビルドルールを自力で定義するよりもはるかに省力化できます。このシステムは多くのビルドイン関数を提供しています( ``StaticCLibrary`` や ``CProgram`` など)。第13章(:ref:`label13`)で説明した事項を用いると、これらのビルドはより簡単になります。
-* ``.SUFFIXES`` や ``.suf1.suf2:`` などを用いた暗黙のルール(implicit rule)はサポートされていません。その代わりにあなたはワイルドカード ``%.suf2: %.suf1`` を用いるべきです。
-* スコーピングは重要です。あなたは変数や ``.PHONY`` ターゲットを、使用する前に定義すべきです。(詳細は ":ref:`label8.10`" を参照してください。)
-* サブディレクトリをプロジェクトに組み入れる際には、 ``.SUBDIRS:`` ターゲットを用います。(詳細は ":ref:`label8.8`" を参照してください。)
-
-.. index::
-   single: CProgram()
-   single: OMakefile
-   single: OMakeroot
-   single: EXE
-   single: CC
-   single: CFLAGS
-   single: .DEFAULT
-.. _label2.3:
-
-2.3 小さなCプログラムのビルド
---------------------------------
-.. To start a new project, the easiest method is to change directories to the project root and use the command omake --install to install default OMakefiles.
-
-新しいプロジェクトを作る際にもっとも簡単な方法は、カレントディレクトリをプロジェクトのルートディレクトリに変え、 ``omake --install`` とコマンドを入力してデフォルトの ``OMakefile`` と ``OMakeroot`` をインストールすることです。 ::
-
-    $ cd ~/newproject
-    $ omake --install
-    *** omake: creating OMakeroot
-    *** omake: creating OMakefile
-    *** omake: project files OMakefile and OMakeroot have been installed
-    *** omake: you should edit these files before continuing
-
-.. The default OMakefile contains sections for building C and OCaml programs. For now, we'll build a simple C project.
-
-デフォルトの ``OMakefile`` はCとOCamlのプログラムをビルドするためのセクションを含んでいます。さて、それではOMakeを用いて簡単なCプロジェクトをビルドしてみましょう。
-
-.. Suppose we have a C file called hello_code.c containing the following code:
-
-私たちは ``hello_code.c`` というCファイルを持っており、そのコードは以下であったとします。 ::
-
-    #include <stdio.h>
-
-    int main(int argc, char **argv)
-    {
-        printf("Hello world\n");
-        return 0;
-    }
-
-.. To build the program a program hello from this file, we can use the CProgram function. The OMakefile contains just one line that specifies that the program hello is to be built from the source code in the hello_code.c file (note that file suffixes are not passed to these functions).
-
-このファイルから ``hello`` というプログラムをビルドする場合、 ``CProgram`` という関数を使うことができます。 ``OMakefile`` に ``hello_code.c`` のソースコードから ``hello`` プログラムをビルドすることを指定するため、以下の一行を加えます(ファイルの拡張子はこれらの関数に渡していないことに注意してください)。 ::
-
-    CProgram(hello, hello_code)
-
-.. Now we can run omake to build the project. Note that the first time we run omake, it both scans the hello_code.c file for dependencies, and compiles it using the cc compiler. The status line printed at the end indicates how many files were scanned, how many were built, and how many MD5 digests were computed.
-
-これで私たちはこのプロジェクトをビルドするために、OMakeを実行することができます。最初に私たちがOMakeを実行した時点で、OMakeは依存関係の解析に ``hello_code.c`` を解析し、 ``cc`` コンパイラを用いてコンパイルします。一番最後の行にはどれだけ多くのファイルが解析されて、どれだけ多くビルドされて、そしてどれだけ多くのMD5が計算されたのかが表示されます。 ::
-
-    $ omake hello
-    *** omake: reading OMakefiles
-    *** omake: finished reading OMakefiles (0.0 sec)
-    - scan . hello_code.o
-    + cc -I. -MM hello_code.c
-    - build . hello_code.o
-    + cc -I. -c -o hello_code.o hello_code.c
-    - build . hello
-    + cc -o hello hello_code.o
-    *** omake: done (0.5 sec, 1/6 scans, 2/6 rules, 5/22 digests)
-    $ omake
-    *** omake: reading OMakefiles
-    *** omake: finished reading OMakefiles (0.1 sec)
-    *** omake: done (0.1 sec, 0/4 scans, 0/4 rules, 0/9 digests)
-
-.. If we want to change the compile options, we can redefine the CC and CFLAGS variables before the CProgram line. In this example, we will use the gcc compiler with the -g option. In addition, we will specify a .DEFAULT target to be built by default. The EXE variable is defined to be .exe on Win32 systems; it is empty otherwise.
-
-私たちがコンパイルオプションを変更したいと思った場合、 ``CProgram`` と書いてある行の前に ``CC`` と ``CFLAGS`` 変数を再定義することで可能となります。たとえば、現在私たちは ``-g`` オプションで ``gcc`` コンパイラを用いたいとします。加えて、デフォルトでビルドするために ``.DEFAULT`` ターゲットを指定したい、さらにWin32システムで ``.exe`` と定義された ``EXE`` 変数を用いたいとします。これらの要望は以下のコードで実現できます。 ::
-
-    CC = gcc
-    CFLAGS += -g
-    CProgram(hello, hello_code)
-    .DEFAULT: hello$(EXE)
-
-.. Here is the corresponding run for omake.
-
-以下はomakeを実行させた場合の全体のコンソールです。 ::
-
-    $ omake
-    *** omake: reading OMakefiles
-    *** omake: finished reading OMakefiles (0.0 sec)
-    - scan . hello_code.o
-    + gcc -g -I. -MM hello_code.c
-    - build . hello_code.o
-    + gcc -g -I. -c -o hello_code.o hello_code.c
-    - build . hello
-    + gcc -g -o hello hello_code.o
-    *** omake: done (0.4 sec, 1/7 scans, 2/7 rules, 3/22 digests)
-
-.. We can, of course, include multiple files in the program. Suppose we write a new file hello_helper.c. We would include this in the project as follows.
-
-もちろん、プログラム中に複数のファイルをインクルードすることもできます。 ``hello_helper.c`` という新しいファイルを追加したとしましょう。以下のように ``OMakefile`` を変更することで対応できます。 ::
-
-    CC = gcc
-    CFLAGS += -g
-    CProgram(hello, hello_code hello_helper)
-    .DEFAULT: hello$(EXE)
-
-.. index::
-   single: StaticCLibrary()
-.. _label2.4:
-
-2.4  巨大なプロジェクト
--------------------------
-.. As the project grows it is likely that we will want to build libraries of code. Libraries can be built using the StaticCLibrary function. Here is an example of an OMakefile with two libraries.
-
-プロジェクトが成長するにつれて、コードからライブラリをビルドしたいと思うかもしれません。ライブラリは ``StaticCLibrary`` 関数を用いることでビルドすることができます。以下は二つのライブラリをビルドする際の ``OMakefile`` のサンプルです。 ::
-
-    CC = gcc
-    CFLAGS += -g
-
-    FOO_FILES = foo_a foo_b
-    BAR_FILES = bar_a bar_b bar_c
-
-    StaticCLibrary(libfoo, $(FOO_FILES))
-    StaticCLibrary(libbar, $(BAR_FILES))
-
-    # helloプログラムは両方のライブラリを用いてリンクされます
-    LIBS = libfoo libbar
-    CProgram(hello, hello_code hello_helper)
-
-    .DEFAULT: hello$(EXE)
-
-.. index::
-   single: INCLUDES
-   single: section
-   single: export
-   single: StaticCLibraryInstall()
-   single: if
-.. _label2.5:
-
-2.5  サブディレクトリ
---------------------------
-.. As the project grows even further, it is a good idea to split it into several directories. Suppose we place the libfoo and libbar into subdirectories.
-
-プロジェクトがさらに成長していく時点で、いくつかのディレクトリにコードファイルを分割することは良いアイデアです。現在私たちは ``libfoo`` と ``libbar`` をサブディレクトリに置いてあるものとしましょう。
-
-.. In each subdirectory, we define an OMakefile for that directory. For example, here is an example OMakefile for the foo subdirectory.
-
-まず、 ``OMakefile`` を各々のサブディレクトリ内に置きます。例えば、以下は ``foo/`` サブディレクトリ内の ``OMakefile`` のサンプルです。 ::
-
-    INCLUDES += .. ../bar
-
-    FOO_FILES = foo_a foo_b
-    StaticCLibrary(libfoo, $(FOO_FILES))
-
-.. Note the the INCLUDES variable is defined to include the other directories in the project.
-
-``INCLUDES`` 変数はプロジェクトの他のディレクトリをインクルードするために定義されています。
-
-.. Now, the next step is to link the subdirectories into the main project. The project OMakefile should be modified to include a .SUBDIRS: target.
-
-さて、次のステップはメインプロジェクトの中にサブディレクトリをリンクさせます。プロジェクトの ``OMakefile`` を ``.SUBDIRS`` プロジェクトを含めるように修正します。 ::
-
-    # プロジェクトの設定
-    CC = gcc
-    CFLAGS += -g
-
-    # サブディレクトリ
-    .SUBDIRS: foo bar
-
-    # ライブラリはサブディレクトリの中に存在します
-    LIBS = foo/libfoo bar/libbar
-
-    CProgram(hello, hello_code hello_helper)
-
-    .DEFAULT: hello$(EXE)
-
-.. Note that the variables CC and CFLAGS are defined before the .SUBDIRS target. These variables remain defined in the subdirectories, so that libfoo and libbar use gcc -g.
-
-変数 ``CC`` と ``CFLAGS`` は ``.SUBDIRS`` ターゲットの *前に* 定義されてあることに注目してください。これらの変数はサブディレクトリでも保持されていますので、 ``libfoo`` と ``libbar`` では ``gcc -g`` が使われます。
-
-.. If the two directories are to be configured differently, we have two choices. The OMakefile in each subdirectory can be modified with its configuration (this is how it would normally be done). Alternatively, we can also place the change in the root OMakefile.
-
-二つのディレクトリに異なる設定を用いる必要がある場合、二つの方法があります。一つ目は各々のサブディレクトリの ``OMakefile`` にそれぞれの設定を書く方法です(普通はこのようにして問題を解決します)。二つ目は、ルートの ``OMakefile`` を以下のコードに書き換える方法です。 ::
-
-    # 通常のプロジェクト設定
-    CC = gcc
-    CFLAGS += -g
-
-    # libfooは通常の設定を用います
-    .SUBDIRS: foo
-
-    # libbarは加えて最適化を行います
-    CFLAGS += -O3
-    .SUBDIRS: bar
-
-    # メインプログラム
-    LIBS = foo/libfoo bar/libbar
-    CProgram(hello, hello_code hello_helper)
-
-    .DEFAULT: hello$(EXE)
-
-.. Note that the way we have specified it, the CFLAGS variable also contains the -O3 option for the CProgram, and hello_code.c and hello_helper.c file will both be compiled with the -O3 option. If we want to make the change truly local to libbar, we can put the bar subdirectory in its own scope using the section form.
-
-``CFLAGS`` 変数にさらに ``-O3`` オプションを加えることで、 ``hello_code.c`` と ``hello_helper.c`` の両方は ``-O3`` オプションでコンパイルされます。
-``libbar`` のみにオプションを変更させたい場合、 ``section`` 文を使用することで ``bar/`` サブディレクトリ内のみに変更を適用することができます。 ::
-
-    # 通常のプロジェクト設定
-    CC = gcc
-    CFLAGS += -g
-
-    # libfooは通常の設定を用います
-    .SUBDIRS: foo
-
-    # libbarは加えて最適化を行います
-    section
-        CFLAGS += -O3
-        .SUBDIRS: bar
-
-    # メインプログラムでは最適化を使用しません
-    LIBS = foo/libfoo bar/libbar
-    CProgram(hello, hello_code hello_helper)
-
-    .DEFAULT: hello$(EXE)
-
-.. Later, suppose we decide to port this project to Win32, and we discover that we need different compiler flags and an additional library.
-
-後で、私たちがこのプロジェクトをWin32に移し、そして異なるコンパイラフラグや追加ライブラリが必要になることがわかったとしましょう。 ::
-
-    # 通常のプロジェクト設定
-    if $(equal $(OSTYPE), Win32)
-        CC = cl /nologo
-        CFLAGS += /DWIN32 /MT
-        export
-    else
-        CC = gcc
-        CFLAGS += -g
-        export
-
-    # libfooは通常の設定を用います
-    .SUBDIRS: foo
-
-    # libbarは加えて最適化を行います
-    section
-        CFLAGS += $(if $(equal $(OSTYPE), Win32), $(EMPTY), -O3)
-        .SUBDIRS: bar
-
-    # 通常のライブラリ
-    LIBS = foo/libfoo bar/libbar
-
-    # Win32上のみlibwin32を必要とします
-    if $(equal $(OSTYPE), Win32)
-       LIBS += win32/libwin32
-
-       .SUBDIRS: win32
-       export
-
-    # メインプログラムでは最適化を使用しません
-    CProgram(hello, hello_code hello_helper)
-
-    .DEFAULT: hello$(EXE)
-
-.. Note the use of the export directives to export the variable definitions from the if-statements. Variables in omake are scoped—variables in nested blocks (blocks with greater indentation), are not normally defined in outer blocks. The export directive specifies that the variable definitions in the nested blocks should be exported to their parent block.
-
-``export`` によって ``if`` 文の中にある変数が外部にエクスポートされます。 *OMakeでの変数はスコープ化* されており、ネストされたブロック内の変数は通常、外部のブロックから使用することはできません。 ``export`` はネストされたブロック内の変数を、親のブロックに移す命令です。
-
-.. note::
-  訳注: 今回の例では ``$(OSTYPE)`` 変数を用いて場合分けを行っていますが、 ``$(CC)`` 変数に関しては省略することができます。なぜなら、 ``Unix`` 上では ``$(CC)`` は ``gcc`` , ``Win32`` 上では ``cl /nologo`` が自動的に束縛されるからです。
-  
-  大抵の場合において、このような設定変数は異なるプラットフォーム上においても正常に動作するよう設計されています(詳細は ":ref:`label13.5.2`" を参照してください)。もちろん、その他になにか追加オプションを指定したい場合には、このような場合分けが有効となるでしょう。
-
-.. Finally, for this example, we decide to copy all libraries into a common lib directory. We first define a directory variable, and replace occurrences of the lib string with the variable.
-
-最後に、私たちはすべてのライブラリを共通の ``lib/`` ディレクトリにコピーしたいものとします。私たちはまずはじめにディレクトリの変数を定め、そして ``lib`` の文字列を変数で置き換えます。 ::
-
-    # 共用のlibディレクトリ
-    LIB = $(dir lib)
-
-    # phonyターゲットはライブラリのみビルドを行います
-    .PHONY: makelibs
-
-    # 通常のプロジェクト設定
-    if $(equal $(OSTYPE), Win32)
-        CC = cl /nologo
-        CFLAGS += /DWIN32 /MT
-        export
-    else
-        CC = gcc
-        CFLAGS += -g
-        export
-
-    # libfooは通常の設定を用います
-    .SUBDIRS: foo
-
-    # libbarは加えて最適化を行います
-    section
-        CFLAGS += $(if $(equal $(OSTYPE), Win32), $(EMPTY), -O3)
-        .SUBDIRS: bar
-
-    # 通常のライブラリ
-    LIBS = $(LIB)/libfoo $(LIB)/libbar
-
-    # Win32上のみlibwin32を必要とします
-    if $(equal $(OSTYPE), Win32)
-       LIBS += $(LIB)/libwin32
-
-       .SUBDIRS: win32
-       export
-
-    # メインプログラムでは最適化を使用しません
-    CProgram(hello, hello_code hello_helper)
-
-    .DEFAULT: hello$(EXE)
-
-.. In each subdirectory, we modify the OMakefiles in the library directories to install them into the $(LIB) directory. Here is the relevant change to foo/OMakefile.
-
-``$(LIB)`` ディレクトリの中にライブラリをインストールするため、ライブラリディレクトリ内の ``OMakefile`` を修正します。以下は新しく変更された ``foo/OMakefile`` です。 ::
-
-    INCLUDES += .. ../bar
-
-    FOO_FILES = foo_a foo_b
-    StaticCLibraryInstall(makelib, $(LIB), libfoo, $(FOO_FILES))
-
-.. Directory (and file names) evaluate to relative pathnames. Within the foo directory, the $(LIB) variable evaluates to ../lib.
-
-ディレクトリ(そしてファイル名)は現在のパス名で評価されます。 ``foo/`` ディレクトリ内では、 ``$(LIB)`` 変数は ``../lib`` として評価されます。
-
-.. As another example, instead of defining the INCLUDES variable separately in each subdirectory, we can define it in the toplevel as follows.
-
-各々のサブディレクトリ内で ``INCLUDES`` 変数を個別に定義する代わりに、以下のようにトップレベルで定義することもできます。 ::
-
-    INCLUDES = $(ROOT) $(dir foo bar win32)
-
-.. In the foo directory, the INCLUDES variable will evaluate to the string .. . ../bar ../win32. In the bar directory, it would be .. ../foo . ../win32. In the root directory it would be . foo bar win32.
-
-``foo/`` ディレクトリ内において ``INCLUDES`` 変数は文字列 ``.. . ../bar`` として評価されます。また ``bar/`` ディレクトリ内において、 ``INCLUDES`` 変数は文字列 ``.. ../foo . ../win32`` として評価されます。ルートディレクトリでは、 ``INCLUDES`` 変数は文字列 ``. foo bar win32`` として評価されます。
-
-.. note::
-  訳注: 今までの議論の中で「 *Win32プラットフォーム上でディレクトリのセパレータに/(スラッシュ)を指定していいのだろうか?\\(バックスラッシュ)を使わないといけないのでは?* 」と疑問に思った方も多いと思います。実は、この点に関しては心配いりません。omakeはたとえWin32上で ``/`` を使っていたとしても、実際の評価ではー非常に奇妙に思われるかもしれませんがー ``\`` が用いられるのです。同様に、セパレータに ``\`` を用いたとしてもUnixプラットフォーム上では ``/`` と変換されます。
-  
-  このように、ディレクトリのセパレータは ``/`` , ``\`` どちらを使っても、異なるプラットフォーム上で正常に動作します。ただし、 ``\`` はエスケープ文字として使用されることが多いため、思わぬ誤動作を引き起こすことがあるかもしれません。大抵の場合、ディレクトリのセパレータは ``/`` を使うことをおすすめします(詳細は ":ref:`label10.4`" を参照してください)。
-  
-.. _label2.6:
-
-2.6  その他の考慮事項
---------------------------
-.. omake also handles recursive subdirectories. For example, suppose the foo directory itself contains several subdirectories. The foo/OMakefile would then contain its own .SUBDIRS target, and each of its subdirectories would contain its own OMakefile.
-
-OMakeはまたリソースのあるサブディレクトリも扱うことができます。例えば、先ほどの ``foo/`` ディレクトリの中に、さらにいくつかのサブディレクトリを保持しているような場合を考えてみましょう。 ``foo/OMakefile`` は ``foo/`` ディレクトリ自身の ``.SUBDIRS`` ターゲットを保持しており、また各々のサブディレクトリもまたサブディレクトリ自身の ``OMakefile`` を保持しています。
-
-.. index::
-   single: OCaml
-.. _label2.7:
-
-2.7 OCamlプログラムのビルド
-----------------------------
-.. By default, omake is also configured with functions for building OCaml programs. The functions for OCaml program use the OCaml prefix. For example, suppose we reconstruct the previous example in OCaml, and we have a file called hello_code.ml that contains the following code.
-
-通常、OMakeはOCamlのプログラムをビルドするための関数群も持っています。OCamlプログラムのための関数群は接頭語として ``OCaml`` がつきます。例えば、前回のサンプルをOCamlで置き換えて、 ``hello_code.ml`` という以下のコードを含んだファイルを持っている場合を考えましょう。 ::
-
-   open Printf
-
-   let () = printf "Hello world\n"
-
-.. An example OMakefile for this simple project would contain the following.
-
-この簡単なプロジェクトのOMakefileのサンプルは以下になります。 ::
-
-    # バイトコードコンパイラを使用
-    BYTE_ENABLED = true
-    NATIVE_ENABLED = false
-    OCAMLCFLAGS += -g
-
-    # プログラムをビルド
-    OCamlProgram(hello, hello_code)
-    .DEFAULT: hello.run
-
-.. Next, suppose the we have two library subdirectories: the foo subdirectory is written in C, the bar directory is written in OCaml, and we need to use the standard OCaml Unix module.
-
-次に、二つのライブラリのサブディレクトリを持っている場合を考えましょう。 ``foo/`` ディレクトリはCで書かれており、 ``bar/`` ディレクトリはOCamlで書かれています。そして私たちは標準的なOCamlのUNIXモジュールを使用したいといった場合です。 ::
-
-    # 通常のプロジェクト設定
-    if $(equal $(OSTYPE), Win32)
-        CC = cl /nologo
-        CFLAGS += /DWIN32 /MT
-        export
-    else
-        CC = gcc
-        CFLAGS += -g
-        export
-
-    # バイトコードコンパイラを使用
-    BYTE_ENABLED = true
-    NATIVE_ENABLED = false
-    OCAMLCFLAGS += -g
-
-    # ライブラリのサブディレクトリ
-    INCLUDES += $(dir foo bar)
-    OCAMLINCLUDES += $(dir foo bar)
-    .SUBDIRS: foo bar
-
-    # Cライブラリ
-    LIBS = foo/libfoo
-
-    # OCamlライブラリ
-    OCAML_LIBS = bar/libbar
-
-    # Unixモジュールも用います
-    OCAML_OTHER_LIBS = unix
-
-    # メインプログラム
-    OCamlProgram(hello, hello_code hello_helper)
-
-    .DEFAULT: hello
-
-.. The foo/OMakefile would be configured as a C library.
-
-``foo/OMakefile`` はCライブラリとして設定します。 ::
-
-    FOO_FILES = foo_a foo_b
-    StaticCLibrary(libfoo, $(FOO_FILES))
-
-.. The bar/OMakefile would build an ML library.
-
-また、 ``bar/OMakefile`` はMLライブラリとして設定します。 ::
-
-   BAR_FILES = bar_a bar_b bar_c
-   OCamlLibrary(libbar, $(BAR_FILES))
-
-.. index::
-   single: OMakefile
-   single: OMakeroot
-.. _label2.8:
-
-2.8  OMakefileとOMakeroot
-------------------------------------
-.. OMake uses the OMakefile and OMakeroot files for configuring a project. The syntax of these files is the same, but their role is slightly different. For one thing, every project must have exactly one OMakeroot file in the project root directory. This file serves to identify the project root, and it contains code that sets up the project. In contrast, a multi-directory project will often have an OMakefile in each of the project subdirectories, specifying how to build the files in that subdirectory.
-
-プロジェクトを設定する際、OMakeは ``OMakefile`` と ``OMakeroot`` の2つのファイルを使用します。これらのファイルの構文は同じですが、役割は全く異なります。さらに付け加えると、すべてのプロジェクトは ``OMakeroot`` ファイルをプロジェクトのルートディレクトリに必ず置かなければなりません。このファイルはこのディレクトリがプロジェクトのルートディレクトリであることを決め、さらにプロジェクトをセットアップするためのコードを含んでいます。対照的に、複数のディレクトリが存在するプロジェクトは、どのようにサブディレクトリ内のファイルをビルドするのかを設定した ``OMakefile`` を、各々のプロジェクトのサブディレクトリに置くことになります。
-
-.. Normally, the OMakeroot file is boilerplate. The following listing is a typical example.
-
-通常、 ``OMakeroot`` ファイルはほとんど変更する必要のない決まり文句です。以下のリストは ``OMakeroot`` ファイルの一部です。 ::
-
-    include $(STDLIB)/build/Common
-    include $(STDLIB)/build/C
-    include $(STDLIB)/build/OCaml
-    include $(STDLIB)/build/LaTeX
-
-    # コマンドライン変数を再定義
-    DefineCommandVars(.)
-
-    # 現在のディレクトリをプロジェクトの一部として設定
-    .SUBDIRS: .
-
-.. The include lines include the standard configuration files needed for the project. The $(STDLIB) represents the omake library directory. The only required configuration file is Common. The others are optional; for example, the $(STDLIB)/build/OCaml file is needed only when the project contains programs written in OCaml.
-
-``include`` が書かれている行では、プロジェクトに必要な、標準的な設定ファイルをインクルードしています。 ``$(STDLIB)`` 変数はOMakeライブラリのディレクトリを表します。OCamlが動作するために必須となる設定ファイルは ``Common`` だけで、その他の設定ファイルはなくても構いません。 ``$(STDLIB)/build/OCaml`` ファイルはプロジェクトがOCamlで書かれたプログラムを含んでいる場合のみ必要となります。
-
-.. The DefineCommandVars function defines any variables specified on the command line (as arguments of the form VAR=<value>). The .SUBDIRS line specifies that the current directory is part of the project (so the OMakefile should be read).
-
-``DefineCommandVars`` 関数は( ``VAR=<value>`` のような形で)コマンドライン上から指定された、いくつかの変数を定義します。 ``.SUBDIRS`` が書かれている行では現在のディレクトリがプロジェクトの一部であることを指定しています(よって同ディレクトリの ``OMakefile`` が読み込まれます)。
-
-.. Normally, the OMakeroot file should be small and project-independent. Any project-specific configuration should be placed in the OMakefiles of the project.
-
-通常、 ``OMakeroot`` ファイルはサイズが小さく、かつプロジェクトから独立しています。プロジェクト固有の設定はすべてプロジェクト上の ``OMakefile`` に設定すべきです。
-
-.. index::
-   single: vmount()
-   single: 仮想的なマウント
-.. _label2.9:
-
-2.9 複数のバージョンのサポート
------------------------------------
-.. OMake version 0.9.6 introduced preliminary support for multiple, simultaneous versions of a project. Versioning uses the vmount(dir1, dir2) function, which defines a “virtual mount” of directory dir1 over directory dir2. A “virtual mount” is like a transparent mount in Unix, where the files from dir1 appear in the dir2 namespace, but new files are created in dir2. More precisely, the filename dir2/foo refers to: a) the file dir1/foo if it exists, or b) dir2/foo otherwise.
-
-OMake バージョン 0.9.6では、複数の同じバージョンのプロジェクトや、予備として用いる複数のプロジェクトに関するサポートを導入しました。 ``vmount(dir1, dir2)`` 関数を用いることで、 ``dir1/`` ディレクトリを ``dir2/`` ディレクトリに『仮想的にマウント』することができます。『仮想的なマウント』はUnixにて、 ``dir1/`` ディレクトリ内のファイルを ``dir2/`` ディレクトリにマウントするが、新しいファイルは ``dir2/`` ディレクトリに作られるようなものです。さらに具体的には、ファイル ``dir2/foo`` は、 ``dir1/foo`` が存在している場合は ``dir1/foo`` に置き換わりますが、存在していない場合は ``dir2/foo`` が用いられます。
-
-.. The vmount function makes it easy to specify multiple versions of a project. Suppose we have a project where the source files are in the directory src/, and we want to compile two versions, one with debugging support and one optimized. We create two directories, debug and opt, and mount the src directory over them.
-
-``vmount`` 関数によってプロジェクト内の複数のバージョンをビルドすることが容易になりました。 ``src/`` ディレクトリ内にいくつかのソースファイルが入っており、これをデバッグサポートがついているバージョンと、最適化されたバージョンの2つにコンパイルする場合を考えてみましょう。まず ``debug/`` と ``opt/`` の2つのディレクトリを作成して、 ``src/`` ディレクトリをこれらのディレクトリにマウントします。 ::
-
-    section
-        CFLAGS += -g
-        vmount(-l, src, debug)
-        .SUBDIRS: debug
-
-    section
-        CFLAGS += -O3
-        vmount(-l, src, opt)
-        .SUBDIRS: opt
-
-.. Here, we are using section blocks to define the scope of the vmount—you may not need them in your project.
-
-ここで、 ``vmount`` 関数を必要としていないプロジェクトに適用させないために、私たちは ``section`` ブロックを用いて ``vmount`` のスコープ範囲を定義しました。
-
-.. The -l option is optional. It specifies that files form the src directory should be linked into the target directories (or copied, if the system is Win32). The links are added as files are referenced. If no options are given, then files are not copied or linked, but filenames are translated to refer directly to the src/ files.
-
-``-l`` オプションはなくても構いません。それを指定することで ``src/`` ディレクトリのファイルは、ターゲットとなるディレクトリにリンクされます(システムがWin32の場合、ファイルはコピーされます)。ファイルが関連付けられるようにファイルへのリンクが追加されます。何もオプションが与えられていない場合、ファイル名は直接 ``src/`` ディレクトリのファイル名に変換されます。
-
-.. Now, when a file is referenced in the debug directory, it is linked from the src directory if it exists. For example, when the file debug/OMakefile is read, the src/OMakefile is linked into the debug/ directory.
-
-``debug/`` ディレクトリ内のファイルが参照された時点で、もし ``src/`` ディレクトリにそのファイルが存在するならば、 ``debug/`` ディレクトリのファイルは ``src/`` のファイルにリンクされます。例えば、 ``debug/OMakefile`` が参照された場合、 ``src/OMakefile`` が ``debug/OMakefile`` としてリンクされます。
-
-.. The vmount model is fairly transparent. The OMakefiles can be written as if referring to files in the src/ directory—they need not be aware of mounting. However, there are a few points to keep in mind.
-
-``vmount`` 関数の動作はだいぶ透過的です。あなたは ``OMakefile`` をまるで ``src/`` ディレクトリ内のファイルが関連付けられているかのように書くことができ、マウントについて気にする必要はありません。しかしながら、以下に示すいくつかの注意点を頭に入れておきましょう。
-
-.. _label2.10:
-
-2.10  注意点
---------------------
-.. When using the vmount function for versioning, it wise to keep the source files distinct from the compiled versions. For example, suppose the source directory contained a file src/foo.o. When mounted, the foo.o file will be the same in all versions, which is probably not what you want. It is better to keep the src/ directory pristine, containing no compiled code.
-
-バージョン管理の目的で ``vmount`` 関数を用いた場合、コンパイルされたファイルをソースファイルから分離することをお勧めします。例えば、ソースディレクトリに ``src/foo.o`` ファイルが含まれている場合を考えましょう。もし ``src/foo.o`` がマウントされてしまったとすると、 ``foo.o`` ファイルはすべてのバージョンにおいて共通のファイルになってしまい、おそらくあなたが求めていた動作とは違うものになるでしょう。 ``src/`` ディレクトリにはソースコード以外何もない状態にして、コンパイルされたコードは含めないようにしましょう。
-
-.. When using the vmount -l option, files are linked into the version directory only if they are referenced in the project. Functions that examine the filesystem (like $(ls ...)) may produce unexpected results. 
-
-``vmount -l`` オプションを使用したときは、ソースファイルがプロジェクトから参照された場合のみ、バージョンディレクトリ内にリンクされます。ファイルシステムを用いる関数( ``$(ls ...)`` など)はあなたが期待していない動作を引き起こすことになります。
diff --git a/rules.rst b/rules.rst
deleted file mode 100644 (file)
index 6e9cf3e..0000000
--- a/rules.rst
+++ /dev/null
@@ -1,777 +0,0 @@
-.. 8-rules
-
-.. index::
-   single: $*
-   single: $@
-   single: $^
-   single: $+
-   single: $<
-.. _label8:
-
-8. ビルドルール
-==================================
-.. Rules are used by OMake to specify how to build files. At its simplest, a rule has the following form.
-
-OMakeで使われているルールは、どのようにしてファイルをビルドするのかについて指定しています。最も簡単な例は以下のような形です。 ::
-
-    <target>: <dependencies>
-        <commands>
-
-.. The <target> is the name of a file to be built. The <dependencies> are a list of files that are needed before the <target> can be built. The <commands> are a list of indented lines specifying commands to build the target. For example, the following rule specifies how to compile a file hello.c.
-
-``<target>`` ではビルドするファイル名を記述します。 ``<dependencies>`` では ``<target>`` をビルドする前に必要なファイルのリストを記述します。 ``<commands>`` はターゲットをビルドするためのコマンドを、インデントした状態で記述します。例えば、以下のルールではどのようにファイル ``hello.c`` をコンパイルするのかについて指定しています。 ::
-
-    hello.o: hello.c
-        $(CC) $(CFLAGS) -c -o hello.o hello.c
-
-.. This rule states that the hello.o file depends on the hello.c file. If the hello.c file has changed, the command $(CC) $(CFLAGS) -c -o hello.o hello.c is to be executed to update the target file hello.o.
-
-このルールでは、 ``hello.o`` ファイルは ``hello.c`` ファイルに依存しています。 ``hello.c`` ファイルが変更された場合、コマンド ``$(CC) $(CFLAGS) -c -o hello.o hello.c`` が実行されて、ターゲットファイル ``hello.o`` は更新されます。
-
-.. A rule can have an arbitrary number of commands. The individual command lines are executed independently by the command shell. The commands do not have to begin with a tab, but they must be indented from the dependency line.
-
-ルールの中には任意の数のコマンドを含めることができます。各々の独立したコマンドラインはコマンドシェルによって、独立した状態で実行されます。コマンドの最初にタブを含めることはできません。しかし、依存関係を指定している行からはインデントされなければなりません。
-
-.. In addition to normal variables, the following special variables may be used in the body of a rule.
-      * $*: the target name, without a suffix.
-      * $@: the target name.
-      * $^: a list of the sources, in alphabetical order, with duplicates removed.
-      * $+: all the sources, in the original order.
-      * $<: the first source. 
-
-通常の変数に加えて、以下の特殊変数をルールの内容で使うことができます。
-
-* ``$*`` : 拡張子を除いたターゲットの名前
-* ``$@`` : ターゲットの名前
-* ``$^`` : 依存ファイルのリストをアルファベット順に並べ、かつ重複した内容を削除したもの
-* ``$+`` : 元の順番で並んでいる依存ファイルのリスト
-* ``$<`` : 最初の依存ファイル
-
-.. For example, the above hello.c rule may be simplified as follows.
-
-例えば、上の ``hello.c`` ルールは以下のように簡略化されます。 ::
-
-    hello.o: hello.c
-        $(CC) $(CFLAGS) -c -o $@ $<
-
-.. Unlike normal values, the variables in a rule body are expanded lazily, and binding is dynamic. The following function definition illustrates some of the issues.
-
-通常の値とは異なり、ルール中の変数は遅延評価されて、かつ動的なスコーピングが行われます。以下の関数定義はこの性質のいくつかを端的に表しています。 ::
-
-    CLibrary(name, files) =
-        OFILES = $(addsuffix .o, $(files))
-
-        $(name).a: $(OFILES)
-            $(AR) cq $@ $(OFILES)
-
-.. This function defines a rule to build a program called $(name) from a list of .o files. The files in the argument are specified without a suffix, so the first line of the function definition defines a variable OFILES that adds the .o suffix to each of the file names. The next step defines a rule to build a target library $(name).a from the $(OFILES) files. The expression $(AR) is evaluated when the function is called, and the value of the variable AR is taken from the caller's scope (see also the section on Scoping).
-
-この関数は ``.o`` ファイルのリストから ``$(name)`` という名前のプログラムをビルドしています。引数のファイルは拡張子なしで指定されているので、まず最初の定義では各々のファイル名に拡張子 ``.o`` を加えた配列を、変数 ``OFILES`` に束縛しています。次のステップでは ``$(OFILES)`` からターゲットライブラリ ``$(name).a`` をビルドするためのルールを定義しています。 ``$(AR)`` は関数が呼び出されて、呼び出してるスコープから変数 ``AR`` が与えられた時点で評価されます(詳細はスコーピングのセクションを参照してください)。
-
-.. index::
-   single: ワイルドカード
-.. _label8.1:
-
-8.1 暗黙のルール
-----------------------------------
-.. Rules may also be implicit. That is, the files may be specified by wildcard patterns. The wildcard character is %. For example, the following rule specifies a default rule for building .o files.
-
-ルールはまた暗黙的にすることもできます。これは、ファイルがワイルドカードパターンによって指定されることを示しています。ワイルドカードとしてOMakeでは ``%`` を使用します。例えば、以下のルールでは ``.o`` ファイルをビルドするための通常のルールを指定しています。 ::
-
-    %.o: %.c
-        $(CC) $(CFLAGS) -c -o $@ $*.c
-
-.. This rule is a template for building an arbitrary .o file from a .c file.
-
-このルールは任意の ``.c`` ファイルから ``.o`` ファイルをビルドするためのテンプレートとなっています。
-
-.. By default, implicit rules are only used for the targets in the current directory. However subdirectories included via the .SUBDIRS rules inherit all the implicit rules that are in scope (see also the section on Scoping).
-
-通常、暗黙のルールはカレントディレクトリ中のターゲットのみに用いられます。しかしながら、 ``.SUBDIRS`` ルールを経由したものも含むサブディレクトリには、スコープ中にある暗黙のルールがすべて継承されます(詳細はスコーピングのセクションを参照してください)。
-
-.. _label8.2:
-
-8.2 束縛された暗黙のルール
-----------------------------------
-.. Implicit rules may specify the set of files they apply to. The following syntax is used.
-
-暗黙のルールのターゲットにはいくつかのファイルを指定することもできます。そのためには以下のような構文を用います。 ::
-
-    <targets>: <pattern>: <dependencies>
-        <commands>
-
-.. For example, the following rule applies only to the files a.o and b.o.
-
-例えば、以下のルールではファイル ``a.o`` と ``b.o`` のみにルールを適用しています。 ::
-
-   a.o b.o: %.o: %.c
-        $(CC) $(CFLAGS) -DSPECIAL -c $*.c
-
-.. index::
-   single: section
-.. _label8.3:
-
-8.3 section
-----------------------------------
-.. Frequently, the commands in a rule body are expressions to be evaluated by the shell. omake also allows expressions to be evaluated by omake itself.
-
-ルールの内容に書かれているコマンドはシェルによって頻繁に評価されます。omakeはまた、omake自身も評価の対象に加えることもできます。
-
-.. The syntax of these “computed rules” uses the section expression. The following rule uses the omake IO functions to produce the target hello.c.
-
-これらの『ファイルを作るためのルール』を表現するためには ``section`` 表現を使います。以下のルールではターゲットの ``hello.c`` を生成するためにomakeのIO関数を用いています。 ::
-
-    hello.c:
-        section
-            FP = fopen(hello.c, w)
-            fprintln($(FP), $""#include <stdio.h> int main() { printf("Hello world\n"); }"")
-            close($(FP))
-
-.. This example uses the quotation $""..."" (see also Section B.1.6) to quote the text being printed. These quotes are not included in the output file. The fopen, fprintln, and close functions perform file IO as discussed in the IO section.
-
-この例では出力するテキストをクオートするために、クオーテーション ``$""...""`` を用いています(詳細はB.1.6のセクションを参照してください)。これらのクオートは出力されたファイルには含まれていません。 ``fopen`` , ``fprintln`` , ``close`` 関数はIOセクションで評価するようにファイルのIOを実行します。
-
-.. In addition, commands that are function calls, or special expressions, are interpreted correctly. Since the fprintln function can take a file directly, the above rule can be abbreviated as follows.
-
-加えて、関数の呼び出しや他の特殊なコマンドはその場で正しく評価されます。また、 ``fprintln`` 関数はファイルを直接出力することもできるので、上のルールは下のような形に省略できます。 ::
-
-    hello.c:
-       fprintln($@, $""#include <stdio.h> int main() { printf("Hello world\n"); }"")
-
-.. index::
-   single: section rule
-.. _label8.4:
-
-8.4 section rule
-----------------------------------
-.. Rules can also be computed using the section rule form, where a rule body is expected instead of an expression. In the following rule, the file a.c is copied onto the hello.c file if it exists, otherwise hello.c is created from the file default.c.
-
-また、ターゲットの依存関係がルールの内容で記述されるような場合、 ``section rule`` を使うことで計算することができます。以下のルールでは、ファイル ``a.c`` が存在していた場合は内容を ``hello.c`` にコピーし、そうでなければ ``hello.c`` は ``default.c`` から生成されます。 ::
-
-    hello.c:
-        section rule
-           if $(target-exists a.c)
-              hello.c: a.c
-                 cat a.c > hello.c
-           else
-              hello.c: default.c
-                 cp default.c hello.c
-
-.. _label8.5:
-
-8.5 特別な依存関係
-----------------------------------
-
-.. index::
-   single: :exists:
-.. _label8.5.1:
-
-8.5.1 :exists:
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-.. In some cases, the contents of a dependency do not matter, only whether the file exists or not. In this case, the :exists: qualifier can be used for the dependency.
-
-時々、依存しているファイルの内容ではなく、ファイルが存在しているのかどうかが重要となる場合もあるでしょう。 ``:exists:`` 修飾子はこのような依存関係を指定したい場合に用いられます。 ::
-
-    foo.c: a.c :exists: .flag
-       if $(test -e .flag)
-           $(CP) a.c $@
-
-.. index::
-   single: :effects:
-.. _label8.5.2:
-
-8.5.2 :effects:
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-.. Some commands produce files by side-effect. For example, the latex(1) command produces a .aux file as a side-effect of producing a .dvi file. In this case, the :effects: qualifier can be used to list the side-effect explicitly. omake is careful to avoid simultaneously running programs that have overlapping side-effects.
-
-コマンドの中には副産物として別のファイルを生み出すものもあるでしょう。例えば、 ``latex(1)`` コマンドは ``.dvi`` ファイルを生成する際、副産物として ``.aux`` ファイルを生成します。このような場合、 ``:effects:`` 修飾子はこのような副産物のファイルを明示的に指定したい場合に用いられます。omakeはこのファイルを上書きしないように、平行してプログラムを実行させないようにします。 ::
-
-    paper.dvi: paper.tex :effects: paper.aux
-        latex paper
-
-.. index::
-   single: :value:
-.. _label8.5.3:
-
-8.5.3 :value:
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-.. The :value: dependency is used to specify that the rule execution depends on the value of an expression. For example, the following rule
-
-``:value:`` 依存関係は、ルールの実行がある式の値に依存していることを指定するために用いられます。例えば、以下のルールを見てください。 ::
-
-    a: b c :value: $(X)
-        ...
-
-.. specifies that “a” should be recompiled if the value of $(X) changes (X does not have to be a filename). This is intended to allow greater control over dependencies.
-
-上のルールでは、"a"が ``$(X)`` の値が変わった場合に再コンパイルされる必要があることを指定しています(Xがファイル名である必要はありません)。これはファイルや変数の依存関係をより精密にコントロールすることを意図しています。
-
-.. In addition, it can be used instead of other kinds of dependencies. For example, the following rule:
-
-加えて、これは他の依存関係の代わりに用いることができます。例えば、以下のルールは、その次のルールと等価です。 ::
-
-    a: b :exists: c
-        commands
-
-::
-
-    a: b :value: $(target-exists c)
-        commands
-
-.. Notes:
-      * The values are arbitrary (they are not limited to variables)
-      * The values are evaluated at rule expansion time, so expressions containing variables like $@, $^, etc are legal. 
-
-.. note::
-  * 任意の値をとることができます(指定する変数に制限はありません)。
-  * 値はルールが展開されるときに評価されます。なので式には ``$@`` や ``#^`` のような変数も含めることができます。
-
-.. index::
-   single: .SCANNER
-   single: digest()
-   single: digest-in-path-optional()
-.. _label8.6:
-
-8.6 .SCANNER ルール
-----------------------------------
-.. Scanner rules define a way to specify automatic dependency scanning. A .SCANNER rule has the following form.
-
-スキャナルールでは、自動的に依存関係の解析を行う方法について定義します。 ``.SCANNER`` ルールは以下のような形となります。 ::
-
-    .SCANNER: target: dependencies
-        commands
-
-.. The rule is used to compute additional dependencies that might be defined in the source files for the specified target. The result of executing the scanner commands must be a sequence of dependencies in OMake format, printed to the standard output. For example, on GNU systems the gcc -MM foo.c produces dependencies for the file foo.c (based on #include information).
-
-ルールは、指定されたターゲットのソースファイルに定義されている、追加の依存関係を計算するのに用いられます。 ``.SCANNER`` コマンドの実行結果は、OMakeのフォーマットで依存関係のシーケンスが標準の出力先に出力される必要があります。例えばGNUシステムでは、 ``gcc -MM foo.c`` はファイル ``foo.c`` の依存関係を生成するコマンドです(これは ``#include`` の情報を元にしています)。
-
-.. We can use this to specify a scanner for C files that adds the scanned dependencies for the .o file. The following scanner specifies that dependencies for a file, say foo.o can be computed by running gcc -MM foo.c. Furthermore, foo.c is a dependency, so the scanner should be recomputed whenever the foo.c file changes.
-
-私たちはこれを用いて、 ``.c`` ファイルから ``.o`` ファイルを生成するため、スキャンされた依存関係を既存の依存関係に追加することができます。以下のスキャナではファイルの依存関係を指定しており、仮に ``foo.o`` が指定されたとすると、 ``gcc -MM foo.c`` を実行することによって依存関係の解析が行われます。さらには、 ``foo.c`` は依存されているので、 ``foo.c`` が変更された場合はいつでもスキャナは再計算されます。 ::
-
-    .SCANNER: %.o: %.c
-        gcc -MM $<
-
-.. Let's suppose that the command gcc -MM foo.c prints the following line.
-
-コマンド ``gcc -MM foo.c`` は以下の行を出力するものとします。 ::
-
-    foo.o: foo.h /usr/include/stdio.h
-
-.. The result is that the files foo.h and /usr/include/stdio.h are considered to be dependencies of foo.o—that is, foo.o should be rebuilt if either of these files changes.
-
-以上から、ファイル ``foo.h`` と ``/usr/include/stdio.h`` は ``foo.o`` に依存しているものと考えられます。これは、もしこれらのファイルのどれか一つが変更された場合、 ``foo.o`` はリビルドされるべきであることを示しています。
-
-.. This works, to an extent. One nice feature is that the scanner will be re-run whenever the foo.c file changes. However, one problem is that dependencies in C are recursive. That is, if the file foo.h is modified, it might include other files, establishing further dependencies. What we need is to re-run the scanner if foo.h changes too.
-
-これはある程度ですがうまく動きます。この機能の利点の一つとしては、 ``foo.c`` が変更された場合、いつでもスキャナが再解析を行ってくれるというのが挙げられます。しかしながらこれには問題があります。Cの依存関係は *再帰的* なのです。すなわち、もしファイル ``foo.h`` が修正されたとしたら、そのファイルは他のファイルを含んでいることで、さらなる依存関係が生じているのかもしれません。必要なのは ``foo.h`` の変更に応じて、再びスキャナを実行することです。
-
-.. We can do this with a value dependency. The variable $& is defined as the dependency results from any previous scan. We can add these as dependencies using the digest function, which computes an MD5 digest of the files.
-
-私たちはこの問題を『依存関係を示す値(value dependency)』を用いて解決しました。変数 ``$&`` は任意の前回のスキャンから、依存関係の結果を返す変数として定義されています。私たちはこれらの依存関係を、ファイルのMD5による要約を計算して返す ``digest`` 関数を用いて追加しました。 ::
-
-    .SCANNER: %.o: %.c :value: $(digest $&)
-        gcc -MM $<
-
-.. Now, when the file foo.h changes, its digest will also change, and the scanner will be re-run because of the value dependency (since $& will include foo.h).
-
-これで、ファイル ``foo.h`` が変更されたときには要約も変更されているのでスキャナは再計算されます。これは依存関係を示す値( ``$&`` には ``foo.h`` がインクルードされています)によるものです。
-
-.. This still is not quite right. The problem is that the C compiler uses a search-path for include files. There may be several versions of the file foo.h, and the one that is chosen depends on the include path. What we need is to base the dependencies on the search path.
-
-ですが、これはまだ完全に正しいというわけではありません。Cコンパイラはインクルードファイルのために *検索パス(search-path)* を使用しているのです。ファイル ``foo.h`` には何通りものバージョンが存在しており、そのうちの選んでいる一つがインクルードパスに依存しているのかもしれません。必要なのは検索パスの依存関係も含めることです。
-
-.. The $(digest-in-path-optional ...) function computes the digest based on a search path, giving us a solution that works.
-
-``$(digest-in-path-optional ...)`` 関数は検索パスを元にした要約を計算し、この問題に解決案を提示します。 ::
-
-    .SCANNER: %.o: %.c :value: $(digest-in-path-optional $(INCLUDES), $&)
-       gcc -MM $(addprefix -I, $(INCLUDES)) $<
-
-.. The standard output of the scanner rules will be captured by OMake and is not allowed to contain any content that OMake will not be able to parse as a dependency. The output is allowed to contain dependency specifications for unrelated targets, however such dependencies will be ignored. The scanner rules are allowed to produce arbitrary output on the standard error channel — such output will be handled in the same way as the output of the ordinary rules (in other words, it will be presented to the user, when dictated by the --output-… options enabled).
-
-スキャナルールの標準出力はOMakeによって捉えられるので、OMakeが依存関係を解析できない内容を含むことは許されません。まだ関連付けられていない依存関係について出力することは許されますが、このような依存関係は無視されます。スキャナルールでは標準エラーの出力先に任意の内容を出力することが許されています。このような出力は通常のルールの出力と同様に扱われます。(言い換えれば、これは --output-… オプションを有効にすることで、ユーザーに見せることのできる出力です。)
-
-.. Additional examples of the .SCANNER rules can be found in Section 3.4.3.
-
-``.SCANNER`` ルールについての追加例は ":ref:`label3.4.3`" で見つけることができます。
-
-.. index::
-   single: :scanner:
-.. _label8.6.1:
-
-8.6.1 スキャナの命名と :scanner: 依存関係
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-.. Sometimes it may be useful to specify explicitly which scanner should be used in a rule. For example, we might compile .c files with different options, or (heaven help us) we may be using both gcc and the Microsoft Visual C++ compiler cl. In general, the target of a .SCANNER is not tied to a particular target, and we may name it as we like.
-
-スキャナがルール中で使われていることを明示的に指定するほうが有用である場合があります。例えば、私たちは ``.c`` ファイルを異なったオプションでコンパイルしたり、あるいは(天よ我らを助けて!) ``gcc`` と Microsoft Visual C++ コンパイラ ``cl`` の両方を使いたいとしましょう。通常、 ``.SCANNER`` のターゲットは特定のターゲットに結びついていないのですが、私たちはこれを好きなように命名することができます。 ::
-
-    .SCANNER: scan-gcc-%.c: %.c :value: $(digest-in-path-optional $(INCLUDES), $&)
-        gcc -MM $(addprefix -I, $(INCLUDES)) $<
-
-    .SCANNER: scan-cl-%.c: %.c :value: $(digest-in-path-optional $(INCLUDES), $&)
-        cl --scan-dependencies-or-something $(addprefix /I, $(INCLUDES)) $<
-
-.. The next step is to define explicit scanner dependencies. The :scanner: dependency is used for this. In this case, the scanner dependencies are specified explicitly.
-
-次のステップはスキャナの依存関係を明示的に定義することです。 ``:scanner:`` 依存関係はこのために用いられます。この場合、スキャナの依存関係は明示的に指定されます。 ::
-
-    $(GCC_FILES): %.o: %.c :scanner: scan-gcc-%c
-        gcc ...
-
-    $(CL_FILES): %.obj: %.c :scanner: scan-cl-%c
-        cl ...
-
-.. Explicit :scanner: scanner specification may also be used to state that a single .SCANNER rule should be used to generate dependencies for more than one target. For example,
-
-明示的な ``:scanner:`` スキャナの指定は、単体の ``.SCANNER`` ルールを複数のターゲットに向けて依存関係を生成することにも用いられます。例えば以下の例を見てみましょう。 ::
-
-    .SCANNER: scan-all-c: $(GCC_FILES) :value: $(digest-in-path-optional $(INCLUDES), $&)
-        gcc -MM $(addprefix -I, $(INCLUDES)) $(GCC_FILES)
-
-    $(GCC_FILES): %.o: %.c :scanner: scan-all-c
-        ...
-
-.. The above has the advantage of only running gcc once and a disadvantage that when a single source file changes, all the files will end up being re-scanned.
-
-上の例はgccが一回だけ呼び出されるという利点と、一つのソースファイルが変更された場合、すべてのファイルが再スキャンされてしまうという欠点の両方を持ち合わせています。
-
-.. index::
-   single: SCANNER_MODE
-.. _label8.6.2:
-
-8.6.2 ノート
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-.. In most cases, you won't need to define scanners of your own. The standard installation includes default scanners (both explicitly and implicitly named ones) for C, OCaml, and LATEX files.
-
-多くの場合において、あなたは自分の手でスキャナを定義する必要はありません。OMakeにはC, OCaml, LaTeXファイルのためのスキャナ(しかも暗黙的、明示的に命名されたスキャナの両方)が標準で用意されています。
-
-.. The SCANNER_MODE variable controls the usage of implicit scanner dependencies.
-
-``SCANNER_MODE`` 変数は、暗黙のスキャナの依存関係の使用についてコントロールする変数です。
-
-.. The explicit :scanner: dependencies reduce the chances of scanner mis-specifications. In large complicated projects it might be a good idea to set SCANNER_MODE to error and use only the named .SCANNER rules and explicit :scanner: specifications.
-
-明示的に ``:scanner:`` 依存関係を指定することは、スキャナが間違って指定してしまう危険を減らします。巨大で複雑なプロジェクトでは ``SCANNER_MODE`` を ``error`` に設定することで、名前がある ``.SCANNER`` ルールと明示的な ``:scanner:`` 指定を使うようにしましょう。
-
-.. index::
-   single: .DEFAULT
-.. _label8.7:
-
-8.7 .DEFAULT
-----------------------------------
-.. The .DEFAULT target specifies a target to be built by default if omake is run without explicit targets. The following rule instructs omake to build the program hello by default
-
-``.DEFAULT`` ターゲットは、omakeが明示的にターゲットを指定していないようなデフォルトの状態でビルドされるターゲットを指定するために用いられます。以下のルールでは ``hello`` プログラムがデフォルトの状態でビルドすることを指定しています。 ::
-
-   .DEFAULT: hello
-
-.. index::
-   single: .SUBDIRS
-.. _label8.8:
-
-8.8 .SUBDIRS
-----------------------------------
-.. The .SUBDIRS target is used to specify a set of subdirectories that are part of the project. Each subdirectory should have its own OMakefile, which is evaluated in the context of the current environment.
-
-``.SUBDIRS`` ターゲットはプロジェクトの一部であるサブディレクトリの集合を指定するために用いられます。各々のサブディレクトリには、サブディレクトリの内容をその環境下で評価するための ``OMakefile`` をそれぞれ有しているべきです。 ::
-
-   .SUBDIRS: src doc tests
-
-.. This rule specifies that the OMakefiles in each of the src, doc, and tests directories should be read.
-
-このルールでは ``src`` , ``doc`` , ``test`` ディレクトリの中のOMakefileをそれぞれ読み込むことを指定しています。
-
-.. In some cases, especially when the OMakefiles are very similar in a large number of subdirectories, it is inconvenient to have a separate OMakefile for each directory. If the .SUBDIRS rule has a body, the body is used instead of the OMakefile.
-
-いくつかの場合─特に ``OMakefile`` の内容が似ている大量のサブディレクトリを持っているような場合─各々のディレクトリに分割して ``OMakefile`` を持たせるのは不便でしょう。もし ``.SUBDIRS`` ルールの中に内容を記述したとすると、その内容が ``OMakefile`` の代わりとして使われます。 ::
-
-   .SUBDIRS: src1 src2 src3
-      println(Subdirectory $(CWD))
-      .DEFAULT: lib.a
-
-.. In this case, the src1, src2, and src3 files do not need OMakefiles. Furthermore, if one exists, it is ignored. The following includes the file if it exists.
-
-この場合、サブディレクトリ ``src1`` , ``src2`` , ``src3`` には ``OMakefile`` が必要ありません。さらには、たとえ ``OMakefile`` が存在していた場合でも、OMakeはそれを無視します。以下の例では ``OMakefile`` が含まれていた場合、そのファイルをインクルードするよう指定しています。 ::
-
-   .SUBDIRS: src1 src2 src3
-       if $(file-exists OMakefile)
-          include OMakefile
-       .DEFAULT: lib.a
-
-.. index::
-   single: .INCLUDE
-.. _label8.9:
-
-8.9 .INCLUDE
-----------------------------------
-.. The .INCLUDE target is like the include directive, but it specifies a rule to build the file if it does not exist.
-
-``.INCLUDE`` ターゲットは ``include`` 文と似ていますが、 ``.INCLUDE`` ではたとえ指定されたファイルが存在していなくても、ビルドするためのルールを指定できます。 ::
-
-   .INCLUDE: config
-       echo "CONFIG_READ = true" > config
-
-    echo CONFIG_READ is $(CONFIG_READ)
-
-.. You may also specify dependencies to an .INCLUDE rule.
-
-あなたはまた ``.INCLUDE`` ルールの依存関係を指定できます。 ::
-
-   .INCLUDE: config: config.defaults
-      cp config.defaults config
-
-.. A word of caution is in order here. The usual policy is used for determining when the rule is out-of-date. The rule is executed if any of the following hold.
-      * the target does not exist,
-      * the rule has never been executed before,
-      * any of the following have changed since the last time the rule was executed,
-            o the target,
-            o the dependencies,
-            o the commands-text. 
-
-順番どおりにターゲットと依存関係が記述されています。通常の場合ですと、この記法はルールがいつ期限切れになったのかどうかを決定するために用いられます。 ``.INCLUDE`` 内のルールは、以下の場合のどれかに当てはまったときに実行されます。
-
-* ターゲットが存在しない場合
-* 以前からずっとこのルールが実行されていなかった場合
-* ルールが実行された最後の時間から現在までの間に、以下のうちどれかが変更されていた場合
-
-  * ターゲット
-  * 依存先
-  * コマンド文
-
-.. In some of the cases, this will mean that the rule is executed even if the target file already exists. If the target is a file that you expect to edit by hand (and therefore you don't want to overwrite it), you should make the rule evaluation conditional on whether the target already exists.
-
-これは、たとえ既にターゲットファイルが存在していたとしても、ルールが実行される場合もあることを示しています。もしターゲットが、エディターなどで変更するような(それゆえ上書きされたくない)ファイルを指定する場合、あなたはルールの評価を、ターゲットが既に存在しているかどうかで条件分岐させるべきです。 ::
-
-   .INCLUDE: config: config.defaults
-       # わたしが注意深く手作業で変更したファイルを上書きさせません!
-       if $(not $(file-exists config))
-          cp config.defaults config
-
-.. index::
-   single: .PHONY
-.. _label8.10:
-
-8.10 .PHONY
-----------------------------------
-.. A “phony” target is a target that is not a real file, but exists to collect a set of dependencies. Phony targets are specified with the .PHONY rule. In the following example, the install target does not correspond to a file, but it corresponds to some commands that should be run whenever the install target is built (for example, by running omake install).
-
-"phony" ターゲットは実際には存在しませんが、複数の依存関係を持っているようなターゲットです。Phony ターゲットは ``.PHONY`` ルールを用いて指定します。以下の例では、 ``install`` ターゲットは実際のファイルではありませんが、( ``omake install`` が実行されることによって) ``install`` ターゲットが生起された場合はいつでも、いくつかのコマンドが実行されます。 ::
-
-   .PHONY: install
-
-   install: myprogram.exe
-      cp myprogram.exe /usr/bin
-
-.. _label8.11:
-
-8.11 スコープ規則
-----------------------------------
-.. As we have mentioned before, omake is a scoped language. This provides great flexibility—different parts of the project can define different configurations without interfering with one another (for example, one part of the project might be compiled with CFLAGS=-O3 and another with CFLAGS=-g).
-
-以前私たちが注意したように、omakeは *スコープ化された* 言語です。これは非常に融通のきく─プロジェクトの異なるパートは別のパートを気にすることなく、異なった設定を定義することができる─ものとなっています。例えば、プロジェクトのあるパートには ``CFLAGS=-O3`` を持たせてコンパイルさせるが、別のパートには ``CFLAGS=-g`` を持たせるといった具合です。
-
-.. But how is the scope for a target file selected? Suppose we are building a file dir/foo.o. omake uses the following rules to determine the scope.
-
-しかし、どのようにしてターゲットファイルのスコープが選択されるのでしょうか?そこで、現在私たちはファイル ``dir/foo.o`` をビルドしているものとしましょう。omakeではスコープを決定するために、以下のルールを用います。
-
-.. * First, if there is an explicit rule for building dir/foo.o (a rule with no wildcards), the context for that rule determines the scope for building the target.
-   * Otherwise, the directory dir/ must be part of the project. This normally means that a configuration file dir/OMakefile exists (although, see the .SUBDIRS section for another way to specify the OMakefile). In this case, the scope of the target is the scope at the end of the dir/OMakefile. 
-
-* まず、もし ``fir/foo.o`` をビルドするための明示的なルールが指定されていた(そしてそのルールはワイルドカードを用いていない)場合、そのルールに従って、ターゲットをビルドするためのスコープが決定されます。
-* さもなければ、ディレクトリ ``dir/`` はプロジェクトの一部であるので、普通に考えて設定ファイル ``dir/OMakefile`` が存在するはずです(あるいは、 ``OMakefile`` を ``.SUBDIRS`` セクションを用いるなどのなにか別の方法で指定しているかもしれません)。この場合、ターゲットのスコープは ``dir/OMakefile`` の終わりのスコープです。
-
-.. To illustrate rule scoping, let's go back to the example of a “Hello world” program with two files. Here is an example OMakefile (the two definitions of CFLAGS are for illustration).
-
-このスコープ規則を確かめるために、2つのファイルから "Hello world" プログラムを作る例へと戻ってみましょう。これは ``OMakefile`` のサンプルです。( ``CFLAGS`` の2つの定義がスコープ規則の確認に用いられます) ::
-
-    # 実行ファイルはデバッグオプションを用いてコンパイルされます
-    CFLAGS = -g
-    hello: hello_code.o hello_lib.o
-       $(CC) $(CFLAGS) -o $@ $+
-
-    # CFLAGSの再定義
-    CFLAGS += -O3
-
-.. In this project, the target hello is explicit. The scope of the hello target is the line beginning with hello:, where the value of CFLAGS is -g. The other two targets, hello_code.o and hello_lib.o do not appear as explicit targets, so their scope is at the end of the OMakefile, where the CFLAGS variable is defined to be -g -O3. That is, hello will be linked with CFLAGS=-g and the .o files will be compiled with CFLAGS=-g -O3.
-
-このプロジェクトでは、ターゲット ``hello`` は *明示的* です。 ``hello`` ターゲットのスコープは ``hello:`` から始まる行なので、 ``CFLAGS`` の値は ``-g`` となります。別の2つのターゲット ``hello_code.o`` と ``hello_lib.o`` は明示的にターゲットが指定されていないため、これらのスコープは ``OMakefile`` の終わりで決定しますので、 ``CFLAGS`` の値は ``-g -O3`` となります。これは、 ``hello`` が ``CFLAGS=-g`` でリンクされて、 ``.o`` ファイルが ``CFLAGS=-g -O3`` でコンパイルされることを表しています。
-
-.. We can change this behavior for any of the targets by specifying them as explicit targets. For example, suppose we wish to compile hello_lib.o with a preprocessor variable LIBRARY.
-
-私たちは明示的にターゲットを指定することで、任意のターゲットのふるまいを変えることができます。例えば、私たちは ``hello_lib.o`` を、プリプロセッサ変数 ``LIBRARY`` を用いてコンパイルしたいものとしましょう。 ::
-
-    # 実行ファイルはデバッグオプションを用いてコンパイルされます
-    CFLAGS = -g
-    hello: hello_code.o hello_lib.o
-       $(CC) $(CFLAGS) -o $@ $+
-
-    # hello_lib.o を CFLAGS = -g -DLIBRARY オプションでコンパイル
-    section
-        CFLAGS += -DLIBRARY
-        hello_lib.o:
-
-    # CFLAGSの再定義
-    CFLAGS += -O3
-
-.. In this case, hello_lib.o is also mentioned as an explicit target, in a scope where CFLAGS=-g -DLIBRARY. Since no rule body is specified, it is compiled using the usual implicit rule for building .o files (in a context where CFLAGS=-g -DLIBRARY).
-
-この場合、 ``hello_lib.o`` の暗黙のターゲットが、 ``CFLAGS=-g -DLIBRARY`` のスコープ中で指定されています。これはルールの内容が指定されていないため、 ``.o`` ファイルは、通常の暗黙のルールを使って( ``CFLAGS=-g -DLIBRARY`` のオプションで)コンパイルされます。
-
-.. index::
-   single: 暗黙のルール
-.. _label8.11.1:
-
-8.11.1 暗黙のルールのスコーピング
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-.. Implicit rules (rules containing wildcard patterns) are not global, they follow the normal scoping convention. This allows different parts of a project to have different sets of implicit rules. If we like, we can modify the example above to provide a new implicit rule for building hello_lib.o.
-
-暗黙のルール(ワイルドパターンを含む)は *グローバルではなく* 、通常のスコープ規則に従っています。これによって、異なるプロジェクトのパートは、異なる暗黙のルールの集合を持つことができるようになりました。もしやってみたいのであれば、私たちは上のサンプルを、以下のような新しい暗黙のルールに修正することができます。 ::
-
-    # 実行ファイルはデバッグオプションを用いてコンパイルされます
-    CFLAGS = -g
-    hello: hello_code.o hello_lib.o
-       $(CC) $(CFLAGS) -o $@ $+
-
-    # hello_lib.o を CFLAGS = -g -DLIBRARY オプションでコンパイル
-    section
-        %.o: %.c
-            $(CC) $(CFLAGS) -DLIBRARY -c $<
-        hello_lib.o:
-
-    # CFLAGSの再定義
-    CFLAGS += -O3
-
-.. In this case, the target hello_lib.o is built in a scope with a new implicit rule for building %.o files. The implicit rule adds the -DLIBRARY option. This implicit rule is defined only for the target hello_lib.o; the target hello_code.o is built as normal.
-
-この場合、ターゲット ``hello_lib.o`` は、 ``%.o`` をビルドするための新しい暗黙のルールがあるスコープ中でビルドされます。この暗黙のルールでは ``-DLIBRARY`` オプションを加えています。この暗黙のルールはターゲット ``hello_lib.o`` だけに定義されるため、ターゲット ``hello_code.o`` は普通にビルドされます。
-
-.. index::
-   single: .SCANNER
-   single: :scanner:
-.. _label8.11.2:
-
-8.11.2 .SCANNER ルールのスコーピング
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-.. Scanner rules are scoped the same way as normal rules. If the .SCANNER rule is explicit (containing no wildcard patterns), then the scope of the scan target is the same as the the rule. If the .SCANNER rule is implicit, then the environment is taken from the :scanner: dependency.
-
-スキャナルールは通常のスコープ規則と同様にスコープされます。 ``.SCANNER`` ルールが明示的に指定されていた(ワイルドカードパターンを含まない)場合、スキャンターゲットのスコープはルールと同様に扱われます。 ``.SCANNER`` ルールが暗黙的に指定されていた場合、その環境は ``:scanner:`` 依存関係によって決定されます。 ::
-
-    # 実行ファイルはデバッグオプションを用いてコンパイルされます
-    CFLAGS = -g
-    hello: hello_code.o hello_lib.o
-       $(CC) $(CFLAGS) -o $@ $+
-
-    # .c ファイルのスキャナ
-    .SCANNER: scan-c-%.c: %.c
-       $(CC) $(CFLAGS) -MM $<
-
-    # hello_lib.o を CFLAGS = -g -DLIBRARY オプションでコンパイル
-    section
-        CFLAGS += -DLIBRARY
-        hello_lib.o: hello_lib.c :scanner: scan-c-hello_lib.c
-           $(CC) $(CFLAGS) -c $<
-
-    # hello_code.c を CFLAGS = -g -O3 オプションでコンパイル
-    section
-        CFLAGS += -O3
-        hello_code.o: hello_code.c :scanner: scan-c-hello_code.c
-           $(CC) $(CFLAGS) -c $<
-
-.. Again, this is for illustration—it is unlikely you would need to write a complicated configuration like this! In this case, the .SCANNER rule specifies that the C-compiler should be called with the -MM flag to compute dependencies. For the target hello_lib.o, the scanner is called with CFLAGS=-g -DLIBRARY, and for hello_code.o it is called with CFLAGS=-g -O3.
-
-再びこの例が登場しましたーあなたは恐らく、このような複雑怪奇な設定を書きたいとは思っていないでしょう!この場合、 ``.SCANNER`` ルールでは、Cコンパイラが依存関係を計算するために ``-MM`` フラグを用いて呼び出すことを指定しています。ターゲット ``hello_lib.o`` には、スキャナは ``CFLAGS=-g -DLIBRARY`` が呼ばれ、 ``hello_code.o`` には、 ``CFLAGS=-g -O3`` が呼ばれます。
-
-.. index::
-   single: .PHONY
-   single: .SUBDIRS
-.. _label8.11.3:
-
-8.11.3 .PHONY ターゲットのスコーピング
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-.. Phony targets (targets that do not correspond to files) are defined with a .PHONY: rule. Phony targets are scoped as usual. The following illustrates a common mistake, where the .PHONY target is declared after it is used.
-
-Phonyターゲット(実際のファイルに相当しないターゲット)は ``.PHONY`` ルールを用いて定義されます。Phonyターゲットは普通にスコープされます。以下の例はよくある間違いで、 ``.PHONY`` ターゲットはそれが使われている *後で* 宣言されています。 ::
-
-    # !!この例は正常に動きません!!
-    all: hello
-
-    hello: hello_code.o hello_lib.o
-        $(CC) $(CFLAGS) -o $@ $+
-
-    .PHONY: all
-
-.. This doesn't work as expected because the .PHONY declaration occurs too late. The proper way to write this example is to place the .PHONY declaration first.
-
-``.PHONY`` 宣言が非常に遅れてしまっているために、この例は期待している通りには動きません。正しくは ``.PHONY`` 宣言を最初に持っていきます。 ::
-
-    # Phonyターゲットはそれが使われる前に宣言されなければなりません
-    .PHONY: all
-
-    all: hello
-
-    hello: hello_code.o hello_lib.o
-        $(CC) $(CFLAGS) -o $@ $+
-
-.. Phony targets are passed to subdirectories. As a practical matter, it is wise to declare all .PHONY targets in your root OMakefile, before any .SUBDIRS. This will ensure that 1) they are considered as phony targets in each of the subdirectories, and 2) you can build them from the project root.
-
-Phonyターゲットはサブディレクトリに渡されます。実用性から、すべての ``.PHONY`` ターゲットを ``.SUBDIRS`` が表れる前に、ルートの ``OMakefile`` に宣言することは賢い判断と言えるでしょう。これは以下の点を保証してくれます。
-
-1. 各々のサブディレクトリにPhonyターゲットが渡される
-2. プロジェクトのルートディレクトリからビルドすることができる
-
-::
-
-    .PHONY: all install clean
-
-    .SUBDIRS: src lib clib
-
-.. Note that when a .PHONY target is inherited by a subdirectory via a .SUBDIRS, a whole hierarchy of .PHONY targets (that are a part of the global one) is created, as described in Section 8.12.2 below.
-
-.. note::
-  ``.SUBDIRS`` を経由したサブディレクトリによって ``.PHONY`` ターゲットが継承されたときに、全体の ``.PHONY`` ターゲット(これはグローバルの一部分です)の階層構造が作られます。詳細は下のセクション ":ref:`label8.12.2`" を参照してください。
-
-.. _label8.12:
-
-8.12 サブディレクトリからOMakeを実行
-----------------------------------------------
-.. Running omake foo asks OMake to build the file foo in context of the whole project, even when running from a subdirectory of the project. Therefore, if bar/baz is a regular target (not a .PHONY one), then running omake bar/baz and running (cd bar; omake baz) are usually equivalent.
-
-``omake foo`` を実行した場合、 *全体* のプロジェクトの文脈から ``foo`` ファイルに関連する部分だけをビルドします。たとえそれがプロジェクトのサブディレクトリから実行したとしてもです。それゆえ、もし ``bar/baz`` が通常のターゲット( ``.PHONY`` ターゲットではない)であるとすると、 ``omake bar/baz`` を実行することは ``(cd bar; omake baz)`` を実行することと等価です。
-
-.. There are two noteworthy exceptions to the above rule: 
-
-上のルールには、2つの注目に値する例外が存在します。
-
-..    * If the subdirectory is not a part of the project (there is no .SUBDIRS) for it, then OMake will complain if you try to run it in that directory.
-      * If a subdirectory contains an OMakeroot of its own, this would designate the subdirectory as a separate project (which is usually a bad idea and is not recommended). 
-
-* サブディレクトリがプロジェクトの一部でなかった( ``.SUBDIRS`` に存在しない)場合、あなたがそのディレクトリから実行させようとすると、OMakeは文句を言うでしょう。
-* サブディレクトリ自身に ``OMakeroot`` が含まれている場合、OMakeはサブディレクトリを別のプロジェクトとして解釈します。これはあまり良い考えではないので推奨しません。
-
-.. index::
-   single: .PHONY
-.. _label8.12.1:
-
-8.12.1 サブディレクトリのPhonyターゲット
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-.. Suppose you have a .PHONY: clean declared in your root OMakefile and both the root OMakefile and the OMakefile in some of the subdirectories contain clean: rules. In this case 
-
-``.PHONY: clean`` がルートの ``OMakefile`` で宣言されており、さらにルートの ``OMakefile`` と、サブディレクトリのいくつかの ``OMakefile`` が ``clean:`` ルールを含んでいるものとします。この場合、
-
-..    * Running omake clean in the root directory will execute all the rules (each in the appropriate directory);
-      * Running omake clean in the subdirectory will execute just its local one, as well as the ones from the subdirectories of the current directory. 
-
-* ``omake clean`` をルートのディレクトリで実行したときには、(適切なディレクトリの中にある各々の)すべての ``clean:`` ルールが実行されます。
-* ``omake clean`` をサブディレクトリで実行したときには、カレントサブディレクトリの ``clean:`` ルールだけが実行されます。
-
-.. The above equally applies to the built-in .PHONY targets, including .DEFAULT. Namely, if OMake is executed (without argument) in the root directory of a project, all the .DEFAULT targets in the project will be built. On the other hand, when OMake is executed (without argument) in a subdirectory, only the .DEFAULT targets defined in and under that subdirectory will be built.
-
-上のルールは ``.DEFAULT`` を含んだ、ビルドインの ``.PHONY`` ターゲットに等しく適用されます。すなわち、もしOMakeがプロジェクトのルートディレクトリで(引数なしで)実行された場合、プロジェクト中のすべての ``.DEFAULT`` がビルドされます。一方で、サブディレクトリでOMakeが(引数なしで)実行された場合、サブディレクトリ中で定義された ``.DEFAULT`` ターゲットだけがビルドされます。
-
-.. The following Section explains the underlying semantics that gives rise to the above behavior.
-
-以下のセクションでは上のようなふるまいをもたらしている、基本的な概念について説明します。
-
-.. _label8.12.2:
-
-8.12.2 .PHONYターゲットの階層構造
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-.. When the the root OMakefile contains a .PHONY: clean directive, it creates: 
-
-ルートの ``OMakefile`` が ``.PHONY:clean`` を含んでいた場合、OMakeは以下を生成します。
-
-..    * A “global” phony target /.PHONY/clean (note the leading “/”);
-      * A “relative” phony target attached to the current directory — .PHONY/clean (note the lack of the leading “/”);
-      * A dependency /.PHONY/clean: .PHONY/clean. 
-
-* "グローバル(global)"なPhonyターゲット ``/.PHONY/clean`` (先頭の "``/``" に注目してください)
-* カレントディレクトリに所属している、"関連している(relative)"Phonyターゲット ``.PHONY/clean`` (先頭の "``/``" が欠けていることに注目してください)
-* 依存関係 ``/.PHONY/clean: .PHONY/clean``
-
-.. All the clean: ... rules in the root OMakefile following this .PHONY: clean declaration would be interpreted as rules for the .PHONY/clean target.
-
-ルートの ``OMakefile`` では、 ``.PHONY: clean`` 宣言の後にくるすべての ``clean: ...`` ルールは、 ``.PHONY/clean`` ターゲットのルールとして解釈されます。
-
-.. Now when OMake then comes across a .SUBDIRS: foo directive (when it is in scope of the above .PHONY: clean declaration), it does the following: 
-
-それでは、次にOMakeは(上の ``.PHONY: clean`` 宣言のスコープ上で) ``.SUBDIRS: foo`` に遭遇したとしましょう。この場合、OMakeは以下の処理を行います。
-
-..    * Creates a new .PHONY/foo/clean “relative” phony target;
-      * Creates the dependency .PHONY/clean: .PHONY/foo/clean;
-      * Processes the body of the .SUBDIRS: foo directive, or reads the foo/OMakefile file, if the body is empty. While doing that, it interprets its instructions relative to the foo directory. In particular, all the clean: ... rules will be taken to apply to .PHONY/foo/clean. 
-
-* 新しい ``.PHONY/foo/clean`` Phonyターゲットを生成します。このターゲットは"関連している"Phonyターゲットです。
-* 依存関係 ``.PHONY/clean: .PHONY/foo/clean`` を生成します。
-* ``.SUBDIRS: foo`` の内容を処理するか、もし内容が空であった場合は ``foo/OMakefile`` を読み込みます。処理している間、これらの指示は ``foo`` ディレクトリに関連しているものと解釈します。特に、すべての ``clean: ...`` ルールは ``.PHONY/foo/clean`` に適用されます。
-
-.. Now when you run omake clean in the root directory of the project, it is interpreted as omake .PHONY/clean (similar to how it happens with the normal targets), so both the rules for .PHONY/clean are executed and the rules for its dependency .PHONY/foo/clean. Running (cd foo; omake clean) is, as for normal targets, equivalent to running omake .PHONY/foo/clean and only those rules that apply to .PHONY/foo/clean will be executed.
-
-あなたが ``omake clean`` をプロジェクトのルートディレクトリで実行した場合、これは ``omake .PHONY/clean`` として解釈され(通常のターゲットに関しても同様です)、 ``.PHONY/clean`` のルールと、その依存関係 ``.PHONY/foo/clean`` のルールの両方が実行されます。また、 ``(cd foo; omake clean)`` を実行することは、 ``omake .PHONY/foo/clean`` を実行することと等価であり、 ``.PHONY/foo/clean`` のルールだけが実行されます。これもまた、通常のターゲットに関して同様です。
-
-.. index::
-   single: absname()
-   single: --absname
-   single: OMakeFlags()
-.. _label8.13:
-
-8.13 ルール中でのパス名
-----------------------------------
-.. In rules, the targets and dependencies are first translated to file values (as in the file function). They are then translated to strings for the command line. This can cause some unexpected behavior. In the following example, the absname function is the absolute pathname for the file a, but the rule still prints the relative pathname.
-
-ルール中では、ターゲットと依存先は最初に"ファイル"として変換されます(詳細は ":ref:`label10.1.1`" を参照してください)。これらはコマンドライン上で文字列として変換される値です。また、これによっていくつかの期待していないふるまいを起こすことがあります。以下の例では、 ``absname`` 関数はファイル ``a`` の絶対パスを返す関数ですが、それにも関わらずこのルールでは相対パスとして出力されています。 ::
-
-    .PHONY: demo
-    demo: $(absname a)
-        echo $<
-
-    # omakeのデモ
-    a
-
-.. There is arguably a good reason for this. On Win32 systems, the / character is viewed as an “option specifier.” The pathname separator is the \ character. OMake translates the filenames automatically so that things work as expected on both systems.
-
-この振る舞いについては、議論の余地がある良い理由があります。Win32のシステム上では、 ``/`` という文字は『オプションの指定子』として判定されます。そして、パス名のセパレータには
-``\`` が用いられています。OMakeはファイル名を自動的に変換することで、両方のシステムで期待通りの動きをするようにしてくれます。 ::
-
-   demo: a/b
-       echo $<
-
-   # omakeのデモ(Unixのシステム上)
-   a/b
-   # omakeのデモ(Win32のシステム上)
-   a\b
-
-.. Sometimes you may wish that target strings to be passed literally to the commands in the rule. One way to do this is to specify them literally.
-
-ときどき、あなたはターゲット名を、ルール中のコマンドに文字通り渡したいと思うことがあるかもしれません。これを解決する一つの方法は、変数を指定してあげることです。 ::
-
-    SRC = a/b $(absname c/d)
-    demo: $(SRC)
-        echo $(SRC)
-
-    # omakeのデモ(Win32のシステム上)
-    a/b c:\...\c\d
-
-.. Alternately, you might wish that filenames be automatically expanded to absolute pathnames. For example, this might be useful when parsing the OMake output to look for errors. For this, you can use the --absname option (Section A.3.20). If you call omake with the --absname option, all filenames will be expanded to absolute names.
-
-ついでに、あなたはファイル名を自動的に絶対パスに展開してほしいと思うこともあるかもしれません。例えば、エラーを見るために、OMakeの出力を解析するような場合には有効でしょう。これを実現するために、あなたは ``--absname`` オプションを用いることができます(詳細は :ref:`labelA.3.20` を参照してください)。もしあなたが ``omake`` を ``--absname`` オプションで呼び出した場合、すべてのファイル名は絶対パスとして展開されます。 ::
-
-    # omake --absname のデモ(Unixのシステム上)
-    /home/.../a/b /home/.../c/d
-
-.. Alternately, the --absname option is scoped. If you want to use it for only a few rules, you can use the OMakeFlags function to control how it is applied.
-
-ついでに、 ``--absname`` オプションはスコープ化されています。もしあなたがこれを限られたルールでのみ用いたい場合は、 ``OMakeFlags`` 関数を使うことで、 ``--absname`` オプションを適用するかどうかをコントロールすることができます。 ::
-
-   section
-      OMakeFlags(--absname)
-      demo: a
-          echo $<
-
-   # omakeデモ
-   /home/.../a
-
-.. N.B. The --absname option is currently an experimental feature.
-
-.. warning::
-  ``--absname`` オプションは現在、実験的な機能として搭載しています。
diff --git a/shell.rst b/shell.rst
deleted file mode 100644 (file)
index 6dff434..0000000
--- a/shell.rst
+++ /dev/null
@@ -1,336 +0,0 @@
-.. 11-shell
-
-.. _label11:
-
-11. シェルコマンド
-==================================
-.. Shell commands (commands to be executed by the operating system) can be freely mixed with other code.
-
-シェルコマンド(OSによって実行されるコマンド)は自由に他のコードとミックスすることができます。
-
-.. NOTE: the syntax and shell usage is identical on all platforms, including Win32. To avoid portability problems on Win32, it is recommended that you avoid the use of the native shell interpreter cmd.
-
-.. note::
-    構文とシェルの使い方はすべてのプラットフォーム(Win32を含む)において同一です。Win32上に移植した場合の問題を避けるために、ネイティブのインタープリター ``cmd`` を使わないことをおすすめします。 ::
-
-        LIB = $(dir lib)
-       println(The contents of the $(LIB) directory is:)
-        ls $(LIB)
-
-.. _label11.1:
-
-11.1 簡単なコマンド
-----------------------------------
-.. The syntax of shell commands is similar to the syntax used by the Unix shell bash. In general, a command is a pipeline. A basic command is part of a pipeline. It is specified with the name of an executable and some arguments. Here are some examples.
-
-シェルコマンドの構文はUnixシェル ``bash`` を使うときの構文と似ています。
-通常、コマンドは *パイプライン* となっています。通常のコマンドはパイプラインの一部です。コマンドを実行するためには、実行可能なコマンド名といくつかの引数を指定する必要があります。以下はいくつかの例です。 ::
-
-    ls
-    ls -AF .
-    echo Hello world
-
-.. The command is found using the current search path in the variable PATH[], which should define an array of directories containing executables.
-
-コマンドは実行可能コマンドが格納されているディレクトリの配列 ``PATH[]`` 変数の値を用いて探します。
-
-.. A command may also be prefixed by environment variable definitions.
-
-コマンドは環境変数の定義によって修正されることがあります。 ::
-
-    # "Hello world" と出力
-    env X="Hello world" Y=2 printenv X
-    # Visual C++ のインクルードパスを検索
-    env include="c:\Program Files\Microsoft SDK\include" cl foo.cpp
-
-.. _label11.2:
-
-11.2 検索
-----------------------------------
-.. Commands may contain wildcard patterns. A pattern specifies a set of files through a limited kind of regular expression. Patterns are expanded before the function is executed.
-
-コマンドにはワイルドカードパターンを含めることができます。パターンには制限された正規表現を用いたファイルの集合を指定します。パターンは関数が実行される前に展開されます。 ::
-
-   # .c 拡張子のファイルをすべてリスト
-   ls *.c
-
-   # 1文字の接頭辞と.cの拡張子を持ったすべてのファイルをリスト
-   ls ?.c
-
-   # hello.mlファイルをfoo.mlにリネーム
-   mv {hello,foo}.ml
-
-.. A comprehensive description of OMake glob patterns is given in Section 10.4.
-
-OMakeのglobパターンのさらなる説明は ":ref:`label10.4`" で与えられます。
-
-.. _label11.3:
-
-11.3 バックグラウンドでのジョブ
-----------------------------------
-.. The command may also be placed in the background by placing an ampersand after the command. Control returns to the shell without waiting for the job to complete. The job continues to run in the background.
-
-コマンドはまたアンパサンド ``&`` をコマンドの後に付与することで、バックグラウンド上で実行されます。ユーザへの制御は、ジョブが完了するまで待つことなく返されます。ジョブはバックグラウンド上で走り続けます。 ::
-
-    gcc -o hugeprogram *.c &
-
-.. index::
-   single: ファイルのリダイレクション
-.. _label11.4:
-
-11.4 ファイルのリダイレクション
-----------------------------------
-.. Input and output can be redirected to files by using the <, >, and >& directives after the command.
-
-入力と出力は ``<`` , ``>`` , ``>&`` をコマンドの後に付与することによって、ファイルにリダイレクトすることができます。 ::
-
-    # "foo" ファイルに書き込み
-    echo Hello world > foo
-
-    # fooファイルからの入力をリダイレクト
-    cat < foo
-
-    # 標準出力、標準エラーをfooファイルにリダイレクト
-    gcc -o boo *.c >& foo
-
-.. index::
-   single: パイプライン
-.. _label11.5:
-
-11.5 パイプライン
-----------------------------------
-.. Pipelines are sequences of commands, where the output from each command is sent to the next. Pipelines are defined with the | and |& syntax. With | the output is redirected, but errors are not. With |& both output and errors are redirected.
-
-パイプラインはコマンドのシーケンスで、各々のコマンドの出力は次のコマンドへ送られます。パイプは ``|`` と ``|&`` で定義されます。 ``|`` は出力はリダイレクトされますが、エラーはされません。 ``|&`` は出力とエラーの両方がリダイレクトされます。 ::
-
-   # lsコマンドの出力をプリンターに送る
-   ls *.c | lpr
-
-   # 出力とエラーをEメールを使ってjyhに送る
-   gcc -o hugefile *.c |& mail jyh
-
-.. index::
-   single: 実行の条件分岐
-.. _label11.6:
-
-11.6 条件分岐の実行
-----------------------------------
-.. Commands may also be composed though conditional evaluation using the || and && syntax. Every command has an integer exit code, which may be zero or some other integer. A command is said to succeed if its exit code is zero. The expression command1 && command2 executes command2 only if command1 succeeds. The expression command1 || command2 executes command2 only if command1 fails.
-
-コマンドは ``||`` と ``&&`` の条件分岐を使うことで複雑に組み合わせることができます。すべてのコマンドは0か他の整数の終了コードを返します。コマンドは終了コードが0であった場合、成功したと宣言します。式 ``command1 && command2`` は、 ``command1`` が成功した場合のみ ``command2`` が実行されます。式 ``command1 || command2`` は、 ``command1`` が失敗した場合のみ ``command2`` が実行されます。 ::
-
-   # 可能な場合のみx/yファイルを表示する
-   cd x && cat y
-
-   # foo.exeを実行するか、エラーメッセージを表示する
-   (test -x foo.exe && foo.exe) || echo "foo.exe is not executable"
-
-.. index::
-   single: グループ化
-.. _label11.7:
-
-11.7 グループ化
-----------------------------------
-.. Parenthesis are used for grouping in a pipeline or conditional command. In the following expression, the test function is used to test whether the foo.exe file is executable. If it is, the foo.exe file is executed. If the file is not executable (or if the foo.exe command fails), the message "foo.exe is not executable" is printed.
-
-パイプラインをグループ化したり、条件分岐をさせる場合には括弧を使います。以下の式では、 ``test`` 関数は ``foo.exe`` ファイルが実行可能であるかどうか試し、もしそうであったのなら、 ``foo.exe`` ファイルが実行されます。もし実行可能でなかったのなら(あるいは ``foo.exe`` コマンドが失敗したのなら)、メッセージ ``"foo.exe is not executable"`` が表示されます。 ::
-
-   # foo.exeを実行するか、エラーメッセージを表示する
-   (test -x foo.exe && foo.exe) || echo "foo.exe is not executable"
-
-.. _label11.8:
-
-11.8 シェルコマンドとは何か?
-----------------------------------
-.. Syntactially, shell commands are any line that is not one of the following
-
-構文的には、シェルコマンドは以下のうち一つも該当していない任意の行を指します。
-
-.. A variable definition of the form VAR=string
-   A function call f(...) or method call o.f(...)
-   A rule definition containing a colon string: ...
-   A special command, including the following: 
-
-* ``VAR=string`` の形の変数定義
-* 関数の呼び出し ``f(...)`` かメソッドの呼び出し ``o.f(...)``
-* コロン:を含んだルールの定義 ``string: ...``
-* 以下のリストを含む特殊コマンド
-    * ``if ...``
-    * ``switch ...``
-    * ``match ...``
-    * ``section ...``
-    * ``return ...``
-
-.. Commands may also be builtin (aliases). See the documentation for the Shell object for more information.
-
-コマンドはまたビルドイン(エイリアス)でもあります。さらなる情報は ":ref:`label12.1.22`" を参照してください。
-
-.. _label11.9:
-
-11.9 基本的なビルドイン関数
-----------------------------------
-
-.. index::
-   single: echo()
-.. _label11.9.1:
-
-11.9.1 echo
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-.. The echo function prints a string.
-
-``echo`` 関数は文字列を表示します。 ::
-
-  $(echo <args>)
-  echo <args>
-
-.. index::
-   single: cd()
-.. _label11.9.2:
-
-11.9.2 cd
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-.. The cd function changes the current directory.
-
-``cd`` 関数はカレントディレクトリを変更します。 ::
-
-    cd(dir)
-       dir : Dir
-
-.. The cd function also supports a 2-argument form:
-
-``cd`` 関数は2つの引数を取ることもできます。 ::
-
-    $(cd dir, e)
-       dir : Dir
-       e : expression
-
-.. In the two-argument form, expression e is evaluated in the directory dir. The current directory is not changed otherwise.
-
-2つ引数を取る形では、式 ``e`` がディレクトリ ``dir`` 上で評価されます。カレントディレクトリは変更されません。
-
-.. The behavior of the cd function can be changed with the CDPATH variable, which specifies a search path for directories. This is normally useful only in the osh command interpreter.
-
-``cd`` 関数のふるまいはディレクトリの検索パスを指定している ``CDPATH`` 変数を用いて変更できます。これは通常、oshコマンドインタープリタ上でのみ有効です。 ::
-
-    CDPATH : Dir Sequence
-
-.. For example, the following will change directory to the first directory ./foo, ~/dir1/foo, ~/dir2/foo.
-
-例えば、以下の式ではディレクトリを最初のディレクトリ ``./foo`` , ``~/dir1/foo`` , ``~/dir2/foo`` に変更します。 ::
-
-    CDPATH[] =
-       .
-       $(HOME)/dir1
-       $(HOME)/dir2
-    cd foo
-
-.. _label11.10:
-
-11.10 ジョブを制御するビルドイン関数
----------------------------------------
-
-.. index::
-   single: jobs()
-.. _label11.10.1:
-
-11.10.1 jobs
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-.. The jobs function prints a list of jobs.
-
-``jobs`` 関数はジョブのリストを表示します。 ::
-
-  jobs
-
-.. index::
-   single: bg()
-.. _label11.10.2:
-
-11.10.2 bg
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-.. The bg function places a job in the background.
-
-``bg`` 関数はバックグラウンド上にジョブを配置します。 ::
-
-  bg <pid...>
-
-.. index::
-   single: fg()
-.. _label11.10.3:
-
-11.10.3 fg
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-.. The fg function brings a job to the foreground.
-
-``fg`` 関数はジョブをフォアグラウンドに持っていきます。 ::
-
-  fg <pid...>
-
-.. index::
-   single: stop()
-.. _label11.10.4:
-
-11.10.4 stop
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-.. The stop function suspends a job.
-
-``stop`` 関数はジョブを停止(suspends)します。 ::
-
-  stop <pid...>
-
-.. index::
-   single: wait()
-.. _label11.10.5:
-
-11.10.5 wait
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-.. The wait function waits for a job to finish. If no process identifiers are given, the shell waits for all jobs to complete.
-
-``wait`` 関数はジョブが完了するまで待機します。プロセス固有の値が指定されなかった場合、シェルはすべてのジョブが完了するまで待機します。 ::
-
-  wait <pid...>
-
-.. index::
-   single: kill()
-.. _label11.10.6:
-
-11.10.6 kill
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-.. The kill function signals a job.
-
-``kill`` 関数はジョブにシグナルを送ります。 ::
-
-  kill [signal] <pid...>
-
-.. _label11.10.7:
-
-11.11 コマンド履歴
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-.. index::
-   single: history()
-.. _label11.11.1:
-
-11.11.1 history
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-::
-
-    $(history-index) : Int
-    $(history) : String Sequence
-    history-file : File
-    history-length : Int
-
-.. The history variables manage the command-line history in osh. They have no effect in omake.
-
-ヒストリ変数はosh上のコマンドライン履歴を管理します。これらの変数はomakeに影響を及ぼしません。
-
-.. The history-index variable is the current index into the command-line history. The history variable is the current command-line history.
-
-``history-index`` 変数はコマンドライン履歴における、現在のインデックスを表します。 ``history`` 変数は現在のコマンドライン履歴を表します。
-
-.. The history-file variable can be redefined if you want the command-line history to be saved. The default value is ~/.omake/osh_history.
-
-コマンドライン履歴を保存したいと思った場合、あなたは ``history-file`` 変数を再定義することができます。デフォルトの値は ``~/.omake/osh_history`` です。
-
-.. The history-length variable can be redefined to specify the maximum number of lines in the history that you want saved. The default value is 100. 
-
-コマンドライン履歴の行数の最大値を指定したい場合、あなたは ``history-length`` 変数を再定義することができます。デフォルトの値は ``100`` です。
diff --git a/system.rst b/system.rst
deleted file mode 100644 (file)
index 9974ec5..0000000
+++ /dev/null
@@ -1,3291 +0,0 @@
-.. 10-system
-
-.. _label10:
-
-10. システム関数
-==================================
-
-.. _label10.1:
-
-10.1 ファイル名
-----------------------------------
-
-.. index::
-   single: file()
-   single: dir()
-.. _label10.1.1:
-
-10.1.1 file, dir
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-::
-
-   $(file sequence) : File Sequence
-      sequence : Sequence
-   $(dir sequence) : Dir Sequence
-      sequence : Sequence
-
-.. The file and dir functions define location-independent references to files and directories. In omake, the commands to build a target are executed in the target's directory. Since there may be many directories in an omake project, the build system provides a way to construct a reference to a file in one directory, and use it in another without explicitly modifying the file name. The functions have the following syntax, where the name should refer to a file or directory.
-
-``file`` と ``dir`` 関数はomakeが動く場所に依存しない、ファイルとディレクトリの位置を定義します。omakeでは、ターゲットをビルドするコマンドはターゲット上のディレクトリにて実行されます。プロジェクト中には多くのディレクトリが存在するため、omakeではあるディレクトリ上のファイルを確実に指定する方法が存在します。これにより、たとえ別のディレクトリ上に移動したとしても、明示的にパスを修正せずに特定のファイルを指定することができます。 ``file`` , ``dir`` 関数は以下のように用いることで、ディレクトリやファイルのパスが関連付けられます。
-
-.. For example, we can construct a reference to a file foo in the current directory.
-
-例えば、カレントディレクトリ中でファイル ``foo`` を示す変数を作ったとしましょう。 ::
-
-   FOO = $(file foo)
-   .SUBDIRS: bar
-
-.. If the FOO variable is expanded in the bar subdirectory, it will expand to ../foo.
-
-``FOO`` 変数が ``bar`` サブディレクトリ中で展開された場合、これは ``../foo`` と展開されます。
-
-.. These commands are often used in the top-level OMakefile to provide location-independent references to top-level directories, so that build commands may refer to these directories as if they were absolute.
-
-これらのコマンドはトップレベルのディレクトリを確実に指定するために、トップレベルのOMakefileにてしばしば用いられます。よって、ビルドコマンドはこれらのディレクトリを、まるで絶対パスで表しているのように扱うことができます。 ::
-
-   ROOT = $(dir .)
-   LIB  = $(dir lib)
-   BIN  = $(dir bin)
-
-.. Once these variables are defined, they can be used in build commands in subdirectories as follows, where $(BIN) will expand to the location of the bin directory relative to the command being executed.
-
-これらの変数はいったん定義されたらサブディレクトリ中でもビルドコマンドに使うことができるので、下の ``$(BIN)`` はコマンドが実行されたディレクトリに関連付けられた ``bin`` ディレクトリで展開されます。 ::
-
-   install: hello
-     cp hello $(BIN)
-
-.. index::
-   single: tmpfile()
-.. _label10.1.2:
-
-10.1.2 tmpfile
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-::
-
-    $(tmpfile prefix) : File
-    $(tmpfile prefix, suffix) : File
-        prefix : String
-        suffix : String
-
-.. The tmpfile function returns the name of a fresh temporary file in the temporary directory. 
-
-``tmpfile`` 関数は一時的なディレクトリ中にある、一時的な空のファイル名を返します。
-
-.. index::
-   single: in()
-.. _label10.1.3:
-
-10.1.3 in
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-::
-
-   $(in dir, exp) : String Array
-      dir : Dir
-      exp : expression
-
-.. The in function is closely related to the dir and file functions. It takes a directory and an expression, and evaluates the expression in that effective directory. For example, one common way to install a file is to define a symbol link, where the value of the link is relative to the directory where the link is created.
-
-``in`` 関数は ``dir`` や ``file`` 関数と密接に関係しています。ディレクトリとファイル名を指定することで、ディレクトリ上からのファイルの位置を返します。例えば、ファイルをインストールするためによく使われる方法の一つとしてシンボリックリンクを定義することで、その値は特定のディレクトリに関連付けられているものとします。
-
-.. The following commands create links in the $(LIB) directory.
-
-以下のコマンドでは ``$(LIB)`` ディレクトリ中でリンクを生成しています。 ::
-
-    FOO = $(file foo)
-    install:
-       ln -s $(in $(LIB), $(FOO)) $(LIB)/foo
-
-.. Note that the in function only affects the expansion of Node (File and Dir) values. 
-
-.. note::
-  ``in`` 関数は ``Node`` ( ``File`` と ``Dir`` )が与えられた場合のみに評価を行います。
-
-.. index::
-   single: basename()
-.. _label10.1.4:
-
-10.1.4 basename
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-::
-
-   $(basename files) : String Sequence
-      files : String Sequence
-
-.. The basename function returns the base names for a list of files. The basename is the filename with any leading directory components removed.
-
-``basename`` 関数は引数に指定されたファイルのリストから元のファイル名のみを返します。任意のディレクトリパスは除去されます。
-
-.. For example, the expression $(basename dir1/dir2/a.out /etc/modules.conf /foo.ml) evaluates to a.out modules.conf foo.ml.
-
-例えば、式 ``$(basename dir1/dir2/a.out /etc/modules.conf /foo.ml)`` は ``a.out modules.conf foo.ml`` と評価されます。
-
-.. index::
-   single: dirname()
-.. _label10.1.5:
-
-10.1.5 dirname
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-::
-
-   $(dirname files) : String Sequence
-      files : String Sequence
-
-.. The dirname function returns the directory name for a list of files. The directory name is the filename with the basename removed. If a name does not have a directory part, the directory is “.”
-
-``dirname`` 関数は引数に指定されたファイルのリストからディレクトリ名を返します。任意のファイル名は除去されます。ディレクトリ部分が指定されていない場合は、"."が返されます。
-
-.. For example, the expression $(dirname dir1\dir2\a.out /etc/modules.conf /foo.ml bar.ml) evaluates to dir1/dir2 /etc / ..
-
-例えば、式 ``$(dirname dir1\dir2\a.out /etc/modules.conf /foo.ml bar.ml)`` は ``dir1/dir2 /etc / .`` と評価されます。
-
-.. Note: this function is different from the dirof function. The function dirname is simple a function over strings, while dirof is a function on filenames. 
-
-.. note::
-  この関数は ``dirof`` 関数と異なります。 ``dirname`` 関数は単純に文字列のシーケンスを解析して返すのに対し、 ``dirof`` は ``File`` オブジェクトを解析する関数です。
-
-.. index::
-   single: rootname()
-.. _label10.1.6:
-
-10.1.6 rootname
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-::
-
-   $(rootname files) : String Sequence
-      files : String Sequence
-
-.. The rootname function returns the root name for a list of files. The rootname is the filename with the final suffix removed.
-
-``rootname`` 関数は引数に指定されたファイルのリストから基底の名前を返します。ここでの『基底の名前』とは拡張子が除去されたファイル名のことです。
-
-.. For example, the expression $(rootname dir1/dir2/a.out /etc/a.b.c /foo.ml) evaluates to dir1/dir2/a /etc/a.b /foo. 
-
-例えば、式 ``$(rootname dir1/dir2/a.out /etc/a.b.c /foo.ml)`` は ``dir1/dir2/a /etc/a.b /foo`` と評価されます。
-
-.. index::
-   single: dirof()
-.. _label10.1.7:
-
-10.1.7 dirof
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-::
-
-   $(dirof files) : Dir Sequence
-      files : File Sequence
-
-.. The dirof function returns the directory for each of the listed files.
-
-``dirof`` 関数は引数に指定されたファイルのリストからディレクトリを返します。
-
-.. For example, the expression $(dirof dir/dir2/a.out /etc/modules.conf /foo.ml) evaluates to the directories dir1/dir2 /etc /. 
-
-例えば、式 ``$(dirof dir/dir2/a.out /etc/modules.conf /foo.ml)`` は ``dir1/dir2 /etc /`` と評価されます。
-
-.. index::
-   single: fullname()
-.. _label10.1.8:
-
-10.1.8 fullname
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-::
-
-   $(fullname files) : String Sequence
-      files : File Sequence
-
-.. The fullname function returns the pathname relative to the project root for each of the files or directories.
-
-``fullname`` 関数は指定した各々のファイルやディレクトリの、プロジェクトルートを元にしたパスを返します。
-
-.. note::
-  訳注:このような動きをします。 ::
-  
-    % a = foo/bar
-    - : "foo/bar" : Sequence
-    % b = $(fullname $a)
-    - : <data "/your-project/foo/bar"> : String
-
-.. index::
-   single: absname()
-.. _label10.1.9:
-
-10.1.9 absname
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-::
-
-   $(absname files) : String Sequence
-      files : File Sequence
-
-.. The absname function returns the absolute pathname for each of the files or directories. 
-
-``absname`` 関数は指定した各々のファイルやディレクトリの絶対パスを返します。
-
-.. index::
-   single: homename()
-.. _label10.1.10:
-
-10.1.10 homename
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-::
-
-   $(homename files) : String Sequence
-      files : File Sequence
-
-.. The homename function returns the name of a file in tilde form, if possible. The unexpanded forms are computed lazily: the homename function will usually evaluate to an absolute pathname until the first tilde-expansion for the same directory. 
-
-``homename`` 関数は可能であればチルダ ``~`` を用いてパス名を返します。展開できない形のパスは遅延的に計算されます。具体的にいうと、 ``homename`` 関数は通常、始めてチルダ型のパスとして展開できるようになるまでは、絶対パスとして評価します。
-
-.. index::
-   single: suffix()
-.. _label10.1.11:
-
-10.1.11 suffix
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-::
-
-   $(suffix files) : String Sequence
-      files : StringSequence
-
-.. The suffix function returns the suffixes for a list of files. If a file has no suffix, the function returns the empty string.
-
-``suffix`` 関数はファイルのリストから拡張子を返します。もし拡張子が存在しなかった場合、空の文字列が返されます。
-
-.. For example, the expression $(suffix dir1/dir2/a.out /etc/a /foo.ml) evaluates to .out .ml. 
-
-例えば、式 ``$(suffix dir1/dir2/a.out /etc/a /foo.ml)`` は ``.out .ml`` と評価されます。
-
-.. _label10.2:
-
-10.2 パスによる検索
-----------------------------------
-
-.. index::
-   single: which()
-.. _label10.2.1:
-
-10.2.1 which
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-::
-
-   $(which files) : File Sequence
-      files : String Sequence
-
-.. The which function searches for executables in the current command search path, and returns file values for each of the commands. It is an error if a command is not found. 
-
-``which`` 関数は現在のコマンド検索パスから実行可能なものを検索し、引数に指定されたコマンドのファイルパスを返します。コマンドが見つからない場合にはエラーが発生します。
-
-.. index::
-   single: where()
-.. _label10.2.2:
-
-10.2.2 where
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-.. The where function is similar to which, except it returns the list of all the locations of the given executable (in the order in which the corresponding directories appear in $PATH). In case a command is handled internally by the Shell object, the first string in the output will describe the command as a built-in function.
-
-``where`` 関数は ``which`` 関数と似ていますが、この関数は与えられた実行コマンドのすべての位置をリストとして返します。この場合ですと ``echo`` コマンドは ``Shell`` オブジェクトによって内的に扱われるので、出力先の最初の文字列ではビルドイン関数として扱われていることを表しています。 ::
-
-    % where echo
-    echo is a Shell object method (a built-in function)
-    /bin/echo
-
-.. index::
-   single: rehash()
-.. _label10.2.3:
-
-10.2.3 rehash
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-::
-
-    rehash()
-
-.. The rehash function resets all search paths. 
-
-``rehash`` 関数はすべての検索パスをリセットします。
-
-.. index::
-   single: exists-in-path()
-.. _label10.2.4:
-
-10.2.4 exists-in-path
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-::
-
-   $(exists-in-path files) : String
-      files : String Sequence
-
-.. The exists-in-path function tests whether all executables are present in the current search path. 
-
-``exists-in-path`` 関数は引数に指定されたすべてのコマンドが、現在の検索パス上に存在しているかどうか試します。
-
-.. index::
-   single: digest()
-   single: digest-optional()
-.. _label10.2.5:
-
-10.2.5 digest, digest-optional
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-::
-
-     $(digest files) : String Array
-        file : File Array
-     raises RuntimeException
-
-     $(digest-optional files) : String Array
-        file : File Array
-
-.. The digest and digest-optional functions compute MD5 digests of files. The digest function raises an exception if a file does no exist. The digest-optional returns false if a file does no exist. MD5 digests are cached. 
-
-``digest`` と ``digest-optional`` 関数はファイルのMD5を計算します。 ``digest`` 関数はファイルが存在しない場合には例外を送出します。一方で、 ``digest-optional`` はこの様な場合 ``false`` を返します。また、MD5はキャッシュされます。
-
-.. index::
-   single: find-in-path()
-   single: find-in-path-optional()
-.. _label10.2.6:
-
-10.2.6 find-in-path, find-in-path-optional
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-::
-
-    $(find-in-path path, files) : File Array
-       path : Dir Array
-       files : String Array
-    raises RuntimeException
-
-    $(find-in-path-optional path, files) : File Array
-
-.. The find-in-path function searches for the files in a search path. Only the tail of the filename is significant. The find-in-path function raises an exception if the file can't be found. The find-in-path-optional function silently removes files that can't be found. 
-
-``file-in-path`` 関数は指定されたパスから指定されたファイルを検索します。これらの関数はファイル名が一致した場合のみ処理の対象となります(訳注: 一部ではない)。 ``find-in-path`` 関数はファイルが見つからない場合には例外を送出します。一方で、 ``find-in-path-optional`` 関数はこの様な場合、例外を送出せずに結果から取り除かれます。
-
-.. index::
-   single: digest-in-path()
-   single: digest-in-path-optional()
-.. _label10.2.7:
-
-10.2.7 digest-in-path, digest-in-path-optional
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-::
-
-    $(digest-in-path path, files) : String/File Array
-       path : Dir Array
-       files : String Array
-    raises RuntimeException
-
-    $(digest-in-path-optional path, files) : String/File Array
-
-.. The digest-in-path function searches for the files in a search path and returns the file and digest for each file. Only the tail of the filename is significant. The digest-in-path function raises an exception if the file can't be found. The digest-in-path-optional function silently removes elements that can't be found. 
-
-``diget-in-path`` 関数は指定されたパスからファイルを検索し、各々のファイルのファイルパスとMD5を返します。これらの関数はファイル名が一致した場合のみ処理の対象となります。 ``digest-in-path`` 関数はファイルが見つからない場合には例外を送出します。一方で、 ``digest-in-path-optional`` 関数はこの様な場合、例外を送出せずに結果から取り除かれます。
-
-.. _label10.3:
-
-10.3 ファイル検査
-----------------------------------
-
-.. index::
-   single: file-exists()
-   single: target-exists()
-   single: target-is-proper()
-.. _label10.3.1:
-
-10.3.1 file-exists, target-exists, target-is-proper
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-::
-
-   $(file-exists files) : String
-   $(target-exists files) : String
-   $(target-is-proper files) : String
-       files : File Sequence
-
-.. The file-exists function checks whether the files listed exist. The target-exists function is similar to the file-exists function. However, it returns true if the file exists or if it can be built by the current project. The target-is-proper returns true only if the file can be generated in the current project.
-
-``file-exists`` 関数はリストされているファイルが存在しているかどうか調べます。 ``target-exists`` 関数は ``file-exists`` と似ていますが、この関数はファイルが存在するか、現在のプロジェクトでターゲットとなっているような場合に ``true`` を返します。 ``target-is-proper`` 関数は指定されたファイルが現在のプロジェクトで生成できる場合のみ ``true`` を返します。
-
-.. index::
-   single: stat-reset()
-.. _label10.3.2:
-
-10.3.2 stat-reset
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-::
-
-   $(stat-reset files) : String
-       files : File Sequence
-
-.. OMake uses a stat-cache. The stat-reset function reset the stat information for the given files, forcing the stat information to be recomputed the next time it is requested. 
-
-OMakeでは ``Stat`` によるキャッシュを行っています。 ``stat-reset`` 関数は ``stat`` から指定されたファイルの情報をリセットし、次回にこれらの情報が要求された場合には ``stat`` 情報が強制的に再計算されます。
-
-.. index::
-   single: filter-exists()
-   single: filter-targets()
-   single: filter-proper-targets()
-.. _label10.3.3:
-
-10.3.3 filter-exists, filter-targets, filter-proper-targets
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-::
-
-   $(filter-exists files) : File Sequence
-   $(filter-targets files) : File Sequence
-   $(filter-proper-targets) : File Sequence
-      files : File Sequence
-
-.. The filter-exists, filter-targets, and filter-proper-targets functions remove files from a list of files. 
-
-``filter-exists`` , ``filter-targets`` , ``filter-proper-targets`` 関数は指定されたファイルのリストをフィルタリングして、特定のファイルのみを返します。
-
-..  * filter-exists: the result is the list of files that exist.
-    * filter-targets: the result is the list of files either exist, or can be built by the current project.
-    * filter-proper-targets: the result is the list of files that can be built in the current project. 
-
-* ``filter-exists`` : 存在しているファイルのリストのみが結果として返されます。
-* ``filter-targets`` : ファイルが存在しているか、現在のプロジェクト上でビルドできるような場合は結果として返されます。
-* ``filter-proper-targets`` : 現在のプロジェクトでビルドできるファイルのリストのみが結果として返されます。
-
-"distclean" ターゲットを作る
-""""""""""""""""""""""""""""""""""""""""
-.. One way to create a simple “distclean” rule that removes generated files from the project is by removing all files that can be built in the current project.
-
-プロジェクトによって生成されたファイルを消去する ``distclean`` ルールを作るような場合に、一つの簡単な方法が存在します。それは、現在のプロジェクトでビルドすることのできるすべてのファイルを消去することです。
-
-.. CAUTION: you should be careful before you do this. The rule removes any file that can potentially be reconstructed. There is no check to make sure that the commands to rebuild the file would actually succeed. Also, note that no file outside the current project will be deleted.
-
-.. warning::
-  この方法を何も考えずに実行するのではなく、慎重に考えてください。このルールはプロジェクトで作られるであろう *すべてのファイル* を消去してしまいます。言いかえると、この方法は消去されたファイルのリビルドが成功するかどうかについては、まったく考慮していません。また、この方法では現在のプロジェクトの外にあるファイルは消去されません。
-
-::
-  
-    .PHONY: distclean
-
-    distclean:
-        rm $(filter-proper-targets $(ls R, .))
-
-.. If you use CVS, you may wish to utilize the cvs_realclean program that is distributed with OMake in order to create a “distclean” rule that would delete all the files thare are not known to CVS. For example, if you already have a more traditional “clean” target defined in your project, and if you want the “distclean” rule to be interactive by default, you can write the following:
-
-もしあなたがCVSを用いているのであれば、CVSに知らせずにすべてのファイルを消去する ``distclean`` ルールを作るのではなく、OMakeによって作られた ``cvs_realclean`` プログラムを作りたいと思うことでしょう。例えば、もしあなたが既によく使われている ``clean`` ターゲットを作っていたのなら、そしてあなたが ``distclean`` ルールをデフォルトでインタラクティブなものにしたいのであれば、以下のように記述することができます。 ::
-
-    if $(not $(defined FORCE_REALCLEAN))
-        FORCE_REALCLEAN = false
-        export
-
-    distclean: clean
-        cvs_realclean $(if $(FORCE_REALCLEAN), -f) -i .omakedb -i .omakedb.lock
-
-.. You can add more files that you want to always keep (such as configuration files) with the -i option.
-
-あなたは ``-i`` オプションを用いることで、いつでも保持していたいより多くのファイル(設定ファイルなど)を追加することができます。
-
-.. Similarly, if you use Subversion, you utilize the build/svn_realclean.om script that comes with OMake:
-
-同様に、Subversionを使っていた場合、OMakeでは ``build/svn_realclean.om`` スクリプトを用いて以下のように記述できます。 ::
-
-    if $(not $(defined FORCE_REALCLEAN))
-        FORCE_REALCLEAN = false
-        export
-
-    open build/svn_realclean
-
-    distclean: clean
-        svn_realclean $(if $(FORCE_REALCLEAN), -f) -i .omakedb -i .omakedb.lock
-
-.. See also the dependencies-proper function for an alternate method for removing intermediate files. 
-
-中間ファイルを除去する別の方法についての詳細は、 ``dependencies-proper`` 関数を参照してください。
-
-.. index::
-   single: find-targets-in-path()
-   single: find-targets-in-path-optional()
-.. _label10.3.4:
-
-10.3.4 find-targets-in-path, find-targets-in-path-optional
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-::
-
-    $(find-targets-in-path path files) : File Array
-    $(find-targets-in-path-optional path, files) : File Array
-        path : Dir Array
-        files : File Sequence
-
-.. The find-target-in-path function searches for targets in the search path. For each file file in the file list, the path is searched sequentially for a directory dir such that the target dir/file exists. If so, the file dir/file is returned.
-
-``find-target-in-path`` 関数はパス上のターゲットを検索します。指定された各々の ``file`` はディレクトリ ``dir`` を順番に検索していき、ターゲット ``dir/file`` が存在していた場合はファイル ``dir/file`` が返されます。
-
-.. For example, suppose you are building a C project, and project contains a subdirectory src/ containing only the files fee.c and foo.c. The following expression evaluates to the files src/fee.o src/foo.o even if the files have not already been built.
-
-例えば、あなたはCのプロジェクトをビルドしようとしており、そのプロジェクトはサブディレクトリ ``src/`` を含んでおり、その中には ``fee.c`` と ``foo.c`` が含まれているものとしましょう。そのような場合、以下の式はたとえそのファイルが存在していなくても、 ``src/fee.o src/foo.o`` と評価されます。 ::
-
-    $(find-targets-in-path lib src, fee.o foo.o)
-
-    # このように評価されます。
-    src/fee.o src/foo.o
-
-.. The find-targets-in-path function raises an exception if the file can't be found. The find-targets-in-path-optional function silently removes targets that can't be found.
-
-``find-targets-in-path`` 関数はファイルが見つからない場合には例外を送出します。一方で、 ``find-targets-in-path-optional`` 関数はこの様な場合、例外を送出せずに結果から取り除かれます。 ::
-
-    $(find-targets-in-path-optional lib src, fee.o foo.o fum.o)
-
-    # このように評価されます。
-    src/fee.o src/foo.o
-
-.. index::
-   single: find-ocaml-targets-in-path-optional()
-.. _label10.3.5:
-
-10.3.5 find-ocaml-targets-in-path-optional
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-.. The find-ocaml-targets-in-path-optional function is very similar to the find-targets-in-path-optional one, except an OCaml-style search is used, where for every element of the search path and for every name being searched for, first the uncapitalized version is tried and if it is not buildable, then the capitalized version is tried next. 
-
-``find-ocaml-targets-in-path-optional`` 関数は ``find-targets-in-path-optional`` と似ていますが、この関数はパス上のすべての成分と名前を検索し、最初に小文字のバージョンがビルド可能であるか調べた後で、大文字のバージョンがビルド可能であるか調べる、OCamlスタイルの検索が使われます。
-
-.. index::
-   single: file-sort()
-.. _label10.3.6:
-
-10.3.6 file-sort
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-::
-
-   $(file-sort order, files) : File Sequence
-      order : String
-      files : File Sequence
-
-.. The file-sort function sorts a list of filenames by build order augmented by a set of sort rules. Sort rules are declared using the .ORDER target. The .BUILDORDER defines the default order.
-
-``file-sort`` 関数はソートルールの集合を用いてビルドのソート順を指定することで、ファイル名のリストをソートします。ソートルールは ``.ORDER`` ターゲットを用いて宣言できます。 ``.BUILDORDER`` は通常のソート順が定義されています。 ::
-
-  $(file-sort <order>, <files>)
-
-.. For example, suppose we have the following set of rules.
-
-例えば、以下のようなルールの集合を考えてみましょう。 ::
-
-   a: b c
-   b: d
-   c: d
-
-   .DEFAULT: a b c d
-      echo $(file-sort .BUILDORDER, a b c d)
-
-.. In the case, the sorter produces the result d b c a. That is, a target is sorted after its dependencies. The sorter is frequently used to sort files that are to be linked by their dependencies (for languages where this matters).
-
-このような場合、 ``file-sort`` 関数の結果は ``d b c a`` となります。これは依存関係が生成した *後で* ターゲットがソートされることを表しています。この関数は依存関係がリンクされてあるファイルをソートする際(依存関係が問題となってくる言語を扱う場合)、頻繁に用いられます。
-
-.. There are three important restrictions to the sorter:
-
-この関数は3つの重要な制約があります。
-
-..  * The sorter can be used only within a rule body. The reason for this is that all dependencies must be known before the sort is performed.
-    * The sorter can only sort files that are buildable in the current project.
-    * The sorter will fail if the dependencies are cyclic. 
-
-* この関数はルールの内容だけを使ってソートします。理由としては、ソートを実行する前に *すべての* 依存関係を知っておかなければならないからです。
-* この関数は現在のプロジェクトでビルド可能なファイルのみをソートします。
-* この関数は依存関係が輪状(cyclic)になっている場合、失敗します。
-
-.. index::
-   single: ソートルール
-   single: .ORDER
-.. _label10.3.6.1:
-
-10.3.6.1 ソートルール
-"""""""""""""""""""""""""""""""""""
-.. It is possible to further constrain the sorter through the use of sort rules. A sort rule is declared in two steps. The target must be listed as an .ORDER target; and then a set of sort rules must be given. A sort rule defines a pattern constraint.
-
-ソートルールを使用することで、 ``file-sort`` 関数にさらなる制限を加えることができます。ソートルールは2つの手順を用いて宣言します。まず、ターゲットは ``.ORDER`` ターゲットに加えなければなりません。次に、ソートルールの集合が与えられていなければなりません。ソートルールには制限(pattern constraint)を定義します。 ::
-
-   .ORDER: .MYORDER
-
-   .MYORDER: %.foo: %.bar
-   .MYORDER: %.bar: %.baz
-
-   .DEFAULT: a.foo b.bar c.baz d.baz
-      echo $(sort .MYORDER, a.foo b.bar c.baz d.baz)
-
-.. In this example, the .MYORDER sort rule specifies that any file with a suffix .foo should be placed after any file with suffix .bar, and any file with suffix .bar should be placed after a file with suffix .baz.
-
-この例では、 ``.MYORDER`` ソートルールは、拡張子 ``.foo`` の任意のファイルは拡張子 ``.bar`` の任意のファイルの後に置く必要があり、さらに拡張子 ``.bar`` の任意のファイルは拡張子 ``.baz`` の任意のファイルの後に置く必要があることを指定しています。
-
-.. In this example, the result of the sort is d.baz c.baz b.bar a.foo.
-
-この例では、ソート結果は ``d.baz c.baz b.bar a.foo`` となります。
-
-.. index::
-   single: file-check-sort()
-.. _label10.3.7:
-
-10.3.7 file-check-sort
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-::
-
-   file-check-sort(files)
-      files : File Sequence
-   raises RuntimeException
-
-.. The file-check-sort function checks whether a list of files is in sort order. If so, the list is returned unchanged. If not, the function raises an exception.
-
-``file-check-sort`` 関数はファイルのリストがソート順になっているかどうか調べます。もしそうならば、リストは変更されずに返されます。そうでない場合は、この関数は例外を送出します。 ::
-
-    $(file-check-sort <order>, <files>)
-
-.. _label10.4:
-
-10.4 ファイルの検索とリスト
-----------------------------------
-.. OMake commands are “glob-expanded” before being executed. That is, names may contain patterns that are expanded to sequences of file and directory names. The syntax follows the standard bash(1), csh(1), syntax, with the following rules.
-
-OMakeのコマンドは実行される前に『glob展開』が行われます。これは、ファイル名にはディレクトリやファイル名のシーケンスに展開された *パターン* を含めることができることを意味しています。構文は標準的なbash(1), csh(1)や以下のルールに従っています。
-
-.. # A pathname is a sequence of directory and file names separated by one of the / or \ characters. For example, the following pathnames refer to the same file: /home/jyh/OMakefile and /home\jyh/OMakefile.
-   # Glob-expansion is performed on the components of a path. If a path contains occurrences of special characters (listed below), the path is viewed as a pattern to be matched against the actual files in the system. The expansion produces a sequence of all file/directory names that match.
-
-* パス名は ``/`` か ``\`` の文字によって分割された、ディレクトリやファイル名から成るシーケンスです。例えば、2つのパス名 ``/home/jyh/OMakefile`` , ``/home\jyh/OMakefile`` は同一のファイルを表しています。
-* Glob展開はパスの文字を元にして実行されます。もしパスが下記の特殊文字を含んでいた場合、パスはシステム上の実際にあるファイルに対してマッチしているものだけがリストされます。この展開によって、パターン文字はマッチしたすべてのファイルやディレクトリのシーケンスに展開されます。
-
-.. For the following examples, suppose that a directory /dir contains files named a, -a, a.b, and b.c.
-
-以下、ディレクトリ ``/dir`` にはファイル ``a`` , ``-a`` , ``a.b`` , ``b.c`` が含まれているものとします。
-
-* ``*`` : 0以上の文字を持つ任意のシーケンスにマッチします。例えば、パターン ``/dir/a*`` は ``/dir/a /dir/aa /dir/a.b`` に展開されます。
-
-.. Matches any sequence of zero-or-more characters. For example, the pattern /dir/a* expands to /dir/a /dir/aa /dir/a.b.
-
-* ``?`` : 任意の一つの文字にマッチします。パターン ``/dir/?a`` は ``/dir/-a`` に展開されます。
-
-.. Matches exactly one character. The pattern /dir/?a expands the filename /dir/-a.
-
-* ``[...]`` : 大括弧の中には文字の集合や、ASCII文字の範囲を指定します。パターンには独立な文字 c や文字の範囲 c1-c2 を含めます。パターンのマッチには任意の文字や任意の範囲を指定することができます。 ``^`` をつけることで与えられたパターンを反転(指定した文字を含んでいないとマッチする)できます。また、パターンの中に ``-`` を含めたい場合、パターンの最初の文字に ``-`` と指定しなければなりません。
-
-  =================== ========================================
-  パターン             展開
-  =================== ========================================
-  ``/dir/[a-b]*``     ``/dir/a /dir/a.b /dir/b.c``
-  ``dir/[-a-b]*``     ``/dir/a /dir/-a /dir/a.b /dir/b.c``
-  ``/dir/[-a]*``      ``/dir/a /dir/-a /dir/a.b``
-  =================== ========================================
-
-.. Square brackets denote character sets and ranges in the ASCII character set. The pattern may contain individual characters c or character ranges c1-c2. The pattern matches any of the individual characters specified, or any characters in the range. A leading “hat” inverts the send of the pattern. To specify a pattern that contains the literal characters -, the - should occur as the first character in the range.
-
-* ``{s1,...,sN}`` : 中括弧の中にはコンマによって分割された文字列のシーケンスを指定します。N個の文字列が与えられていた場合、結果はN個のパターンのコピーが生成されて、各々の文字列はsiとなります。
-
-  ===================== ========================================
-  パターン               展開
-  ===================== ========================================
-  ``a{b,c,d}``          ``ab ac ad``
-  ``a{b{c,d},e}``       ``abc abd ae``
-  ``a{?{[A-Z],d},*}``   ``a?[A-Z] a?d a*``
-  ===================== ========================================
-    
-  チルダ(~)はホームディレクトリを指定する際に用いられます。この値はあなたのシステムに依存して展開されます。
-  
-  =================== ========================================
-  パターン             展開
-  =================== ========================================
-  ``~jyh``            ``/home/jyh``
-  ``~bob/*.c``        ``c:\Documents and Settings\users\bob``
-  =================== ========================================
-  
-  ``\`` 文字はパス名のセパレータとしても、文字をエスケープするのにも使われます。もし特殊blob文字の前に用いられていた場合、 ``\`` は次の文字を一種の特殊でない文字に変形します。さもなければ、 ``\`` はパス名のセパレータとして解釈されます。
-  
-  =========================== ==================================================================
-  パターン                     展開
-  =========================== ==================================================================
-  ``~jyh/\*``                 ``~jyh/*`` (``*`` は文字通り扱われる)
-  ``/dir/\[a-z?``             ``/dir/[a-z?`` ( ``[`` は文字通り、 ``?`` はパターンとして扱われる)
-  ``c:\Program Files\[A-z]``  ``c:\Program Files[A-z]*``
-  =========================== ==================================================================
-
-  .. note::
-    最後の ``\`` 文字に関するケースは非常に曖昧です。 ``\`` はパス名のセパレータとして扱うべきで、 ``[`` をエスケープするために用いるのではありません。もしあなたがWin32上でこのような解釈を避けたいとするならば、たとえWin32のパス名であっても ``/`` を用いるべきです( ``/`` は ``\`` に変換されて出力されます)。
-  
-  ============================= ===============================================
-  パターン                       展開
-  ============================= ===============================================
-  ``c:/Program Files/[A-z]*``   ``c:\Program Files\WindowsUpdate ...``
-  ============================= ===============================================
-
-.. Braces indicate brace-expansion. The braces delimit a sequence of strings separated by commas. Given N strings, the result produces N copies of the pattern, one for each of the strings si.
-   The tilde is used to specify home directories. Depending on your system, these might be possible expansions.
-   The \ character is both a pathname separator and an escape character. If followed by a special glob character, the \ changes the sense of the following character to non-special status. Otherwise, \ is viewed as a pathname separator.
-   Note that the final case might be considered to be ambiguous (where \ should be viewed as a pathname separator, not as an escape for the subsequent [ character. If you want to avoid this ambiguity on Win32, you should use the forward slash / even for Win32 pathnames (the / is translated to \ in the output).
-
-.. index::
-   single: glob()
-.. _label10.4.1:
-
-10.4.1 glob
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-::
-
-   $(glob strings) : Node Array
-      strings : String Sequence
-   $(glob options, strings) : Node Array
-      options : String
-      strings : String Sequence
-
-.. The glob function performs glob-expansion.
-
-``glob`` 関数はglob展開を行います。
-
-.. The . and .. entries are always ignored.
-
-``.`` と ``..`` エントリは常に無視されます。
-
-.. The options are
-
-オプションは以下です。
-
-* **b**
-  
-  .. Do not perform csh(1)-style brace expansion. 
-  
-  csh(1)スタイルの大括弧展開を行いません。
-
-* **e**
-  
-  .. The \ character does not escape special characters. 
-  
-  ``\`` 文字を特殊文字にエスケープしません。
-
-* **n**
-  
-  .. If an expansion fails, return the expansion literally instead of aborting. 
-  
-  展開が失敗した場合、無視する代わりに展開を文字通り返します。
-
-* **i**
-  
-  .. If an expansion fails, it expands to nothing. 
-  
-  展開が失敗した場合、何も行いません。
-
-* **.**
-  
-  .. Allow wildcard patterns to match files beginning with a . 
-  
-  .から始まるファイルにマッチする、ワイルドカードパターンを許可します。
-
-* **A**
-  
-  .. Return all files, including files that begin with a . 
-  
-  .から始まるファイルを含んだ、すべてのファイルを返します。
-
-* **F**
-  
-  .. Match only normal files (any file that is not a directory). 
-  
-  通常のファイルのみ(ディレクトリでない任意のファイル)にマッチします。
-
-* **D**
-  
-  .. Match only directory files. 
-  
-  ディレクトリファイルのみにマッチします。
-
-* **C**
-  
-  .. Ignore files according to cvs(1) rules. 
-  
-  cvs(1)ルールに関するファイルを無視します。
-
-* **P**
-  
-  .. Include only proper subdirectories. 
-  
-  適切なサブディレクトリのみを含みます。
-
-.. In addition, the following variables may be defined that affect the behavior of glob.
-
-加えて、以下の変数が ``glob`` の動作に影響を与えるように定義されています。
-
-* **GLOB_OPTIONS**
-  
-  .. A string containing default options. 
-  
-  デフォルトのオプションを定義している文字列
-
-* **GLOB_IGNORE**
-  
-  .. A list of shell patterns for filenames that glob should ignore. 
-  
-  ``glob`` が無視すべき、ファイル名のシェルパターンのリスト
-
-* **GLOB_ALLOW**
-  
-  .. A list of shell patterns. If a file does not match a pattern in GLOB_ALLOW, it is ignored. 
-  
-  シェルパターンのリスト。ファイルが ``GLOB_ALLOW`` のパターンにマッチしなかった場合、そのファイルは無視されます。
-
-.. The returned files are sorted by name. 
-
-また、返されるファイルは名前順でソートされます。
-
-.. index::
-   single: ls()
-.. _label10.4.2:
-
-10.4.2 ls 
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-::
-
-   $(ls files) : Node Array
-      files : String Sequence
-   $(ls options, files) : Node Array
-      files : String Sequence
-
-.. The ls function returns the filenames in a directory.
-
-``ls`` 関数はディレクトリからファイル名を返します。
-
-.. The . and .. entries are always ignored. The patterns are shell-style patterns, and are glob-expanded.
-
-``.`` と ``..`` エントリは常に無視されます。パターンにはシェルライクなパターンを指定することで、 ``ls`` 関数はglob展開を行います。
-
-.. The options include all of the options to the glob function, plus the following.
-
-オプションは ``glob`` 関数のオプションをすべて含んでいるほかに、以下のオプションが含まれています。
-
-.. Perform a recursive listing. 
-
-* **R** : ディレクトリを再帰的に走査し、リストします。
-
-.. The GLOB_ALLOW and GLOB_IGNORE variables can be defined to control the globbing behavior. The returned files are sorted by name. 
-
-``GLOB_ALLOW`` と ``GLOB_IGNORE`` 変数はglob検索の動作を制御するために定義されています。また、返り値は名前によってソートされます。
-
-.. index::
-   single: subdirs()
-.. _label10.4.3:
-
-10.4.3 subdirs
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-::
-
-   $(subdirs dirs) : Dir Array
-      dirs : String Sequence
-   $(subdirs options, dirs) : Dir Array
-      options : String
-      dirs : String Sequence
-
-.. The subdirs function returns all the subdirectories of a list of directories, recursively.
-
-``subdirs`` 関数はディレクトリのリストに存在している、すべてのサブディレクトリを再帰的に返します。
-
-.. The possible options are the following: 
-
-とりうることのできるオプションは以下に定義されています。
-
-.. Return directories that begin with a . 
-   Ignore files according to .cvsignore rules. 
-   Include only proper subdirectories. 
-
-* **A** : aから始まるディレクトリを返します。
-* **C** : .cvsignoreルールに基づいて、特定のファイルを無視します。
-* **P** : 適切なサブディレクトリのみを含めます。
-
-.. _label10.5:
-
-10.5 ファイル操作
-----------------------------------
-
-.. index::
-   single: mkdir()
-.. _label10.5.1:
-
-10.5.1 mkdir
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-::
-
-   mkdir(mode, node...)
-      mode : Int
-      node : Node
-   raises RuntimeException
-
-   mkdir(node...)
-      node : Node
-   raises RuntimeException
-
-.. The mkdir function creates a directory, or a set of directories. The following options are supported. 
-
-``mkdir`` 関数はディレクトリかディレクトリの集合を生成します。以下のオプションがサポートされています。
-
-.. Specify the permissions of the created directory. 
-   Create parent directories if they do not exist. 
-   Interpret the remaining names literally. 
-
-* **-m** mode : 作られるディレクトリのパーミッションを指定します。
-* **-p** : もし親のディレクトリが存在しない場合は、新しく生成します。
-* **\–** : この文字の後にくる文字列を、たとえ特殊文字が含まれていても文字通りに解釈します。
-
-.. index::
-   single: Stat
-.. _label10.5.2:
-
-10.5.2 Stat
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-.. The Stat object represents an information about a filesystem node, as returned by the stat and lstat functions. It contains the following fields.
-
-``stat`` や ``lstat`` 関数によって返される ``Stat`` オブジェクトはファイルシステムノードについての情報を提供します。このオブジェクトは以下のフィールドを含んでいます。
-
-.. the device number. 
-   the inode number. 
-   the kind of the file, one of the following: REG (regular file), DIR (directory), CHR (character device), BLK (block device), LNK (symbolic link), FIFO (named pipe), SOCK (socket). 
-   access rights, represented as an integer. 
-   number of links. 
-   user id of the owner. 
-   group id of the file's group. 
-   device minor number. 
-   size in bytes. 
-   last access time, as a floating point number. 
-   last modification time, as a floating point number. 
-   last status change time, as a floating point number. 
-
-* **dev** : デバイス番号
-* **ino** : inode番号
-* **king** : ファイルの種類を表し、以下の内の一つが指定されています: ``REG`` (通常のファイル), ``DIR`` (ディレクトリ), ``CHR`` (キャラクタデバイス), ``BLK`` (ブロックデバイス), ``LNK`` (シンボリックリンク), ``FIFO`` (名前付きパイプ), ``SOCK`` (ソケット)
-* **perm** : アクセス権。数値で表現されます。
-* **nlink** : リンクの数
-* **uid** : オーナーのユーザーID
-* **gid** : ファイルのグループのグループID
-* **rdev** : デバイスのマイナー番号
-* **size** :  ファイルのバイト数
-* **atime** : アクセス日時。浮動小数点で表現されます。
-* **mtime** : 修正日時。浮動小数点で表現されます。
-* **ctime** : ステータス変更日時。浮動小数点で表現されます。
-
-.. Not all of the fields will have meaning on all operating systems.
-
-すべてのフィールドがすべてのOS上で意味をもつわけではない点に注意してください。
-
-.. index::
-   single: stat()
-   single: lstat()
-.. _label10.5.3:
-
-10.5.3 stat, lstat
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-::
-
-    $(stat node...) : Stat
-       node : Node or Channel
-    $(lstat node...) : Stat
-       node : Node or Channel
-    raises RuntimeException
-
-.. The stat functions return file information. If the file is a symbolic link, the stat function refers to the destination of the link; the lstat function refers to the link itself. 
-
-``stat`` 関数はファイル情報を返します。もしファイルがシンボリックリンクであった場合は、 ``stat`` 関数はリンク先を参照します。一方で、 ``lstat`` 関数はリンク自身を参照します。
-
-.. index::
-   single: unlink()
-.. _label10.5.4:
-
-10.5.4 unlink
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-::
-
-   $(unlink file...)
-      file : File
-   #(rm file...)
-      file : File
-   $(rmdir dir...)
-      dir : Dir
-   raises RuntimeException
-
-.. The unlink and rm functions remove a file. The rmdir function removes a directory.
-
-``unlink`` と ``rm`` 関数はファイルを削除します。 ``rmdir`` 関数はディレクトリを削除します。
-
-.. The following options are supported for rm and rmdir. 
-
-``rm`` および ``rmdir`` 関数は以下のオプションをサポートしています。
-
-.. ignore nonexistent files, never prompt. 
-   prompt before removal. 
-   remove the contents of directories recursively. 
-   explain what is going on. 
-   the rest of the values are interpreted literally. 
-
-* **-f** : 存在しないファイルを確認なしで無視します。
-* **-i** : 消去する前に確認します。
-* **-r** : ディレクトリの内容を再帰的に削除します。
-* **-v** : どのような処理を行っているのかを出力します。
-* **\-** : この文字の後に来る値は文字通りに解釈されます。 
-
-.. index::
-   single: rename()
-   single: mv()
-   single: cp()
-.. _label10.5.5:
-
-10.5.5 rename
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-::
-
-    rename(old, new)
-       old : Node
-       new : Node
-    mv(nodes... dir)
-       nodes : Node Sequence
-       dir   : Dir
-    cp(nodes... dir)
-       nodes : Node Sequence
-       dir   : Dir
-    raises RuntimeException
-
-.. The rename function changes the name of a file or directory named old to new.
-
-``rename`` 関数はファイルかディレクトリの名前を ``old`` から ``new`` に変更します。
-
-.. The mv function is similar, but if new is a directory, and it exists, then the files specified by the sequence are moved into the directory. If not, the behavior of mv is identical to rename. The cp function is similar, but the original file is not removed.
-
-``mv`` 関数は似ていますが、もし ``new`` がディレクトリでかつ存在している場合、シーケンスによって指定されたファイルはディレクトリの中に移動されます。そうでない場合、 ``mv`` の動作は ``rename`` と全く同じです。 ``cp`` 関数は似ていますが、この関数はオリジナルのファイルを消去しません。
-
-.. The mv and cp functions take the following options. 
-
-``mv`` と ``cp`` 関数は以下のオプションをとります。
-
-.. Do not prompt before overwriting. 
-   Prompt before overwriting. 
-   Explain what it happening. 
-   Copy the contents of directories recursively.
-   Interpret the remaining arguments literally. 
-
-* **-f** : 上書きする前の確認を行いません。
-* **-i** : 上書きする前に確認します。
-* **-v** : どのような処理を行っているのか出力します。
-* **-r** : ディレクトリの内容を再帰的にコピーします。
-* **\-** : この文字の後に来る引数は文字通りに解釈されます。
-
-.. index::
-   single: link()
-.. _label10.5.6:
-
-10.5.6 link
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-::
-
-   link(src, dst)
-      src : Node
-      dst : Node
-   raises RuntimeException
-
-.. The link function creates a hard link named dst to the file or directory src.
-
-``link`` 関数はファイルやディレクトリ ``src`` へのハードリンクを ``dst`` に生成します。
-
-.. Hard links may work under Win32 when NTFS is used.
-
-ハードリンクはNTFSを用いていた場合は、Win32システム上でも正常に動作します。
-
-.. Normally, only the superuser can create hard links to directories. 
-
-通常、スーパーユーザだけがディレクトリへのハードリンクを生成できます。
-
-.. index::
-   single: symlink()
-.. _label10.5.7:
-
-10.5.7 symlink
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-::
-
-   symlink(src, dst)
-      src : Node
-      dst : Node
-   raises RuntimeException
-
-.. The symlink function creates a symbolic link dst that points to the src file.
-
-``symlink`` 関数は ``src`` ファイルへのシンボリックリンクを ``dst`` に生成します。
-
-.. The link name is computed relative to the target directory. For example, the expression $(symlink a/b, c/d) creates a link named c/d -> ../a/b.
-
-リンク名はターゲットのディレクトリに合わせて計算されます。例えば、式 ``$(symlink a/b, c/d)`` は ``c/d -> ../a/b`` というリンクが生成されます。
-
-.. Symbolic links are not supported in Win32. Consider using the ln-or-cp Shell alias for cross-platform portable linking/copying.
-
-シンボリックリンクはWin32上ではサポートされていません。もしクロスプラットフォームでリンク/コピーを行いたい場合は ``ln-or-cp`` か ``Shell`` エイリアスを使用してください。
-
-.. index::
-   single: readlink()
-.. _label10.5.8:
-
-10.5.8 readlink
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-::
-
-   $(readlink node...) : Node
-      node : Node
-
-.. The readlink function reads the value of a symbolic link. 
-
-``readlink`` 関数はシンボリックリンクの値を読み取ります。
-
-.. index::
-   single: chmod()
-.. _label10.5.9:
-
-10.5.9 chmod
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-::
-
-   chmod(mode, dst...)
-      mode : Int
-      dst : Node or Channel
-   chmod(mode dst...)
-      mode : String
-      dst : Node Sequence
-   raises RuntimeException
-
-.. The chmod function changes the permissions of the targets.
-
-``chmod`` 関数は対象のパーミッションを変更します。
-
-オプション:
-
-.. Explain what is happening. 
-   Change files and directories recursively. 
-   Continue on errors. 
-   Interpret the remaining argument literally. 
-
-* **-v** : どのような処理を行っているのか説明します。
-* **-r** : ファイルやディレクトリを再帰的に変更します。
-* **-f** : エラーが生じても続けて実行します。
-* **\-** : 残りの引数を文字通りに解釈します。
-
-.. index::
-   single: chown()
-.. _label10.5.10:
-
-10.5.10 chown
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-::
-
-   chown(uid, gid, node...)
-      uid : Int
-      gid : Int
-      node : Node or Channel
-   chown(uid, node...)
-      uid : Int
-      node : Node or Channel
-   raises RuntimeException
-
-.. The chown function changes the user and group id of the file. If the gid is not specified, it is not changed. If either id is -1, that id is not changed. 
-
-``chown`` 関数はファイルのユーザやグループIDを変更します。もし ``gid`` が指定されていない場合は、値は変更されません。IDが-1であった場合でも、そのIDは変更されません。
-
-.. index::
-   single: truncate()
-.. _label10.5.11:
-
-10.5.11 truncate 
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-::
-
-   truncate(length, node...)
-       length : Int
-       node : Node or Channel
-   raises RuntimeException
-
-.. The truncate function truncates a file to the given length. 
-
-``truncate`` 関数はファイルを与えられた長さに切り詰めます。
-
-.. index::
-   single: umask()
-.. _label10.5.12:
-
-10.5.12 umask
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-::
-
-    $(umask mode) : Int
-       mode : Int
-    raises RuntimeException
-
-.. Sets the file mode creation mask. The previous mask is returned. This value is not scoped, changes have global effect.
-
-ファイル生成マスクを設定します。この関数は前回のマスクの値が返されます。この値はスコープ化されていませんので、この変更はグローバルに影響を及ぼします。
-
-.. _label10.6:
-
-10.6 vmount
-----------------------------------
-
-.. index::
-   single: vmount()
-.. _label10.6.1:
-
-10.6.1 vmount
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-::
-
-    vmount(src, dst)
-       src, dst : Dir
-    vmount(flags, src, dst)
-       flags : String
-       src, dst : Dir
-
-.. “Mount” the src directory on the dst directory. This is a virtual mount, changing the behavior of the $(file ...) function. When the $(file str) function is used, the resulting file is taken relative to the src directory if the file exists. Otherwise, the file is relative to the current directory.
-
-``src`` ディレクトリを ``dst`` ディレクトリに『マウント』します。これは仮想的なマウントで、 ``$(file ...)`` 関数のふるまいを変更します。 ``$(file str)`` が使われた場合、返される値はもしファイルが存在していたら ``src`` ディレクトリに関連付けられます。さもなければファイルは現在のディレクトリに関連付けられます。
-
-.. The main purpose of the vmount function is to support multiple builds with separate configurations or architectures.
-
-``vmount`` 関数の主な目的は、分割された設定やアーキテクチャを用いて、複数のビルドを行うことをサポートするためです。
-
-.. The options are as follows. 
-
-オプションは以下の通りです。
-
-.. Create symbolic links to files in the src directory. 
-   Copy files from the src directory. 
-
-* **l** : ``src`` ディレクトリ中のファイルへのシンボリックリンクを生成します。
-* **c** : ``src`` ディレクトリからファイルをコピーします。
-
-.. Mount operations are scoped. 
-
-なお、マウント操作はスコープ化されています。
-
-.. index::
-   single: add-project-directories()
-.. _label10.6.2:
-
-10.6.2 add-project-directories
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-::
-
-    add-project-directories(dirs)
-       dirs : Dir Array
-
-.. Add the directories to the set of directories that omake considers to be part of the project. This is mainly used to avoid omake complaining that the current directory is not part of the project. 
-
-omakeがプロジェクトの一部とみなしているディレクトリの集合に、ディレクトリを新しく追加します。これは主に、現在のディレクトリがプロジェクトの一部でないとomakeがエラーを出すことを避けるために用いられます。
-
-.. index::
-   single: remove-project-directories()
-.. _label10.6.3:
-
-10.6.3 remove-project-directories
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-::
-
-    remove-project-directories(dirs)
-       dirs : Dir Array
-
-.. Removed the directories from the set of directories that omake considers to be part of the project. This is mainly used to cancel a .SUBDIRS from including a directory if it is determined that the directory does not need to be compiled. 
-
-omakeがプロジェクトの一部とみなしているディレクトリの集合から、ディレクトリを削除します。これは主に、特定のディレクトリがコンパイルされる必要がないことが分かっているので、インクルードしているディレクトリから ``.SUBDIRS`` を取り消すような場合に用いられます。
-
-.. _label10.7:
-
-10.7 ファイルの内容を元にした検索
-----------------------------------
-
-.. index::
-   single: test()
-.. _label10.7.1:
-
-10.7.1 test
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-::
-
-   test(exp) : Bool
-      exp : String Sequence
-
-.. The expression grammar is as follows:
-
-評価式の文法は以下の通りです。
-
-.. expression is not true 
-   both expressions are true 
-   at least one expression is true 
-   expression is true 
-
-* ``!`` exp : expは真でない
-* exp1 ``-a`` exp2 : 両方のexpが真である
-* exp1 ``-o`` exp2 : 1以上のexpが真である
-* (exp) : expは真である
-
-.. The base expressions are
-
-基本となる評価式は以下の通りです。
-
-.. The string has nonzero length 
-   The string has zero length 
-   The strings are equal 
-   The strings are not equal
-   The integers are equal 
-   The integers are not equal 
-   int1 is larger than int2
-   int2 is not larger than int1
-   int1 is smaller than int2
-   int1 is not larger than int2
-   On Unix, file1 and file2 have the same device and inode number. On Win32, file1 and file2 have the same name.
-   file1 is newer than file2
-   file1 is older than file2
-   The file is a block special file
-   The file is a character special file 
-   The file is a directory 
-   The file exists 
-   The file is a normal file 
-   The set-group-id bit is set on the file
-   The file's group is the current effective group
-   The file is a symbolic link (also -L) 
-   The file's sticky bit is set 
-   The file is a symbolic link (also -h) 
-   The file's owner is the current effective user 
-   The file is a named pipe 
-   The file is readable 
-   The file is empty 
-   The file is a socket 
-   The set-user-id bit is set on the file 
-   The file is writable 
-   The file is executable 
-   
-* ``-n`` str : *文字列* は0でない長さである
-* ``-z`` str : *文字列* は0の長さである
-* str ``=`` str : 両方の文字列は等しい
-* str ``!=`` str : 両方の文字列は等しくない
-* int1 ``-eq`` int2 : 両方の整数は等しい
-* int1 ``-ne`` int2 : 両方の整数は等しくない
-* int1 ``-gt`` int2 : int1はint2よりも大きい(int1 > int2)
-* int1 ``-ge`` int2 : int1はint2以上である(int1 >= int2)
-* int1 ``-gt`` int2 : int1はint2よりも小さい(int1 < int2)
-* int1 ``-le`` int2 : int1はint2以下である(int1 <= int2)
-* file1 ``-ef`` file2 : Unix上では、file1とfile2は同一のデバイスとinode番号である。Win32上では、file1とfile2は同一の名前である。
-* file1 ``-nt`` file2 : file1はfile2よりも新しい
-* file1 ``-ot`` file2 : file1はfile2よりも古い
-* ``-b`` file : fileはブロック型特殊ファイルである
-* ``-c`` file : fileはキャラクタ型特殊ファイルである
-* ``-d`` file : fileはディレクトリである
-* ``-e`` file : fileが実在している
-* ``-f`` file : fileは通常のファイルである
-* ``-g`` file : ``set-group-id`` bitがfileに設定されている 
-* ``-G`` file : fileのグループIDが現在影響を受けているグループである
-* ``-h`` file : fileがシンボリックリンクである(``-L`` でもよい)
-* ``-k`` file : fileにスティッキー・ビットが設定されている
-* ``-L`` file : fileがシンボリックリンクである(``-h`` でもよい)
-* ``-O`` file : fileのオーナーが現在影響を受けているグループである
-* ``-p`` file : fileが名前付きパイプである
-* ``-r`` file : fileが読み込み可能である
-* ``-s`` file : fileは空である
-* ``-S`` file : fileはソケットである
-* ``-u`` file : ``set-user-id`` bitがfileに設定されている
-* ``-w`` file : fileは書き込み可能である
-* ``-x`` file : fileは実行可能である
-
-.. A string is any sequence of characters; leading - characters are allowed.
-
-*str* は任意の文字列で、 ``-`` 文字をつけることができます。
-
-.. An int is a string that can be interpreted as an integer. Unlike traditional versions of the test program, the leading characters may specify an arity. The prefix 0b means the numbers is in binary; the prefix 0o means the number is in octal; the prefix 0x means the number is in hexadecimal. An int can also be specified as -l string, which evaluates to the length of the string.
-
-*int* は整数として解釈できる文字列です。従来の ``test`` プログラムのバージョンとは異なり、先頭の文字にはアリティを指定することもできます。接頭辞 ``0b`` は数値をバイナリで扱います。同様に、接頭辞 ``0o`` は数値を8進数で扱い、接頭辞 ``0x`` は数値を16進数で扱います。 *int* は ``-l`` を用いることで数値を文字列として扱うことができます。これによって、数値ではなく文字列の長さが評価されます。
-
-.. A file is a string that represents the name of a file.
-
-*file* はファイル名を表す文字列です。
-
-.. The syntax mirrors that of the test(1) program. If you are on a Unix system, the man page explains more. Here are some examples.
-
-構文は ``test(1)`` プログラムと似ています。もしあなたがUnixのシステム上にいるのならば、manを参照すればさらに詳細を説明してくれるでしょう。以下にいくつかのサンプルを挙げておきます。 ::
-
-    # 空のファイルを作成
-    osh> touch foo
-    # ファイルは空ですか?
-    osh> test(-e foo)
-    - : true
-    osh> test(! -e foo)
-    - : false
-    # 別のファイルを作成
-    osh> touch boo
-    # 新しく作ったファイルは前よりも新しいですか?
-    osh> test(boo -nt foo)
-    - : true
-    # さらに複雑な式を示します。
-    # booはfooよりも新しく、さらにfooは空である。
-    osh> test(\( boo -nt foo \) -a -e foo)
-    - : true
-
-.. index::
-   single: find()
-.. _label10.7.2:
-
-10.7.2 find
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-::
-
-   find(exp) : Node Array
-      exp : String Sequence
-
-.. The find function searches a directory recursively, returning the files for which the expression evaluates to true.
-
-``find`` 関数はディレクトリを再帰的に検索し、 ``exp`` の評価が真であるファイルを返します。
-
-.. The expression argument uses the same syntax as the test function, with the following exceptions.
-
-引数の ``exp`` は以下の例外を除いて、 ``test`` 関数と同じ構文を用いています。
-
-..   1. The expression may begin with a directory. If not specified, the current directory is searched.
-     2. The {} string expands to the current file being examined. 
-
-1. ``exp`` はディレクトリから始まります。もし特に指定していない場合はカレントディレクトリから検索します。
-2. ``{}`` 文字は現在のファイルを表す文字に拡張されています。
-
-.. The syntax of the expression is the same as test, with the following additions.
-
-``exp`` の構文は ``test`` 関数のそれと同一ですが、以下の点が加わっています。
-
-..  * -name string : The current file matches the glob expression (see Section 10.4).
-    * -regex string : The current file matches the regular expression 
-
-* ``-name`` str : 現在のファイルはglob表現にマッチしている(詳細は ":ref:`label10.4`" を参照してください)。
-* ``-regex`` str : 現在のファイルは正規表現にマッチしている。
-
-.. The find function performs a recursive scan of all subdirectories. The following call is being run from the root of the omake source directory.
-
-``find`` 関数はすべてのサブディレクトリを再帰的にスキャンします。以下の関数呼び出しは ``omake`` のソースディレクトリのルートから実行させています。 ::
-
-    osh> find(. -name fo* )
-    - : <array
-            /home/jyh/.../omake/mk/.svn/format
-            /home/jyh/.../omake/RPM/.svn/format
-            ...
-            /home/jyh/.../omake/osx_resources/installer_files/.svn/format>
-
-.. Another example, listing only those files that are normal files or symbolic links.
-
-別の例では、通常のファイルかシンボリックリンクのファイルのみを並べています。 ::
-
-    osh> find(. -name fo* -a \( -f {} -o -L {} \))
-    - : <array
-            /home/jyh/.../omake/mk/.svn/format
-            /home/jyh/.../omake/RPM/.svn/format
-            ...
-            /home/jyh/.../omake/osx_resources/installer_files/.svn/format>
-
-.. _label10.8:
-
-10.8 I/O 関数
-----------------------------------
-
-.. index::
-   single: stdin
-   single: stdout
-   single: stderr
-.. _label10.8.1:
-
-10.8.1 標準出力先
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-.. The following variables define the standard channels.
-
-以下の変数が標準出力先として定義されています。
-
-* **stdin** ::
-  
-    stdin : InChannel
-  
-  .. The standard input channel, open for reading.
-  
-  標準入力チャネルで、読み込みを担当します。
-
-* **stdout** ::
-  
-    stdout : OutChannel
-  
-  .. The standard output channel, open for writing.
-  
-  標準出力チャネルで、書き込みを担当します。
-
-* **stderr** ::
-  
-    stderr : OutChannel
-  
-  .. The standard error channel, open for writing. 
-  
-  標準エラーチャネルで、書き込みを担当します。
-
-.. index::
-   single: open-in-string()
-.. _label10.8.2:
-
-10.8.2 open-in-string
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-.. The open-in-string treats a string as if it were a file and returns a channel for reading.
-
-``open-in-string`` 関数は文字列をまるでファイルのように扱い、読み込むためのチャネルを返します。 ::
-
-   $(open-in-string s) : Channel
-       s : String
-
-.. index::
-   single: open-out-string()
-   single: out-contents()
-.. _label10.8.3:
-
-10.8.3 open-out-string, out-contents
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-.. The open-out-string creates a channel that writes to a string instead of a file. The string may be retrieved with the out-contents function.
-
-``open-out-string`` 関数はファイルの代わりに文字列を書き込むチャネルを作成します。文字列は ``out-contents`` 関数を用いて取得することができます。 ::
-
-   $(open-out-string) : Channel
-   $(out-contents chan) : String
-       chan : OutChannel
-
-.. index::
-   single: fopen()
-.. _label10.8.4:
-
-10.8.4 fopen
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-.. The fopen function opens a file for reading or writing.
-
-``fopen`` 関数はファイルを読み書きするために、新しくファイルを開きます。 ::
-
-   $(fopen file, mode) : Channel
-      file : File
-      mode : String
-
-.. The file is the name of the file to be opened. The mode is a combination of the following characters.
-
-``file`` は読み書きするファイル名を指定します。 ``mode`` は以下の文字を組み合わせた文字列です。
-
-.. Open the file for reading; it is an error if the file does not exist. 
-   Open the file for writing; the file is created if it does not exist. 
-   Open the file in append mode; the file is created if it does not exist. 
-   Open the file for both reading and writing. 
-   Open the file in text mode (default). 
-   Open the file in binary mode. 
-   Open the file in nonblocking mode. 
-   Fail if the file already exists. 
-
-* **r** : 読み込むためにファイルを開きます。もしファイルが存在していない場合はエラーが発生します。
-* **w** : 書き込むためにファイルを開きます。もしファイルが存在していない場合は新しくファイルを作ります。
-* **a** : 追記モードでファイルを開きます。もしファイルが存在していない場合は新しくファイルを作ります。
-* **+** : 読み書き両方するためにファイルを開きます。
-* **t** : ファイルをテキストモードで開きます(デフォルト)。
-* **b** : ファイルをバイナリモードで開きます。
-* **n** : ファイルをノンブロッキングモードで開きます。
-* **x** : ファイルが既に存在している場合は失敗します。
-
-.. Binary mode is not significant on Unix systems, where text and binary modes are equivalent. 
-
-Unixシステム上ではバイナリモードは意味を持たず、テキストモードとバイナリモードは等価に扱われます。
-
-.. index::
-   single: close()
-.. _label10.8.5:
-
-10.8.5 close
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-::
-
-    $(close channel...)
-       channel : Channel
-
-.. The close function closes a file that was previously opened with fopen. 
-
-``close`` 関数は以前に ``fopen`` によって開かれたファイルを閉じる関数です。
-
-.. index::
-   single: read()
-   single: input-line()
-.. _label10.8.6:
-
-10.8.6 read, input-line
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-::
-
-   $(read channel, amount) : String
-   $(input-line channel) : String
-      channel : InChannel
-      amount  : Int
-   raises RuntimeException
-
-.. The read function reads up to amount bytes from an input channel, and returns the data that was read. The input-line function reads a line from the file and returns the line read, without the line terminator. If an end-of-file condition is reached, both functions raise a RuntimeException exception. 
-
-``read`` 関数は ``amount`` バイトを入力チャネルから読み込み、読み込んだデータを返します。 ``input-line`` 関数はファイルから一行を読み込み、読み込んだ一行を改行コード抜きで返します。もしファイルの終わりまでたどり着いた場合、両方の関数は例外 ``RuntimeException`` を送出します。
-
-.. index::
-   single: write()
-.. _label10.8.7:
-
-10.8.7 write
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-::
-
-   $(write channel, buffer, offset, amount) : String
-      channel : OutChannel
-      buffer  : String
-      offset  : Int
-      amount  : Int
-   $(write channel, buffer) : String
-      channel : OutChannel
-      buffer  : String
-   raises RuntimeException
-
-.. In the 4-argument form, the write function writes bytes to the output channel channel from the buffer, starting at position offset. Up to amount bytes are written. The function returns the number of bytes that were written.
-
-4つ引数をとる場合、 ``write`` 関数は出力チャネル ``channel`` に位置 ``offset`` から、バイト ``buffer`` を書き込みます。なお、上限は ``amount`` バイトです。この関数は何バイトが書き込まれたのかというバイト数を返します。
-
-.. The 3-argument form is similar, but the offset is 0.
-
-3つ引数をとる場合も同様ですが、 ``offset`` は0となります。
-
-.. In the 2-argument form, the offset is 0, and the amount if the length of the buffer.
-
-2つ引数をとる場合、 ``offset`` は0で、かつ ``amount`` は ``buffer`` の長さになります。
-
-.. If an end-of-file condition is reached, the function raises a RuntimeException exception. 
-
-ファイルの終わりまでたどり着いた場合、この関数は例外 ``RuntimeException`` を送出します。
-
-.. index::
-   single: lseek()
-.. _label10.8.8:
-
-10.8.8 lseek
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-::
-
-    $(lseek channel, offset, whence) : Int
-       channel : Channel
-       offset  : Int
-       whence  : String
-    raises RuntimeException
-
-.. The lseek function repositions the offset of the channel channel according to the whence directive, as follows:
-
-``lseek`` 関数はチャネル ``channel`` のオフセット位置を ``whence`` に基づいて変更します。 ``whence`` は以下の通りです。
-
-.. The offset is set to offset. 
-   The offset is set to its current position plus offset bytes. 
-   The offset is set to the size of the file plus offset bytes. 
-
-* **SEEK_SET** : オフセットは ``offset`` に設定されます。
-* **SEEK_CUR** : オフセットは現在の位置から ``offset`` バイト分移動します。
-* **SEEK_END** : オフセットはファイルサイズ + ``offset`` バイトの位置に設定されます。
-
-.. The lseek function returns the new position in the file. 
-
-``lseek`` 関数はファイルの新しいオフセット位置を返します。
-
-.. index::
-   single: rewind()
-.. _label10.8.9:
-
-10.8.9 rewind
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-::
-
-   rewind(channel...)
-      channel : Channel
-
-.. The rewind function set the current file position to the beginning of the file. 
-
-``rewind`` 関数は現在のファイル位置をファイルが始まる位置に設定します。
-
-.. index::
-   single: tell()
-.. _label10.8.10:
-
-10.8.10 tell
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-::
-
-    $(tell channel...) : Int...
-       channel : Channel
-    raises RuntimeException
-
-.. The tell function returns the current position of the channel. 
-
-``tell`` 関数は ``channel`` の現在位置を返します。
-
-.. index::
-   single: flush()
-.. _label10.8.11:
-
-10.8.11 flush
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-::
-
-   $(flush channel...)
-      channel : OutChannel
-
-.. The flush function can be used only on files that are open for writing. It flushes all pending data to the file. 
-
-``flush`` 関数は書き込み用途にファイルが開かれている場合のみに使われます。この関数はファイルにまだ書き込まれていないすべてのデータを消去します。
-
-.. index::
-   single: channel-name()
-.. _label10.8.12:
-
-10.8.12 channel-name
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-::
-
-   $(channel-name channel...) : String
-      channel : Channel
-
-.. The channel-name function returns the name that is associated with the channel. 
-
-``channel-name`` 関数はチャネルに関係している名前を返します。
-
-.. index::
-   single: dup()
-.. _label10.8.13:
-
-10.8.13 dup
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-::
-
-    $(dup channel) : Channel
-       channel : Channel
-    raises RuntimeException
-
-.. The dup function returns a new channel referencing the same file as the argument. 
-
-``dup`` 関数は引数に指定されたチャネルと同一のファイルを示している、新しいチャネルを返します。
-
-.. index::
-   single: dup2()
-.. _label10.8.14:
-
-10.8.14 dup2
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-::
-
-   dup2(channel1, channel2)
-      channel1 : Channel
-      channel2 : Channel
-   raises RuntimeException
-
-.. The dup2 function causes channel2 to refer to the same file as channel1. 
-
-``dup2`` 関数は ``channel2`` を ``channel1`` と同一のファイルを示すようにします。
-
-.. index::
-   single: set-nonblock()
-.. _label10.8.15:
-
-10.8.15 set-nonblock 
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-::
-
-   set-nonblock-mode(mode, channel...)
-      channel : Channel
-      mode : String
-
-.. The set-nonblock-mode function sets the nonblocking flag on the given channel. When IO is performed on the channel, and the operation cannot be completed immediately, the operations raises a RuntimeException. 
-
-``set-nonblock-mode`` 関数は与えられたチャネルのノンブロッキングフラグを設定します。もしチャネルが入出力中で、この操作が即座に完了しないような場合、 ``RuntimeException`` が送出されます。
-
-.. index::
-   single: set-close-on-exec-mode()
-.. _label10.8.16:
-
-10.8.16 set-close-on-exec-mode
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-.. The set-close-on-exec-mode function sets the close-on-exec flags for the given channels. If the close-on-exec flag is set, the channel is not inherited by child processes. Otherwise it is.
-
-``set-close-on-exec-mode`` 関数は与えられたチャネルのclose-on-execフラグを設定します。もしclose-on-execフラグが設定されている場合、このチャネルは子プロセスから継承されません。そうでない場合は、このチャネルは子プロセスから継承されます。
-
-.. index::
-   single: pipe()
-.. _label10.8.17:
-
-10.8.17 pipe 
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-::
-
-   $(pipe) : Pipe
-   raises RuntimeException
-
-.. The pipe function creates a Pipe object, which has two fields. The read field is a channel that is opened for reading, and the write field is a channel that is opened for writing. 
-
-``pipe`` 関数は2つのフィールドを持つ ``Pipe`` オブジェクトを生成します。 ``read`` フィールドは読み込むためのチャネルで、 ``write`` フィールドは書き込むためのチャネルです。
-
-.. index::
-   single: mkfifo()
-.. _label10.8.18:
-
-10.8.18 mkfifo
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-::
-
-   mkfifo(mode, node...)
-      mode : Int
-      node : Node
-
-.. The mkfifo function creates a named pipe. 
-
-``mkfifo`` 関数は名前付きパイプを生成します。
-
-.. index::
-   single: select()
-.. _label10.8.19:
-
-10.8.19 select 
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-::
-
-   $(select rfd..., wfd..., efd..., timeout) : Select
-      rfd : InChannel
-      wfd : OutChannel
-      efd : Channel
-      timeout : float
-   raises RuntimeException
-
-.. The select function polls for possible IO on a set of channels. The rfd are a sequence of channels for reading, wfd are a sequence of channels for writing, and efd are a sequence of channels to poll for error conditions. The timeout specifies the maximum amount of time to wait for events.
-
-``select`` 関数は与えられたチャネルの集合が入出力可能であるか監視します。 ``rfd`` には読み込み可能なチャネルのシーケンスを指定します。 ``wfd`` には書き込み可能なチャネルのシーケンスを指定します。 ``efd`` にはエラー状態を監視するチャネルのシーケンスを指定します。 ``timeout`` にはイベントを待つ最大時間を指定します。
-
-.. On successful return, select returns a Select object, which has the following fields: 
-
-正常な戻り値の場合、 ``select`` 関数は以下のフィールドを持つ ``Select`` オブジェクトを返します。
-
-.. An array of channels available for reading. 
-   An array of channels available for writing. 
-   An array of channels on which an error has occurred. 
-
-* **read** : 読み込み可能なチャネルの配列
-* **write** : 書き込み可能なチャネルの配列
-* **error** : エラーが生じたチャネルの配列
-
-.. index::
-   single: lockf()
-.. _label10.8.20:
-
-10.8.20 lockf
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-::
-
-    lockf(channel, command, len)
-       channel : Channel
-       command : String
-       len : Int
-    raises RuntimeException
-
-.. The lockf function places a lock on a region of the channel. The region starts at the current position and extends for len bytes.
-
-``lockf`` 関数は与えられたチャネルのPOSIXロックの範囲を設定します。範囲は現在の位置から ``len`` バイトまでです。
-
-.. The possible values for command are the following. 
-
-``command`` のとりうる値は以下の通りです。
-
-.. Unlock a region. 
-   Lock a region for writing; block if already locked. 
-   Lock a region for writing; fail if already locked. 
-   Test a region for other locks. 
-   Lock a region for reading; block if already locked. 
-   Lock a region for reading; fail is already locked. 
-
-* **F_ULOCK** : 指定された範囲をアンロックします。
-* **F_LOCK** : 指定された範囲を書き込みロックします。既にロックされている場合はブロックされます。
-* **F_TLOCK** : 指定された範囲を書き込みロックします。既にロックされている場合は失敗します。
-* **F_TEST** : 指定された範囲に他のロックがないか試します。
-* **F_RLOCK** : 指定された範囲を読み込みロックします。既にロックされている場合はブロックされます。
-* **F_TRLOCK** : 指定された範囲を読み込みロックします。既にロックされている場合は失敗します。
-
-.. index::
-   single: InetAddr
-.. _label10.8.21:
-
-10.8.21 InetAddr
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-.. The InetAddr object describes an Internet address. It contains the following fields.
-
-``InetAddr`` オブジェクトはインターネットアドレスを記述しています。このオブジェクトは以下のフィールドを含んでいます。
-
-.. the Internet address. 
-   the port number. 
-
-* **addr** -> ``String`` : インターネットアドレス
-* **port** -> ``Int`` : ポート番号
-
-.. index::
-   single: Host
-.. _label10.8.22:
-
-10.8.22 Host
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-.. A Host object contains the following fields.
-
-``Host`` オブジェクトは以下のフィールドを含んでいます。
-
-.. the name of the host. 
-   other names by which the host is known. 
-   the preferred socket domain. 
-   an array of Internet addresses belonging to the host. 
-
-* **name** -> ``String`` : ホスト名
-* **aliases** -> ``String Array`` : ホストの別名の配列
-* **addrtype** -> ``String`` : より好ましいドメイン・ソケット
-* **addrs** -> ``InetAddr Array`` : ホストに所属しているインターネットアドレスの配列
-
-.. index::
-   single: gethostbyname()
-.. _label10.8.23:
-
-10.8.23 gethostbyname
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-::
-
-   $(gethostbyname host...) : Host...
-      host : String
-   raises RuntimeException
-
-.. The gethostbyname function returns a Host object for the specified host. The host may specify a domain name or an Internet address.
-
-``gethostbyname`` 関数は指定されたホストの ``Host`` オブジェクトを返します。 ``host`` にはドメイン名かインターネットアドレスを指定します。
-
-.. index::
-   single: Protocol
-.. _label10.8.24:
-
-10.8.24 Protocol 
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-.. The Protocol object represents a protocol entry. It has the following fields.
-
-``Protocol`` オブジェクトはプロトコルエントリーを表現します。このオブジェクトは以下のフィールドを含んでいます。
-
-.. the canonical name of the protocol. 
-   aliases for the protocol. 
-   the protocol number. 
-
-* **name** -> ``String`` : 正規のプロトコル名
-* **aliases** -> ``String Array`` : プロトコルのエイリアスの配列
-* **proto** -> ``Int`` : プロトコル番号
-
-.. index::
-   single: getprotobyname()
-.. _label10.8.25:
-
-10.8.25 getprotobyname
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-::
-
-   $(getprotobyname name...) : Protocol...
-      name : Int or String
-   raises RuntimeException
-
-.. The getprotobyname function returns a Protocol object for the specified protocol. The name may be a protocol name, or a protocol number. 
-
-``getprotobyname`` 関数は指定されたプロトコルから ``Protocol`` オブジェクトを返します。 ``name`` にはプロトコル名かプロトコル番号を指定します。
-
-.. index::
-   single: Service
-.. _label10.8.26:
-
-10.8.26 Service
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-.. The Service object represents a network service. It has the following fields.
-
-``Service`` オブジェクトはネットワークサービスを表現します。このオブジェクトは以下のフィールドを含んでいます。
-
-.. the name of the service. 
-   aliases for the service. 
-   the port number of the service. 
-   the protocol for the service. 
-
-* **name** -> ``String`` : サービス名
-* **aliases** -> ``String Array`` : サービスのエイリアスの配列
-* **port** -> ``Int`` : サービスのポート番号
-* **proto** -> ``Protocol`` : サービスのプロトコル
-
-.. index::
-   single: getservbyname()
-.. _label10.8.27:
-
-10.8.27 getservbyname 
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-::
-
-   $(getservbyname service...) : Service...
-      service : String or Int
-   raises RuntimeException
-
-.. The getservbyname function gets the information for a network service. The service may be specified as a service name or number. 
-
-``getservbyname`` 関数はネットワークサービスの情報を取得します。 ``service`` にはサービス名か番号を指定します。
-
-.. index::
-   single: socket()
-.. _label10.8.28:
-
-10.8.28 socket
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-::
-
-   $(socket domain, type, protocol) : Channel
-      domain : String
-      type : String
-      protocol : String
-   raises RuntimeException
-
-.. The socket function creates an unbound socket.
-
-``socket`` 関数は束縛されていないソケットを生成します。
-
-.. The possible values for the arguments are as follows.
-
-引数のとりうる値は以下の通りです。
-
-.. The domain may have the following values. 
-
-``domain`` は以下の値をとります。
-
-.. Unix domain, available only on Unix systems. 
-   Internet domain, IPv4. 
-   Internet domain, IPv6. 
-
-* **PF_UNIX** あるいは **unix** : Unixシステムでのみ利用可能なUnixドメイン
-* **PF_INET** あるいは **inet** : IPv4インターネットドメイン
-* **PF_INET6** あるいは **inet6** : IPv6インターネットドメイン
-
-.. The type may have the following values. 
-
-``type`` は以下の値をとります。
-
-.. Stream socket. 
-   Datagram socket. 
-   Raw socket. 
-   Sequenced packets socket 
-
-* **SOCK_STREAM** あるいは **stream** : ストリームソケット
-* **SOCK_DGRAM** あるいは **dgram** : データグラムソケット
-* **SOCK_RAW** あるいは **raw** : 生(raw)ソケット
-* **SOCK_SEQPACKET** あるいは **seqpacket** : パケットシーケンスソケット
-
-.. The protocol is an Int or String that specifies a protocol in the protocols database. 
-
-``protocol`` はプロトコルのデータベースにあるプロトコルを指定した ``Int`` か ``String`` 型の引数です。
-
-.. index::
-   single: bind()
-.. _label10.8.29:
-
-10.8.29 bind 
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-::
-
-   bind(socket, host, port)
-      socket : InOutChannel
-      host : String
-      port : Int
-   bind(socket, file)
-      socket : InOutChannel
-      file : File
-   raise RuntimeException
-
-.. The bind function binds a socket to an address.
-
-``bind`` 関数はソケットをアドレスに束縛します。
-
-.. The 3-argument form specifies an Internet connection, the host specifies a host name or IP address, and the port is a port number.
-
-3つ引数をとる場合、 ``bind`` 関数はインターネットの接続方法について指定し、 ``host`` にはホスト名かIPアドレスを、 ``port`` にはポート番号を指定します。
-
-.. The 2-argument form is for Unix sockets. The file specifies the filename for the address.
-
-2つ引数をとる形は ``Unix`` ソケットのために用意されています。 ``file`` にはファイル名のアドレスを指定します。
-
-.. index::
-   single: listen()
-.. _label10.8.30:
-
-10.8.30 listen 
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-::
-
-   listen(socket, requests)
-      socket : InOutChannel
-      requests : Int
-   raises RuntimeException
-
-.. The listen function sets up the socket for receiving up to requests number of pending connection requests. 
-
-``listen`` 関数は ``requests`` 個のまだ取得されていないリクエストを取得するように、ソケットを設定します。
-
-.. index::
-   single: accept()
-.. _label10.8.31:
-
-10.8.31 accept
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-::
-
-   $(accept socket) : InOutChannel
-      socket : InOutChannel
-   raises RuntimeException
-
-.. The accept function accepts a connection on a socket. 
-
-``accept`` 関数はソケットの接続を受け入れます。
-
-.. index::
-   single: connect()
-.. _label10.8.32:
-
-10.8.32 connect
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-::
-
-    connect(socket, addr, port)
-       socket : InOutChannel
-       addr : String
-       port : int
-    connect(socket, name)
-       socket : InOutChannel
-       name : File
-    raise RuntimeException
-
-.. The connect function connects a socket to a remote address.
-
-``connect`` 関数はソケットを対象のアドレスに接続します。
-
-.. The 3-argument form specifies an Internet connection. The addr argument is the Internet address of the remote host, specified as a domain name or IP address. The port argument is the port number.
-
-3つ引数をとる場合、 ``connect`` 関数はインターネットの接続方法について指定します。 ``addr`` にはリモートホストのインターネットアドレスをドメイン名かIPアドレスの形で指定します。 ``port`` にはポート番号を指定します。
-
-.. The 2-argument form is for Unix sockets. The name argument is the filename of the socket. 
-
-2つ引数をとる形はUnixソケットのために用意されています。 ``name`` にはソケットのファイル名を指定します。
-
-.. index::
-   single: getchar()
-.. _label10.8.33:
-
-10.8.33 getchar
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-::
-
-    $(getc) : String
-    $(getc file) : String
-       file : InChannel or File
-    raises RuntimeException
-
-.. The getc function returns the next character of a file. If the argument is not specified, stdin is used as input. If the end of file has been reached, the function returns false. 
-
-``getc`` 関数はファイルの次の文字を返します。もし引数が指定されなかった場合、 ``stdin`` が入力として用いられます。もしファイルの終わりまでたどりついた場合、この関数は ``false`` を返します。
-
-.. index::
-   single: gets()
-.. _label10.8.34:
-
-10.8.34 gets
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-::
-
-   $(gets) : String
-   $(gets channel) : String
-      channel : InChannel or File
-   raises RuntimeException
-
-.. The gets function returns the next line from a file. The function returns the empty string if the end of file has been reached. The line terminator is removed. 
-
-``gets`` 関数はファイルから次の行を返します。この関数はファイルの終わりまでたどり着いていた場合、空の文字列を返します。改行コードは取り除かれます。
-
-.. index::
-   single: fgets()
-.. _label10.8.35:
-
-10.8.35 fgets 
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-::
-
-   $(fgets) : String
-   $(fgets channel) : String
-      channel : InChannel or File
-   raises RuntimeException
-
-.. The fgets function returns the next line from a file that has been opened for reading with fopen. The function returns the empty string if the end of file has been reached. The returned string is returned as literal data. The line terminator is not removed. 
-
-``fgets`` 関数は ``fopen`` によって読み込みが開かれているファイルから、次の行を返します。この関数はファイルの終わりまでたどり着いていた場合、空の文字列を返します。返される文字列は文字通りのデータ(literal data)として返されます。改行コードは取り除かれません。
-
-.. index::
-   single: fprint()
-   single: print()
-   single: eprint()
-   single: fprintln()
-   single: println()
-   single: eprintln()
-.. _label10.9:
-
-10.9 出力関数
-----------------------------------
-.. Output is printed with the print and println functions. The println function adds a terminating newline to the value being printed, the print function does not.
-
-``print`` と ``println`` 関数を用いて出力を表示します。 ``println`` 関数は表示する値に新しく改行コードを加えます。 ``print`` 関数は加えません。 ::
-    fprint(<file>, <string>)
-    print(<string>)
-    eprint(<string>)
-    fprintln(<file>, <string>)
-    println(<string>)
-    eprintln(<string>)
-
-.. The fprint functions print to a file that has been previously opened with fopen. The print functions print to the standard output channel, and the eprint functions print to the standard error channel. 
-
-``fprint`` 関数は ``fopen`` で開かれたファイルに対して出力します。 ``print`` 関数は標準出力チャネルに対して出力しますが、 ``eprint`` 関数は標準エラーチャネルに対して出力します。
-
-.. index::
-   single: fprintv()
-   single: printv()
-   single: eprintv()
-   single: fprintvln()
-   single: printvln()
-   single: eprintvln()
-.. _label10.10:
-
-10.10 値を出力する関数
-----------------------------------
-.. Values can be printed with the printv and printvln functions. The printvln function adds a terminating newline to the value being printed, the printv function does not.
-
-値は ``printv`` と ``printvln`` 関数を用いて表示できます。 ``printvln`` 関数は表示する値に新しく改行コードを加えます。 ``printv`` 関数は加えません。 ::
-
-    fprintv(<file>, <string>)
-    printv(<string>)
-    eprintv(<string>)
-    fprintvln(<file>, <string>)
-    printvln(<string>)
-    eprintvln(<string>)
-
-.. The fprintv functions print to a file that has been previously opened with fopen. The printv functions print to the standard output channel, and the eprintv functions print to the standard error channel. 
-
-``fprinv`` 関数は ``fopen`` で開かれたファイルに対して出力します。 ``printv`` 関数は標準出力チャネルに対して出力しますが、 ``eprintv`` 関数は標準エラーチャネルに対して出力します。
-
-.. _label10.10.1:
-
-10.10.1 その他の関数 
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-.. index::
-   single: set-channel-line()
-.. _label10.10.1.1:
-
-10.10.1.1 set-channel-line
-""""""""""""""""""""""""""""""""""
-::
-
-    set-channel-line(channel, filename, line)
-        channel : Channel
-        filename : File
-        line : int
-
-.. Set the line number information for the channel. 
-
-指定されたチャネルの行番号情報を設定します。
-
-.. _label10.11:
-
-10.11 高レベルな I/O 関数
-----------------------------------
-
-.. index::
-   single: 正規表現
-   single: awk()
-.. _label10.11.1:
-
-10.11.1 正規表現
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-.. Many of the higher-level functions use regular expressions. Regular expressions are defined by strings with syntax nearly identical to awk(1).
-
-多くの高レベルな関数では正規表現を使用しています。正規表現はawk(1)の構文とだいたい似ている文字列から成り立っています。
-
-.. Strings may contain the following character constants.
-
-文字列には以下の文字定数を含めることができます。
-
-.. a literal backslash. 
-   the alert character ^G. 
-   the backspace character ^H. 
-   the formfeed character ^L. 
-   the newline character ^J. 
-   the carriage return character ^M. 
-   the tab character ^I. 
-   the vertical tab character. 
-   the character represented by the string of hexadecimal digits h. All valid hexadecimal digits following the sequence are considered to be part of the sequence. 
-   the character represented by 1, 2, or 3 octal digits. 
-
-* ``\\`` : バックスラッシュ文字
-* ``\a`` : アラート文字 ``^G``
-* ``\b`` : バックスペース文字 ``^H``
-* ``\f`` : 改ページ文字 ``^L``
-* ``\n`` : 改行文字 ``^J``
-* ``\r`` : キャリッジリターン(復帰,CR)文字 ``^M``
-* ``\t`` : タブ文字 ``^I``
-* ``\v`` : 垂直タブ文字
-* ``\xhh...`` : 16進数として表現される文字列 ``h`` 。すべての正しい16進数文字列はシーケンス文字列の一部として扱われます。
-* ``\ddd`` : 1〜3桁の8進数として扱われる文字列
-
-.. Regular expressions are defined using the special characters .\^$[(){}*?+.
-
-正規表現は特殊文字 ``.\^$[(){}*?+`` を使うことができます。
-
-.. matches the literal character c if c is not a special character. 
-   matches the literal character c, even if c is a special character. 
-   matches any character, including newline.
-   matches the beginning of a line. 
-   matches the end of line. 
-   matches any of the characters abc...
-   matches any character except abc...
-   matches either r1 or r2. 
-   matches r1 and then r2. 
-   matches one or more occurrences of r. 
-   matches zero or more occurrences of r. 
-   matches zero or one occurrence of r. 
-   parentheses are used for grouping; matches r. 
-   also defines grouping, but the expression matched within the parentheses is available to the output processor through one of the variables $1, $2, ... 
-   matches exactly n occurrences of r. 
-   matches n or more occurrences of r. 
-   matches at least n occurrences of r, and no more than m occurrences. 
-   matches the empty string at either the beginning or end of a word. 
-   matches the empty string within a word. 
-   matches the empty string at the beginning of a word. 
-   matches the empty string at the end of a word. 
-   matches any character in a word. 
-   matches any character that does not occur within a word.
-   matches the empty string at the beginning of a file. 
-   matches the empty string at the end of a file. 
-   
-* ``c`` : ``c`` が特殊文字でない場合は文字通りに扱います。
-* ``\c`` : ``c`` が特殊文字であっても、 ``c`` を文字通りに扱います。
-* ``.`` : 改行を含む、任意の文字にマッチします。
-* ``^`` : 行の始めにマッチします。
-* ``$`` : 行の終わりにマッチします。
-* ``[abc...]`` :  ``abc...`` の任意の文字にマッチします。
-* ``[^abc...]`` : ``abc...`` を除く、任意の文字にマッチします。
-* ``r1|r2`` : ``r1`` と ``r2`` のいづれかであった場合はマッチします。
-* ``r1r2`` : ``r1`` の次に ``r2`` が来ていた場合はマッチします。
-* ``r+`` : 1以上の ``r`` の文字列にマッチします。
-* ``r*`` : 0以上の ``r`` の文字列にマッチします。
-* ``r?`` : 0もしくは1つの ``r`` にマッチします。
-* ``(r)`` : ``r`` にマッチします。括弧はグループ化のために用いられます。
-* ``\(r\)`` : グループとして扱われますが、括弧の中でマッチした式は変数 ``$1`` , ``$2`` , ... を通して参照することができます。
-* ``r{n}`` : ``r`` が正確に ``n`` 回続いている場合はマッチします。
-* ``r{n,}`` : ``r`` が ``n`` 回以上続いている場合はマッチします。
-* ``r{n,m}`` : ``r`` が ``n`` 回以上 ``m`` 回以下続いている場合はマッチします。
-* ``\y`` : 単語の始まりあるいは単語が終わった後の空文字にマッチします。
-* ``\B`` : 単語の中にある空文字にマッチします。
-* ``\<`` : 単語の始まりの空文字にマッチします。
-* ``\>`` : 単語が終わった後のから文字にマッチします。
-* ``\w`` : 単語の任意の文字にマッチします。
-* ``\W`` : 単語の中に入っていない、任意の文字にマッチします。
-* ``\~`` : ファイルの始まりの空文字にマッチします。
-* ``\'`` : ファイルの終わりの空文字にマッチします。
-
-.. Character classes can be used to specify character sequences abstractly. Some of these sequences can change depending on your LOCALE.
-
-上の文字クラスは文字のシーケンスを絶対的に指定するのに用いられます。これらのシーケンスはあなたの言語環境次第で変更することもできます。
-
-* ``[:alnum:]`` : 英数字文字
-* ``[:alpha:]`` : アルファベット文字
-* ``[:lower:]`` : アルファベット小文字
-* ``[:upper:]`` : アルファベット大文字
-* ``[:cntrl:]`` : 制御文字
-* ``[:digit:]`` : 数字
-* ``[:xdigit:]`` : 数字あるいは16進数文字
-* ``[:graph:]`` : 出力可能でかつ表示可能な文字
-* ``[:print:]`` :  出力可能で、表示可能あるいは不可能な文字
-* ``[:punct:]`` : 句読点文字
-* ``[:blank:]`` : スペースかタブ文字
-* ``[:space:]`` : ホワイトスペース文字
-
-.. index::
-   single: cat()
-.. _label10.11.2:
-
-10.11.2 cat
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-::
-
-    cat(files) : Sequence
-       files : File or InChannel Sequence
-
-.. The cat function concatenates the output from multiple files and returns it as a string. 
-
-``cat`` 関数は複数のファイルを連結し、文字列として返します。
-
-.. index::
-   single: grep()
-.. _label10.11.3:
-
-10.11.3 grep 
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-::
-
-   grep(pattern) : String  # stdin から入力されて、デフォルトのオプションが用いられる
-      pattern : String
-   grep(pattern, files) : String  # デフォルトのオプションが用いられる
-      pattern : String
-      files   : File Sequence
-   grep(options, pattern, files) : String
-     options : String
-     pattern : String
-     files   : File Sequence
-
-.. The grep function searches for occurrences of a regular expression pattern in a set of files, and prints lines that match. This is like a highly-simplified version of grep(1).
-
-``grep`` 関数はファイルの集合から正規表現 ``pattern`` に適合しているものを検索し、マッチした行を表示します。これはgrep(1)の高度に簡素化されたバージョンです。
-
-.. The options are
-
-オプションは以下の通りです。
-
-.. If specified, the output from grep is not displayed. 
-   If specified, output lines will not include the filename (default, when only one input file is given). 
-   If specified, output lines include the filename (default, when more than one input file is given). 
-   If specified, search for lines without a match instead of lines with a match, 
-
-* **q** : 指定した場合、 ``grep`` からの出力は表示されません。
-* **h** : 指定した場合、出力された行はファイル名を含めません(一つの入力ファイルだけが与えられた場合のデフォルト)。
-* **n** : 指定した場合、出力された行はファイル名を含めます(複数の入力ファイルが与えられた場合のデフォルト)。
-* **v** : 指定した場合、マッチした行の代わりにマッチしなかった行を出力します。
-
-.. The pattern is a regular expression.
-
-``pattern`` は正規表現です。
-
-.. If successful (grep found a match), the function returns true. Otherwise, it returns false. 
-
-もし成功した ( ``grep`` がマッチした行を見つけた)場合、この関数は ``true`` を返します。そうでない場合は ``false`` を返します。
-
-.. index::
-   single: scan()
-.. _label10.11.4:
-
-10.11.4 scan 
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-::
-
-   scan(input-files)
-   case string1
-      body1
-   case string2
-      body2
-   ...
-   default
-      bodyd
-
-.. The scan function provides input processing in command-line form. The function takes file/filename arguments. If called with no arguments, the input is taken from stdin. If arguments are provided, each specifies an InChannel, or the name of a file for input. Output is always to stdout.
-
-``scan`` 関数はコマンドライン上からの入力機能を提供します。この関数はファイル、あるいはファイル名を引数にとります。もし何も引数が呼ばれなかった場合、 ``stdin`` から入力されます。もし引数が指定された場合、各々の引数には ``InChannel`` が指定されるか、入力としてファイル名が用いられます。なお、出力は常に ``stdout`` です。
-
-.. The scan function operates by reading the input one line at a time, and processing it according to the following algorithm.
-
-``scan`` 関数は入力から一行を読み込み、以下のアルゴリズムに従って処理を行います。
-
-.. For each line, the record is first split into fields, and the fields are bound to the variables $1, $2, .... The variable $0 is defined to be the entire line, and $* is an array of all the field values. The $(NF) variable is defined to be the number of fields.
-
-各々の行で、レコードはまずいくつかのフィールドに分割されて、それらのフィールドは変数 ``$1, $2, ...`` に束縛されます。変数 ``$0`` は行全体として定義されており、 ``$*`` はすべてのフィールドの値が定義されている配列です。 ``$(NF)`` 変数はフィールドの数が定義されています。
-
-.. Next, a case expression is selected. If string_i matches the token $1, then body_i is evaluated. If the body ends in an export, the state is passed to the next clause. Otherwise the value is discarded.
-
-次に ``case`` 文が実行されます。もし ``string_i`` がトークン ``$i`` にマッチした場合、 ``body_i`` が評価されます。もし ``case`` の内容が ``export`` で終わっていたのなら、現在の状態は次の宣言句へ受け継がれます。そうでない場合、この値は捨てられます。
-
-.. For example, here is an scan function that acts as a simple command processor.
-
-例えば、以下の ``scan`` 関数は単純なコマンドプロセッサのように振る舞います。 ::
-
-    calc() =
-       i = 0
-       scan(script.in)
-       case print
-          println($i)
-       case inc
-          i = $(add $i, 1)
-          export
-       case dec
-          i = $(sub $i, 1)
-          export
-       case addconst
-          i = $(add $i, $2)
-          export
-       default
-          eprintln($"Unknown command: $1")
-
-.. The scan function also supports several options.
-
-``scan`` 関数はまたいくつかのオプションをサポートしています。 ::
-
-    scan(options, files)
-    ...
-
-.. Parse each line as an argument list, where arguments may be quoted. For example, the following line has three words, “ls”, “-l”, “Program Files”.
-   Parse each line using white space as the separator, using the usual OMake algorithm for string parsing. This is the default. 
-   Once each line is split, reduce each word using the hex representation. This is the usual hex representation used in URL specifiers, so the string “Program Files” may be alternately represented in the form ProgramProgram+Files. 
-
-* **A** : 各々の行を引数のリストとして、クオート化された状態でパースします。例えば、以下の行は3つのワード "``ls``" , "``-l``" , "``Program Files``" を持つことになります: ``ls -l "Program Files"``
-* **O** : 各々の行を、ホワイトスペースをセパレータとしてパースします。これは通常OMakeが文字列をパースする際のアルゴリズムを使用しています。この動作はデフォルトです。
-* **x** : 各々の行を分割し、さらに16進数表現を用いてワードの個数を減らします。これはURLを指定する際には通常16進数表現が用いられるためです。例えば、文字列 ``Program Files`` は代わりに以下の形 ``Program+Files`` に置き換わります。
-
-.. note::
-  もしあなたが出力をファイルにリダイレクトしたい場合、最も簡単な方法は ``stdout`` 変数を再定義することです。 ``stdout`` 変数は他の変数と同様スコープ化されているので、この再定義は ``calc`` 関数の外にある ``stdout`` には影響を及ぼしていません。 ::
-
-    calc() =
-        stdout = $(fopen script.out, w)
-        scan(script.in)
-           ...
-        close(stdout)
-
-.. index::
-   single: awk()
-.. _label10.11.5:
-
-10.11.5 awk 
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-::
-
-   awk(input-files)
-   case pattern1:
-      body1
-   case pattern2:
-      body2
-   ...
-   default:
-      bodyd
-
-あるいは ::
-
-   awk(options, input-files)
-   case pattern1:
-      body1
-   case pattern2:
-      body2
-   ...
-   default:
-      bodyd
-
-.. The awk function provides input processing similar to awk(1), but more limited. The input-files argument is a sequence of values, each specifies an InChannel, or the name of a file for input. If called with no options and no file arguments, the input is taken from stdin. Output is always to stdout.
-
-``awk`` 関数はawk(1)と似た入力機能を提供します。が、この関数は制限されています。引数 ``input-files`` には値のシーケンスを指定することで、各々の値には ``InChannel`` が指定されるか、入力としてファイル名が用いられます。もしオプションとファイルの引数が何も指定されなかったら、入力は ``stdin`` が用いられます。なお、出力は常に ``stdout`` です。
-
-.. The variables RS and FS define record and field separators as regular expressions. The default value of RS is the regular expression \r|\n|\r\n. The default value of FS is the regular expression [ \t]+.
-
-.. The awk function operates by reading the input one record at a time, and processing it according to the following algorithm.
-
-変数 ``RS`` と ``FS`` にはレコードとフィールドを分割するセパレータが正規表現の形で定義されています。なお、デフォルトの ``RS`` の値は正規表現 ``\r|\n|\r\n`` で、 ``FS`` は ``[ \t]+`` です。
-
-.. For each line, the record is first split into fields using the field separator FS, and the fields are bound to the variables $1, $2, .... The variable $0 is defined to be the entire line, and $* is an array of all the field values. The $(NF) variable is defined to be the number of fields.
-
-``awk`` 関数は入力から一つのレコードを読み込み、以下のアルゴリズムに従って処理を行います。
-
-各々の行で、レコードはまずフィールドセパレータ ``FS`` を用いていくつかのフィールドに分割されて、それらのフィールドは変数 ``$1, $2, ...`` に束縛されます。変数 ``$0`` は行全体として定義されており、 ``$*`` はすべてのフィールドの値が定義されている配列です。変数 ``$(NF)`` はフィールドの数が定義されています。
-
-.. Next, the cases are evaluated in order. For each case, if the regular expression pattern_i matches the record $0, then body_i is evaluated. If the body ends in an export, the state is passed to the next clause. Otherwise the value is discarded. If the regular expression contains \(r\) expression, those expression override the fields $1, $2, ....
-
-次に、 ``case`` が順番どおりに評価されていきます。各々の ``case`` において、もし正規表現 ``pattern_i`` がレコード ``$0`` にマッチしていた場合は、 ``body_i`` が評価されます。もし ``body_i`` が ``export`` で終わっていたのなら、現在の状態は次の宣言句へ受け継がれます。そうでない場合、この値は捨てられます。もし正規表現が ``\(r\)`` を含んでいたのなら、フィールド ``$1, $2, ...`` はこれらの表現で書き換えられます。
-
-.. For example, here is an awk function to print the text between two delimiters \begin{<name>} and \end{<name>}, where the <name> must belong to a set passed as an argument to the filter function.
-
-例えば、以下のコードはテキストが二つのデリミタ ``\begin{<name>}`` と ``\end{<name>}`` の間にあり、さらに ``filter`` 関数の引数として渡された配列の中に ``<name>`` が入っているときだけ、その間のテキストを出力しています。 ::
-
-    filter(names) =
-       print = false
-
-       awk(Awk.in)
-       case $"^\\end\{\([:alpha:]+\)\}"
-          if $(mem $1, $(names))
-             print = false
-             export
-          export
-       default
-          if $(print)
-             println($0)
-       case $"^\\begin\{\([:alpha:]+\)\}"
-          print = $(mem $1, $(names))
-          export
-
-.. Note, if you want to redirect the output to a file, the easiest way is to redefine the stdout variable. The stdout variable is scoped the same way as other variables, so this definition does not affect the meaning of stdout outside the filter function.
-
-.. note::
-  もしあなたが出力をファイルにリダイレクトしたい場合、最も簡単な方法は ``stdout`` 変数を再定義することです。 ``stdout`` 変数は他の変数と同様スコープ化されているので、この再定義は ``filter`` 関数の外にある ``stdout`` には影響を及ぼしていません。 ::
-
-    filter(names) =
-        stdout = $(fopen file.out, w)
-        awk(Awk.in)
-           ...
-        close(stdout)
-
-.. Options. 
-
-オプション :
-
-.. “Break” when evaluating cases. Only the first case that matches will be selected. 
-
-* **b** : ``case`` を評価する際にループを『中断(Break)』します。ただし、複数のマッチ文が選択されるような場合のみです。
-
-.. The break function can be used to abort the loop, exiting the awk function immediately. 
-
-``break`` 関数はループを停止する際に用いられます。これを用いると ``awk`` 関数は即座に中断します。
-
-.. index::
-   single: fsubst()
-.. _label10.11.6:
-
-10.11.6 fsubst 
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-::
-
-   fsubst(files)
-   case pattern1 [options]
-      body1
-   case pattern2 [options]
-      body2
-   ...
-   default
-      bodyd
-
-.. The fsubst function provides a sed(1)-like substitution function. Similar to awk, if fsubst is called with no arguments, the input is taken from stdin. If arguments are provided, each specifies an InChannel, or the name of a file for input.
-
-``fsubst`` 関数は ``sed(1)`` のような置換機能を提供します。 ``awk`` と似ていて、もし ``fsubst`` が何の引数も指定されずに呼び出された場合、入力は ``stdin`` が用いられます。もし引数が与えられていた場合、各々の引数は ``InChannnel`` が指定されるか、入力としてファイル名が用いられます。
-
-.. The RS variable defines a regular expression that determines a record separator, The default value of RS is the regular expression \r|\n|\r\n.
-
-``RS`` 変数はレコードのセパレータを指定する正規表現が定義されており、 ``RS`` のデフォルトの値は ``\r|\n|\r\n`` です。
-
-.. The fsubst function reads the file one record at a time.
-
-``fsubst`` 関数は1回につき1つのレコードを読み込みます。
-
-.. For each record, the cases are evaluated in order. Each case defines a substitution from a substring matching the pattern to replacement text defined by the body.
-
-各々のレコードで、 ``case`` 文は順番どおりに評価されます。各々の ``case`` ではマッチした ``pattern`` を、定義された文字列に置換する機構について定義しています。
-
-.. Currently, there is only one option: g. If specified, each clause specifies a global replacement, and all instances of the pattern define a substitution. Otherwise, the substitution is applied only once.
-
-現在のところ、omakeでは ``g`` オプションだけがサポートされています。指定した場合、各々の宣言句は全体の置換を行い、すべての ``pattern`` のインスタンスによって置換が行われます。そうでない場合、置換は1回だけ行われます。
-
-.. Output can be redirected by redefining the stdout variable.
-
-出力は ``stdout`` 変数を再定義することによってリダイレクトできます。
-
-.. For example, the following program replaces all occurrences of an expression word. with its capitalized form.
-
-例えば、以下のプログラムは ``word`` に適合した文字列すべてを大文字化し、置換します。 ::
-
-    section
-       stdout = $(fopen Subst.out, w)
-       fsubst(Subst.in)
-       case $"\<\([[:alnum:]]+\)\." g
-          value $(capitalize $1).
-       close(stdout)
-
-
-.. index::
-   single: lex()
-.. _label10.11.7:
-
-10.11.7 lex 
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-::
-
-   lex(files)
-   case pattern1
-      body1
-   case pattern2
-      body2
-   ...
-   default
-      bodyd
-
-.. The lex function provides a simple lexical-style scanner function. The input is a sequence of files or channels. The cases specify regular expressions. Each time the input is read, the regular expression that matches the longest prefix of the input is selected, and the body is evaluated.
-
-``lex`` 関数はシンプルな文法解析器を提供します。入力はファイルやチャネルのシーケンスです。 ``case`` には正規表現を指定します。この関数は入力を読み込むたび、 *最も長い接頭辞* にマッチした正規表現を選択し、その内容を評価します。
-
-.. If two clauses both match the same input, the last one is selected for execution. The default case matches the regular expression .; you probably want to place it first in the pattern list.
-
-同じ長さで2つの ``case`` 文がマッチしてしまった場合、 *後ろの* ``case`` 文が実行されます。 ``default`` 文は正規表現 ``.`` にマッチするので、パターンリストの最初に設置するのが恐らく望ましいでしょう。
-
-.. If the body end with an export directive, the state is passed to the next clause.
-
-もし ``case`` の内容が ``export`` で終わっていたのなら、現在の状態は次のループへ受け継がれます。
-
-.. For example, the following program collects all occurrences of alphanumeric words in an input file.
-
-例えば、以下のプログラムは入力されたファイルからすべての英数字を集めます。 ::
-
-    collect-words($(files)) =
-       words[] =
-       lex($(files))
-       default
-          # empty
-       case $"[[:alnum:]]+" g
-          words[] += $0
-          export
-
-.. The default case, if one exists, matches single characters. Since It is an error if the input does not match any of the regular expressions.
-
-``default`` 文が存在する場合、この文は任意の1つの文字のみにマッチします。また、もし入力がどの正規表現にもマッチしなかった場合、この関数はエラーとなります。
-
-.. The break function can be used to abort the loop. 
-
-``break`` 関数はループを停止する際に用いられます。
-
-.. index::
-   single: lex-search()
-.. _label10.11.8:
-
-10.11.8 lex-search 
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-::
-
-   lex-search(files)
-   case pattern1
-      body1
-   case pattern2
-      body2
-   ...
-   default
-      bodyd
-
-.. The lex-search function is like the lex function, but input that does not match any of the regular expressions is skipped. If the clauses include a default case, then the default matches any skipped text.
-
-``lex-search`` 関数は ``lex`` 関数と似ていますが、この関数はどの正規表現にもマッチしなかった入力をスキップします。 ``default`` 文を含んでいた場合、 ``default`` はすべてのスキップしたテキストにマッチします。
-
-.. For example, the following program collects all occurrences of alphanumeric words in an input file, skipping any other text.
-
-例えば、以下のプログラムは入力されたファイルからすべての英数字文字を集め、含まれていない他のテキストはスキップします。 ::
-
-    collect-words($(files)) =
-       words[] =
-       lex-search($(files))
-       default
-          eprintln(Skipped $0)
-       case $"[[:alnum:]]+" g
-          words[] += $0
-          export
-
-.. The default case, if one exists, matches single characters. Since It is an error if the input does not match any of the regular expressions.
-
-``default`` 文が存在する場合、この文は任意の1つの文字のみにマッチします。また、もし入力がどの正規表現にもマッチしなかった場合、この関数はエラーとなります。
-
-.. The break function can be used to abort the loop. 
-
-``break`` 関数はループを停止する際に用いられます。
-
-.. index::
-   single: Lexer
-.. _label10.11.9:
-
-10.11.9 Lexer 
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-.. The Lexer object defines a facility for lexical analysis, similar to the lex(1) and flex(1) programs.
-
-``Lexer`` オブジェクトは容易に字句解析を行えるようにするオブジェクトで、 ``lex(1)`` や ``flex(1)`` プログラムと似ています。
-
-.. In omake, lexical analyzers can be constructed dynamically by extending the Lexer class. A lexer definition consists of a set of directives specified with method calls, and set of clauses specified as rules.
-
-omakeでは、字句の解析は ``Lexer`` クラスを継承することによって動的に構成することができます。字句解析器(以後レキサと呼ぶ)の定義はメソッドを呼び出すことで指示文(directive)を指定しているものの集合と、ルールとして宣言句(clause)を指定しているものの集合によって成り立っています。
-
-.. For example, consider the following lexer definition, which is intended for lexical analysis of simple arithmetic expressions for a desktop calculator.
-
-例えば、以下のシンプルなデスクトップ電卓の演算の字句解析を行う、レキサの定義について考えてみましょう。 ::
-
-   lexer1. =
-      extends $(Lexer)
-
-      other: .
-         eprintln(Illegal character: $* )
-         lex()
-
-      white: $"[[:space:]]+"
-         lex()
-
-      op: $"[-+*/()]"
-         switch $*
-         case +
-            Token.unit($(loc), plus)
-         case -
-            Token.unit($(loc), minus)
-         case *
-            Token.unit($(loc), mul)
-         case /
-            Token.unit($(loc), div)
-         case $"("
-            Token.unit($(loc), lparen)
-         case $")"
-            Token.unit($(loc), rparen)
-
-      number: $"[[:digit:]]+"
-         Token.pair($(loc), exp, $(int $* ))
-
-      eof: $"\'"
-         Token.unit($(loc), eof)
-
-.. This program defines an object lexer1 the extends the Lexer object, which defines lexing environment.
-
-このプログラムは ``Lexer`` オブジェクトから字句解析の環境を定義している ``lexer1`` を継承しています。
-
-.. The remainder of the definition consists of a set of clauses, each with a method name before the colon; a regular expression after the colon; and in this case, a body. The body is optional, if it is not specified, the method with the given name should already exist in the lexer definition.
-
-残りの定義では宣言句の集合の定義を行っています。コロン(:)の前にはメソッド名を指定し、コロンの後には正規表現を指定します。この場合は内容も指定しています。内容はなくても構いません。指定されなかった場合、レキサの定義で既に存在している、与えられたメソッド名が用いられます。
-
-.. NB The clause that matches the longest prefix of the input is selected. If two clauses match the same input prefix, then the last one is selected. This is unlike most standard lexers, but makes more sense for extensible grammars.
-
-.. warning::
-  *最も長い* 接頭辞にマッチした宣言句が選択されます。もし2つの宣言句が同じ長さの場合、 *後ろの* 宣言句が選択されます。これはほとんどの標準的なレキサとな異なっていますが、拡張性から見ればこの仕様は大きな意味を持ちます。
-
-.. The first clause matches any input that is not matched by the other clauses. In this case, an error message is printed for any unknown character, and the input is skipped. Note that this clause is selected only if no other clause matches.
-
-最初の宣言句は他の宣言句にマッチしなかった任意の入力文字列がマッチします。この場合、未知の文字のエラーメッセージが出力されます。この宣言句は他の宣言句にマッチしなかった場合のみ選択されることに注意してください。
-
-.. The second clause is responsible for ignoring white space. If whitespace is found, it is ignored, and the lexer is called recursively.
-
-2番目の宣言句ではホワイトスペースを無視する役割を持っています。ホワイトスペースが見つかった場合、これを無視し、再帰的にレキサを呼び出します。
-
-.. The third clause is responsible for the arithmetic operators. It makes use of the Token object, which defines three fields: a loc field that represents the source location; a name; and a value.
-
-3番目の宣言句では演算子の役割を持っています。ここでは ``Token`` オブジェクトを利用しています。なお、この ``Token`` オブジェクトは3つのフィールド(ソース位置を表現している ``loc`` , ``name`` , ``value``)を定義しています。
-
-.. The lexer defines the loc variable to be the location of the current lexeme in each of the method bodies, so we can use that value to create the tokens.
-
-レキサは各々のメソッドの ``body`` 部で、現在の語彙素(lexeme)の位置を表す ``loc`` 変数が定義されているので、私たちはトークンを生成するためにこの値を用いています。
-
-.. The Token.unit($(loc), name) method constructs a new Token object with the given name, and a default value.
-
-``Token.unit($(loc), name)`` メソッドは与えられた名前とデフォルトの値を用いて新しい ``Token`` オブジェクトを構成します。
-
-.. The number clause matches nonnegative integer constants. The Token.pair($(loc), name, value) constructs a token with the given name and value.
-
-``number`` 宣言句は正の整数の定数にマッチします。 ``Token.pair($(loc), name, value)`` は与えられた名前と値でトークンを構成します。
-
-.. Lexer object operate on InChannel objects. The method lexer1.lex-channel(channel) reads the next token from the channel argument.
-
-``Lexer`` オブジェクトは ``InChannel`` オブジェクトを操作します。 ``lexer1.lex-channel(channel)`` メソッドは与えられたチャネルから次のトークンを読み込みます。
-
-.. index::
-   single: RuntimeException
-.. _label10.11.10:
-
-10.11.10 レキサのマッチング 
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-.. During lexical analysis, clauses are selected by longest match. That is, the clause that matches the longest sequence of input characters is chosen for evaluation. If no clause matches, the lexer raises a RuntimeException. If more than one clause matches the same amount of input, the first one is chosen for evaluation.
-
-字句解析においては、最も長くマッチした宣言句が選択されます。これは、最も長い入力文字のシーケンスにマッチした宣言句が評価対象になるということです。もしどの宣言句にもマッチしなかった場合、レキサは ``RuntimeException`` を送出します。もし1つ以上の宣言句が同じ量の入力にマッチした場合、最初の1つが評価に用いられます。
-
-.. _label10.11.11:
-
-10.11.11 拡張したレキサの定義
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-.. Suppose we wish to augment the lexer example so that it ignores comments. We will define comments as any text that begins with the string (*, ends with *), and comments may be nested.
-
-それでは前回のレキサのサンプルを、コメントを無視するように拡張してみましょう。ここで、コメントを ``(*`` から ``*)`` で終わる任意のテキストとして定義します。なお、コメントはネスト化されているものとします。
-
-.. One convenient way to do this is to define a separate lexer just to skip comments.
-
-これを実現する一つの簡単な方法としては、コメントをスキップする別のレキサを定義することが挙げられます。 ::
-
-   lex-comment. =
-      extends $(Lexer)
-
-      level = 0
-
-      other: .
-         lex()
-
-      term: $"[*][)]"
-         if $(not $(eq $(level), 0))
-            level = $(sub $(level), 1)
-            lex()
-
-      next: $"[(][*]"
-         level = $(add $(level), 1)
-         lex()
-
-      eof: $"\'"
-         eprintln(Unterminated comment)
-
-.. This lexer contains a field level that keeps track of the nesting level. On encountering a (* string, it increments the level, and for *), it decrements the level if nonzero, and continues.
-
-このレキサには、ネストレベルを記録し続けている ``lebel`` フィールドを含んでいます。 ``(*`` に遭遇すると、この変数はレベルを1増やし、 ``*)`` が来たら、0でない場合はレベルを1減らし、続けます。
-
-.. Next, we need to modify our previous lexer to skip comments. We can do this by extending the lexer object lexer1 that we just created.
-
-次に、前回のレキサを、コメントをスキップするような形に修正してみましょう。これはちょうど前に作った ``lexer1`` オブジェクトを拡張することで実現できます。 ::
-
-   lexer1. +=
-      comment: $"[(][*]"
-         lex-comment.lex-channel($(channel))
-         lex()
-
-.. The body for the comment clause calls the lex-comment lexer when a comment is encountered, and continues lexing when that lexer returns.
-
-``comment`` 宣言句の内容にはコメントに遭遇した場合、 ``lex-comment`` レキサを呼び出し、このレキサが返されたときに解析し続けることを指定しています。
-
-.. _label10.11.12:
-
-10.11.12 lexerオブジェクトを扱いやすくする
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-.. Clause bodies may also end with an export directive. In this case the lexer object itself is used as the returned token. If used with the Parser object below, the lexer should define the loc, name and value fields in each export clause. Each time the Parser calls the lexer, it calls it with the lexer returned from the previous lex invocation.
-
-宣言句の内容はまた指示文のエクスポートで終了します。この場合、レキサオブジェクト自身がトークンを返すものとして使われます。もしレキサオブジェクトの上で ``Parser`` オブジェクトを使うのであれば、レキサは ``loc`` , ``name`` , ``value`` フィールドを、各々の ``export`` 宣言句の中で定義すべきです。毎回 ``Parser`` オブジェクトはレキサを呼び出し、さらに前回のレキサを起動することで返されるレキサを呼び出します。
-
-.. index::
-   single: Parser
-.. _label10.11.13:
-
-10.11.13 Parser
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-.. The ``Parser`` object provides a facility for syntactic analysis based on context-free grammars.
-
-``Parser`` オブジェクトは『文脈自由な文法(context-free grammars)』をベースとした、文法解析機能を提供しています。
-
-.. ``Parser`` objects are specified as a sequence of directives, specified with method calls; and productions, specified as rules.
-
-``Parser`` オブジェクトは指示文のシーケンスとして指定されます。また、 ``Parser`` オブジェクトはメソッドの呼び出し、生成、ルールの指定も担当しています。
-
-.. For example, let's finish building the desktop calculator started in the ``Lexer`` example.
-
-例えば、前回の ``Lexer`` のサンプルを使って、デスクトップ計算機を作ってみましょう。 ::
-
-   parser1. =
-      extends $(Parser)
-
-      #
-      # 主に使うレキサを定義
-      #
-      lexer = $(lexer1)
-
-      #
-      # 昇順に優先順位を定義
-      #
-      left(plus minus)
-      left(mul div)
-      right(uminus)
-
-      #
-      # プログラム
-      #
-      start(prog)
-
-      prog: exp eof
-         return $1
-
-      #
-      # 単純な算術式定義
-      #
-      exp: minus exp :prec: uminus
-         neg($2)
-
-      exp: exp plus exp
-         add($1, $3)
-
-      exp: exp minus exp
-         sub($1, $3)
-
-      exp: exp mul exp
-         mul($1, $3)
-
-      exp: exp div exp
-         div($1, $3)
-
-      exp: lparen exp rparen
-         return $2
-
-.. Parsers are defined as extensions of the ``Parser`` class. A Parser object must have a ``lexer`` field. The ``lexer`` is not required to be a ``Lexer`` object, but it must provide a ``lexer.lex()`` method that returns a token object with ``name`` and ``value`` fields. For this example, we use the ``lexer1`` object that we defined previously.
-
-パーサは ``Parser`` クラスの式として定義されています。パーサオブジェクトは ``lexer`` フィールドを持たなければなりません。 ``lexer`` は ``Lexer`` オブジェクトでなければならないというわけではありませんが、トークンオブジェクトを返す ``lexer.lex()`` メソッドと ``name`` , ``value`` フィールドを提供していなければなりません。例えば、今回私たちは前回の項で定義した ``lexer1`` オブジェクトを使用しました。
-
-.. The next step is to define precedences for the terminal symbols. The precedences are defined with the ``left``, ``right``, and ``nonassoc`` methods in order of increasing precedence.
-
-次のステップでは演算子記号の優先順位を定義します。優先順位は ``left`` , ``right`` , ``nonassoc`` メソッドの順に上がっていきます( ``left`` が一番下で ``nonassoc`` が一番上)。
-
-.. The grammar must have at least one start symbol, declared with the ``start`` method.
-
-文法(grammar)は最低でも一つの開始記号を持たなければなりません。これは ``start`` メソッドで宣言できます。
-
-.. Next, the productions in the grammar are listed as rules. The name of the production is listed before the colon, and a sequence of variables is listed to the right of the colon. The body is a semantic action to be evaluated when the production is recognized as part of the input.
-
-次に、文法の中の生成部(productions)はルールに従って並べられます。生成部の名前はコロンの前に指定し、変数のシーケンスはコロンの後に指定します。内容部には、生成部が入力の一部として解釈された場合における、意味論的な行動(semantic action)を指定します。
-
-.. In this example, these are the productions for the arithmetic expressions recognized by the desktop calculator. The semantic action performs the calculation. The variables ``$1, $2, ...`` correspond to the values associated with each of the variables on the right-hand-side of the production.
-
-今回の例では、デスクトップの計算機によって解析された算術式を生成しています。今回の場合、『意味論的な行動』は数値計算としてふるまいます。変数 ``$1, $2, ...`` は生成部の右から順に、各々の変数に関連付けられた値として扱われます。
-
-.. _label10.11.14:
-
-10.11.14 パーサの呼び出し
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-.. The parser is called with the ``$(parser1.parse-channel start, channel)`` or ``$(parser1.parse-file start, file)`` functions. The start argument is the start symbol, and the channel or file is the input to the parser.
-
-パーサは ``$(parser1.parse-channel start, channel)`` や ``$(parser1.parse-file start, file)`` で呼び出されます。 ``start`` 引数には開始記号を指定し、 ``channel`` あるいは ``file`` にはパーサへの入力を指定します。
-
-.. _label10.11.15:
-
-10.11.15 パースの制御 
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-.. The parser generator generates a pushdown automation based on LALR(1) tables. As usual, if the grammar is ambiguous, this may generate shift/reduce or reduce/reduce conflicts. These conflicts are printed to standard output when the automaton is generated.
-
-パーサの生成器はLALR(1)テーブルをベースにした、『先読み後出しのオートメーション(pushdown automation)』を生成します。通常、文法が曖昧である場合には、このオートメーションは『移動してから減らすのか』あるいは『減らしてからさらに減らすのか』で衝突することになります。これらの衝突はオートメーションが生成された時点で、標準出力に表示されます。
-
-.. By default, the automaton is not constructed until the parser is first used.
-
-通常は、オートメーションはパーサが始めて使われることになるまで構築されません。
-
-.. The ``build(debug)`` method forces the construction of the automaton. While not required, it is wise to finish each complete parser with a call to the ``build(debug)`` method. If the ``debug`` variable is set, this also prints with parser table together with any conflicts.
-
-``build(debug)`` メソッドはオートメーションの構築を強制的に行います。 ``build(debug)`` メソッドを呼び出すことによって、各々のパーサが要求されなくなるまで完全に構築させるというのは賢い方法です。 ``debug`` 変数が設定されている場合、このメソッドはパーサテーブルの任意の衝突をそれぞれ出力します。
-
-.. The ``loc`` variable is defined within action bodies, and represents the input range for all tokens on the right-hand-side of the production.
-
-``loc`` 変数は行動部(action bodies)の内部で定義されます。また、生成部の右側にある、すべてのトークンの入力範囲を表現します。
-
-.. _label10.11.16:
-
-10.11.16 拡張したパーサ
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-.. Parsers may also be extended by inheritance. For example, let's extend the grammar so that it also recognizes the ``<<`` and ``>>`` shift operations.
-
-パーサはまた継承することで拡張できます。例えば、文法を拡張することでシフト演算 ``<<`` と ``>>`` を理解できるようにしてみましょう。
-
-.. First, we extend the lexer so that it recognizes these tokens. This time, we choose to leave ``lexer1`` intact, instead of using the += operator.
-
-初めに、私たちはレキサを拡張することで、これらのトークンを理解できるようにします。今回、私たちは += 演算子を使う代わりに、既存の ``lexer1`` を完全なものにすることを選びました。 ::
-
-   lexer2. =
-      extends $(lexer1)
-
-      lsl: $"<<"
-         Token.unit($(loc), lsl)
-
-      asr: $">>"
-         Token.unit($(loc), asr)
-
-.. Next, we extend the parser to handle these new operators. We intend that the bitwise operators have lower precedence than the other arithmetic operators. The two-argument form of the ``left`` method accomplishes this. ::
-
-次に、私たちはこれらの新しい演算子を扱うように、既存のパーサを拡張しました。ビット演算子は既存の算術演算子よりも低い優先順位にするつもりです。今回は二つの引数をとる ``left`` メソッドを使うことで実現しました。 ::
-
-   parser2. =
-      extends $(parser1)
-
-      left(plus, lsl lsr asr)
-
-      lexer = $(lexer2)
-
-      exp: exp lsl exp
-         lsl($1, $3)
-
-      exp: exp asr exp
-         asr($1, $3)
-
-.. In this case, we use the new lexer ``lexer2``, and we add productions for the new shift operations. 
-
-今回の場合、私たちは新しいレキサ ``lexer2`` を使用して、さらに新しいシフト演算子の生成部を追加しました。
-
-.. index::
-   single: Passwd
-.. _label10.11.17:
-
-10.11.17 Passwd
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-.. The Passwd object represents an entry in the system's user database. It contains the following fields.
-
-``Passwd`` オブジェクトはシステムユーザのデータベース上にあるエントリを表現します。このオブジェクトは以下のフィールドを持っています。
-
-.. the login name. 
-   the encrypted password. 
-   user id of the user. 
-   group id of the user. 
-   the user name or comment field. 
-   the user's home directory. 
-   the user's default shell. 
-
-* ``pw_name`` : ログインネーム
-* ``pw_passwd`` : 暗号化されたパスワード
-* ``pw_uid`` : ユーザのユーザID
-* ``pw_gid`` : ユーザのグループID
-* ``pw_gecos`` : ユーザ名かコメント欄
-* ``pw_dir`` : ユーザのホームディレクトリ
-* ``pw_shell`` : ユーザが通常使うシェル
-
-.. Not all the fields will have meaning on all operating systems.
-
-すべてのフィールドがすべてのOS上で意味をもつわけではないことに注意してください。
-
-.. index::
-   single: getpwnam()
-   single: getpwuid()
-.. _label10.11.18:
-
-10.11.18 getpwnam, getpwuid
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-::
-
-    $(getpwnam name...) : Passwd
-       name : String
-    $(getpwuid uid...) : Passwd
-       uid : Int
-    raises RuntimeException
-
-.. The getpwnam function looks up an entry by the user's login and the getpwuid function looks up an entry by user's numerical id (uid). If no entry is found, an exception will be raised.
-
-``getpwnam`` 関数はユーザのログイン名からエントリを探しだします。 ``getpwuid`` 関数はユーザID(numerical id, uid)からエントリを探し出します。もしエントリが見つからなかった場合、例外が送出されます。
-
-.. index::
-   single: getpwents()
-.. _label10.11.19:
-
-10.11.19 getpwents
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-::
-
-    $(getpwents) : Array
-
-.. The getpwents function returns an array of Passwd objects, one for every user fund in the system user database. Note that depending on the operating system and on the setup of the user database, the returned array may be incomplete or even empty. 
-
-``getpwents`` 関数は ``Passwd`` オブジェクトの配列を返します。すべてのユーザは、システムユーザのデータベースによって用意されます。この関数はOSやユーザデータベースの状況に依存し、返される配列は完全でなかったり、空である可能性もある点に注意してください。
-
-.. index::
-   single: Group
-.. _label10.11.20:
-
-10.11.20 Group
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-.. The Group object represents an entry in the system's user group database. It contains the following fields.
-
-``Group`` オブジェクトはシステムのユーザグループに関するデータベースのエントリを表現します。このオブジェクトは以下のフィールドを含んでいます。
-
-.. the group name. 
-   the encrypted password. 
-   group id of the group. 
-   the group member's user names. 
-
-* ``gr_name`` : グループ名
-* ``gr_group`` : 暗号化されたパスワード
-* ``gr_gid`` : グループのグループID
-* ``gr_mem`` : グループメンバのユーザ名
-
-.. Not all the fields will have meaning on all operating systems.
-
-すべてのフィールドがすべてのOSで意味を持つわけでは無い点に注意してください。
-
-.. index::
-   single: getgrnam()
-   single: getgrgid()
-.. _label10.11.21:
-
-10.11.21 getgrnam, getgrgid
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-::
-
-    $(getgrnam name...) : Group
-       name : String
-    $(getgrgid gid...) : Group
-       gid : Int
-    raises RuntimeException
-
-.. The getgrnam function looks up a group entry by the group's name and the getgrgid function looks up an entry by groups's numerical id (gid). If no entry is found, an exception will be raised.
-
-``getgrnam`` 関数はグループ名からグループエントリを探しだし、 ``getgrgid`` 関数はグループID(gid)からエントリを探し出します。何も見つからなかった場合は例外が送出されます。
-
-.. index::
-   single: tgetstr()
-.. _label10.11.22:
-
-10.11.22 tgetstr
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-::
-
-   $(tgetstr id) : String
-      id : String
-
-.. The tgetstr function looks up the terminal capability with the indicated id. This assumes the terminfo to lookup is given in the TERM environment variable. This function returns an empty value if the given terminal capability is not defined.
-
-``tgetstr`` 関数は指定された ``id`` を用いて『端末の能力(terminal capability, termcap)』を調べます。これは、"terminfo"の調査が ``TERM`` 環境変数によって与えられることを保証しています。もし与えられた"terminal capability"が定義されていなかった場合、この関数は空の値を返します。
-
-.. Note: if you intend to use the value returned by tgetstr inside the shell prompt, you need to wrap it using the prompt-invisible function.
-
-.. note::
-  シェルプロンプト内部の ``tgetstr`` によって返された値を使用したい場合、あなたは ``prompt-invisible`` 関数を用いてラップする必要があります。
-
-.. index::
-   single: xterm-escape-begin()
-   single: xterm-escape-end()
-.. _label10.11.23:
-
-10.11.23 xterm-escape-begin, xterm-escape-end
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-::
-
-   $(xterm-escape-begin) : String
-   $(xterm-escape-end) : String
-
-.. The xterm-escape-begin and xterm-escape-end functions return the escape sequences that can be used to set the XTerm window title. Will return empty values if this capability is not available.
-
-``xterm-escape-begin`` と ``xterm-escape-end`` 関数はXTermのウィンドウタイトルを設定したい場合に用いることができる、エスケープのシーケンスを返します。この機能が使えない場合、この関数は空の値を返します。
-
-.. Note: if you intend to use these strings inside the shell prompt, you need to use $(prompt_invisible_begin)$(xterm-escape-begin) and $(xterm-escape-end)$(prompt_invisible_end). 
-
-.. note::
-  シェルプロンプト内部の値を用いるようにしたい場合、あなたは ``$(prompt_invisible_begin)$(xterm-escape-begin)`` と ``$(xterm-escape-end)$(prompt_invisible_end)`` を使う必要があります。
-
-.. index::
-   single: xterm-escape()
-.. _label10.11.24:
-
-10.11.24 xterm-escape
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-::
-
-   $(xterm-escape s) : Sequence
-
-.. When the TERM environment variable indicates that the XTerm title setting capability is available, $(xterm-escape s) is equivalent to $(xterm-escape-begin)s$(xterm-escape-end). Otherwise, it returns an empty value.
-
-``TERM`` 環境変数が『XTermのタイトルを設定する機能が利用できる』ことを表していた場合、 ``$(xterm-escape s)`` は ``$(xterm-escape-begin)s$(xterm-escape-end)`` と等価です。そうでない場合、この関数は空の値を返します。
-
-.. Note: if you intend to use the value returned by xterm-escape inside the shell prompt, you need to wrap it using the prompt-invisible function.
-
-.. note::
-  シェルプロンプト内部の ``xterm-escape`` によって返された値を用いるようにしたい場合、あなたは ``prompt-invisible`` 関数を使ってラップする必要があります。
-
-.. index::
-   single: prompt-invisible-begin()
-   single: prompt-invisible-end()
-.. _label10.11.25:
-
-10.11.25 prompt-invisible-begin, prompt-invisible-end 
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-::
-
-   $(prompt-invisible-begin) : String
-   $(prompt-invisible-end) : String
-
-.. The prompt-invisible-begin and prompt-invisible-end functions return the escape sequences that must used to mark the “invisible” sections of the shell prompt (such as various escape sequences). 
-
-``prompt-invisible-begin`` と ``prompt-invisible-end`` 関数は、シェルプロンプトに『見えない』セクション(様々なエスケープシーケンスのような)を設定するために用いる必要のある、エスケープのシーケンスを返します。
-
-.. index::
-   single: prompt-invisible()
-.. _label10.11.26:
-
-10.11.26 prompt-invisible 
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-::
-
-   $(prompt-invisible s) : Sequence
-
-.. The prompt-invisible will wrap its argument with $(prompt-invisible-begin) and $(prompt-invisible-end). All the `invisible” sections of the shell prompt (such as various escape sequences) must be wrapped this way. 
-
-``prompt-invisible`` は指定された引数を ``$(prompt-invisible-begin)`` と ``$(prompt-invisible-end)`` でラップします。シェルプロンプトに『見えない』すべてのセクション(様々なエスケープシーケンスのような)はこの方法でラップしなければなりません。
-
-.. index::
-   single: gettimeofday()
-.. _label10.11.27:
-
-10.11.27 gettimeofday
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-::
-
-   $(gettimeofday) : Float
-
-.. The gettimeofday function returns the time of day in seconds since January 1, 1970.
-
-``gettimeofday`` 関数は1970年1月1日から始まる、現在までの秒数を返します。