--- /dev/null
+.. 1-about
+
+ガイド
+===============================
+OMakeの世界へようこそ!
+-------------------------------
+
+あなたがOMakeを始めて使うのであれば、 :ref:`label2` はどのようにプロジェクトを始めるべきなのかについて、簡単に説明してくれるでしょう。 :ref:`label3` ではプロジェクトをビルドするための、より詳細なコードサンプルを紹介しています。そして :ref:`label4` では実際にプログラミングするときに役立つ、いくつかの一例を紹介しています。
+
+注意事項
+------------------
+*OMakeマニュアル 日本語訳 v1.3.0*
+
+このドキュメントは `OMake <http://omake.metaprl.org/>`_ バージョン0.9.8.5の `マニュアル <http://omake.metaprl.org/manual/omake.html>`_ を日本語訳したものです。 **この翻訳に関して原作者の許可は取っておりませんので、正当な権利者からの申し立てにより予告なく削除する場合があります。**
+
+原文のニュアンスを忠実に翻訳するよう心がけていますが、意図しない翻訳ミスやドキュメントの不備があるかもしれません。よって、 **内容の正確さについて保証することはできません。**
+
+翻訳に関して
+-------------------
+索引と検索
+^^^^^^^^^^^^^^^^^^^^^^^^^^^
+* 『OMakeマニュアル 日本語訳』では、独自に索引機能を搭載しております。右上もしくは右下にある『 `索引 <http://omake-japanese.sourceforge.jp/genindex.html>`_ 』リンクをクリックすることで、検索したい用語をたどることができます。
+* 分かりやすさのため、関数には ``()`` が接尾辞として付与されています。
+* クイック検索も左にありますが、(使ってみれば分かると思いますが)あまり役に立ちません。大抵の場合、索引のほうがより早く目的の情報にアクセスできます。
+
+その他の考慮事項
+^^^^^^^^^^^^^^^^^^^^^^^^^^^
+* 忠実に翻訳するというよりは読みやすさを重視して、多少崩した形の翻訳となっています。
+* 特に指定されていない括弧内の意見は全て原作者の意見です。翻訳者の意見はすべて *『訳注:』* をつけています。
+* 字句解析については翻訳者の専門外ですので、意図しない翻訳ミスが含まれている可能性が高いです。
+* OMake独自の専門用語も分かりやすさのため翻訳していますが、後に原文と比較できるようにするため、括弧書きで原文を載せています。
+* 原文と翻訳文を比較したい方は左の『ソースコードを表示』で.rstファイルを参照してください。コメントに原文を載せています。
+* このドキュメントはSphinxを用いて生成しました。元のコードは全て `Gitリポジトリ上で管理 <http://git.sourceforge.jp/view?p=omake-japanese/omake_trans.git>`_ しています。
+* (10/01/28)HTMLドキュメントの印刷に対応しました。Sphinxのデフォルトの状態では印刷が正常に行えなかったのですが、CSSを独自に変更して対応しました。
+
+翻訳者について
+^^^^^^^^^^^^^^^^^^^^^^^^^^^
+このドキュメントは *rezoo* が翻訳しました。
+翻訳に関して不備がある場合は連絡をいただけるとありがたいです。
+
+* mailaddr: rezoolab@gmail.com
+* blog_url: http://mglab.blogspot.com/
+
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.
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).
single: ConfMsgResult()
.. _label14.1.1:
-14.1.1 ConfMsgChecking, ConfMsgResult
+ConfMsgChecking, ConfMsgResult
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: ConfMsgError()
.. _label14.1.2:
-14.1.2 ConfMsgWarn, ConfMsgError
+ConfMsgWarn, ConfMsgError
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: ConfMsgFound()
.. _label14.1.3:
-14.1.3 ConfMsgYesNo, ConfMsgFound
+ConfMsgYesNo, ConfMsgFound
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: TryRunC()
.. _label14.1.4:
-14.1.4 TryCompileC, TryLinkC, TryRunC
+TryCompileC, TryLinkC, TryRunC
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: RunCProg()
.. _label14.1.5:
-14.1.5 RunCProg
+RunCProg
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: VerboseCheckCHeader()
.. _label14.1.6:
-14.1.6 CheckCHeader, VerboseCheckCHeader
+CheckCHeader, VerboseCheckCHeader
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: VerboseCheckCLib()
.. _label14.1.7:
-14.1.7 CheckCLib, VerboseCheckCLib
+CheckCLib, VerboseCheckCLib
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: CheckProg()
.. _label14.1.8:
-14.1.8 CheckProg
+CheckProg
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: AC_TRY_RUN
.. _label14.2:
-14.2 ``autoconf`` スクリプトをOMake用に翻訳する
+``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.
.. _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.
single: NCURSES_CLIBS
.. _label14.3.1:
-14.3.1 NCursesライブラリの設定
+NCursesライブラリの設定
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. Add open configure/ncurses line to your OMakefile to get access to the following autoconfiguration variables.
single: READLINE_CLIBS
.. _label14.3.2:
-14.3.2 ReadLineライブラリの設定
+ReadLineライブラリの設定
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. Add open configure/readline line to your OMakefile to get access to the following autoconfiguration variables.
single: SNPRINTF_AVAILABLE
.. _label14.3.3:
-14.3.3 Snprintfの設定
+Snprintfの設定
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. Add open configure/snprintf line to your OMakefile to get access to the following autoconfiguration variables.
.. _label9:
-9. 基本ライブラリ
+基本ライブラリ
==================================
.. index::
single: VERBOSE
.. _label9.1:
-9.1 ビルドイン変数
+ビルドイン変数
----------------------------------
* **OMAKE_VERSION**
.. _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.
single: not()
.. _label9.2.1:
-9.2.1 not
+not
^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: equal()
.. _label9.2.2:
-9.2.2 equal
+equal
^^^^^^^^^^^^^^^^^^^^^^^^^
.. The equal function tests for equality of two values.
single: and()
.. _label9.2.3:
-9.2.3 and
+and
^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: or()
.. _label9.2.4:
-9.2.4 or
+or
^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: if()
.. _label9.2.5:
-9.2.5 if
+if
^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: match()
.. _label9.2.6:
-9.2.6 switch, match
+switch, match
^^^^^^^^^^^^^^^^^^^^^^^^^
.. The switch and match functions perform pattern matching.
single: try
.. _label9.2.7:
-9.2.7 try
+try
^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: raise()
.. _label9.2.8:
-9.2.8 raise
+raise
^^^^^^^^^^^^^^^^^^^^^^^^^
.. The raise function raises an exception. The exn object can be any object. However, the normal convention is to raise an Exception object.
single: exit()
.. _label9.2.9:
-9.2.9 exit
+exit
^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: defined()
.. _label9.2.10:
-9.2.10 defined
+defined
^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: defined-env()
.. _label9.2.11:
-9.2.11 defined-env
+defined-env
^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: getenv()
.. _label9.2.12:
-9.2.12 getenv
+getenv
^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: setenv()
.. _label9.2.13:
-9.2.13 setenv
+setenv
^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: unsetenv()
.. _label9.2.14:
-9.2.14 unsetenv
+unsetenv
^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: get-registry()
.. _label9.2.15:
-9.2.15 get-registry
+get-registry
^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: getvar()
.. _label9.2.16:
-9.2.16 getvar
+getvar
^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: setvar()
.. _label9.2.17:
-9.2.17 setvar
+setvar
^^^^^^^^^^^^^^^^^^^^^^^^^
::
setvar(public.X, abc)
-9.3 配列とシーケンス
+配列とシーケンス
----------------------------------
.. index::
single: array()
.. _label9.3.1:
-9.3.1 array
+array
^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: split()
.. _label9.3.2:
-9.3.2 split
+split
^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: concat()
.. _label9.3.3:
-9.3.3 concat
+concat
^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: length()
.. _label9.3.4:
-9.3.4 length
+length
^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: nth()
.. _label9.3.5:
-9.3.5 nth
+nth
^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: replace-nth()
.. _label9.3.6:
-9.3.6 replace-nth
+replace-nth
^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: nth-hd()
.. _label9.3.7:
-9.3.7 nth-hd
+nth-hd
^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: nth-tl()
.. _label9.3.8:
-9.3.8 nth-tl
+nth-tl
^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: subrange()
.. _label9.3.9:
-9.3.9 subrange
+subrange
^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: rev()
.. _label9.3.10:
-9.3.10 rev
+rev
^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: join()
.. _label9.3.11:
-9.3.11 join
+join
^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: string()
.. _label9.3.12:
-9.3.12 string
+string
^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: string-length()
.. _label9.3.13:
-9.3.13 string-length
+string-length
^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: id-escaped()
.. _label9.3.14:
-9.3.14 string-escaped, ocaml-escaped, html-escaped, html-pre-escaped, c-escaped, id-escaped
+string-escaped, ocaml-escaped, html-escaped, html-pre-escaped, c-escaped, id-escaped
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: encode-uri()
.. _label9.3.15:
-9.3.15 decode-uri, encode-uri
+decode-uri, encode-uri
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: quote()
.. _label9.3.16:
-9.3.16 quote
+quote
^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: quote-argv()
.. _label9.3.17:
-9.3.17 quote-argv
+quote-argv
^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: html-string()
.. _label9.3.18:
-9.3.18 html-string
+html-string
^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: addsuffix()
.. _label9.3.19:
-9.3.19 addsuffix
+addsuffix
^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: mapsuffix()
.. _label9.3.20:
-9.3.20 mapsuffix
+mapsuffix
^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: addsuffixes()
.. _label9.3.21:
-9.3.21 addsuffixes
+addsuffixes
^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: removeprefix()
.. _label9.3.22:
-9.3.22 removeprefix
+removeprefix
^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: removesuffix()
.. _label9.3.23:
-9.3.23 removesuffix
+removesuffix
^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: replacesuffixes()
.. _label9.3.24:
-9.3.24 replacesuffixes
+replacesuffixes
^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: addprefix()
.. _label9.3.25:
-9.3.25 addprefix
+addprefix
^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: mapprefix()
.. _label9.3.26:
-9.3.26 mapprefix
+mapprefix
^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: add-wrapper()
.. _label9.3.27:
-9.3.27 add-wrapper
+add-wrapper
^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: set()
.. _label9.3.28:
-9.3.28 set
+set
^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: mem()
.. _label9.3.29:
-9.3.29 mem
+mem
^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: intersection()
.. _label9.3.30:
-9.3.30 intersection
+intersection
^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: intersects()
.. _label9.3.31:
-9.3.31 intersects
+intersects
^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: set-diff()
.. _label9.3.32:
-9.3.32 set-diff
+set-diff
^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: filter()
.. _label9.3.33:
-9.3.33 filter
+filter
^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: filter-out()
.. _label9.3.34:
-9.3.34 filter-out
+filter-out
^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: capitalize()
.. _label9.3.35:
-9.3.35 capitalize
+capitalize
^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: uncapitalize()
.. _label9.3.36:
-9.3.36 uncapitalize
+uncapitalize
^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: uppercase()
.. _label9.3.37:
-9.3.37 uppercase
+uppercase
^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: lowercase()
.. _label9.3.38:
-9.3.38 lowercase
+lowercase
^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: system()
.. _label9.3.39:
-9.3.39 system
+system
^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: shell()
.. _label9.3.40:
-9.3.40 shell
+shell
^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: export()
.. _label9.3.41:
-9.3.41 export
+export
^^^^^^^^^^^^^^^^^^^^^^^^^
.. The export function allows one to capture the current environment in a variable.
single: while
.. _label9.3.42:
-9.3.42 while
+while
^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: break
.. _label9.3.43:
-9.3.43 break
+break
^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: random-init()
.. _label9.3.44:
-9.3.44 random, random-init
+random, random-init
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
::
.. _label9.4:
-9.4 演算
+演算
----------------------------------
.. index::
single: int()
.. _label9.4.1:
-9.4.1 int
+int
^^^^^^^^^^^^^^^^^^^^^^^^^
.. The int function can be used to create integers. It returns an Int object.
single: float()
.. _label9.4.2:
-9.4.2 float
+float
^^^^^^^^^^^^^^^^^^^^^^^^^
.. The float function can be used to create floating-point numbers. It returns a Float object.
single: max()
.. _label9.4.3:
-9.4.3 基本的な演算
+基本的な演算
^^^^^^^^^^^^^^^^^^^^^^^^^
.. The following functions can be used to perform basic arithmetic.
single: ugt()
.. _label9.4.4:
-9.4.4 評価
+評価
^^^^^^^^^^^^^^^^^^^^^^^^^
.. The following functions can be used to perform numerical comparisons.
.. _label9.5:
-9.5 基本的な関数群
+基本的な関数群
----------------------------------
.. index::
single: apply()
.. _label9.5.2:
-9.5.2 apply
+apply
^^^^^^^^^^^^^^^^^^^^^^^^^
.. The apply operator is used to apply a function.
single: applya()
.. _label9.5.3:
-9.5.3 applya
+applya
^^^^^^^^^^^^^^^^^^^^^^^^^
.. The applya operator is used to apply a function to an array of arguments.
single: create-lazy-map()
.. _label9.5.4:
-9.5.4 create-map, create-lazy-map
+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.
.. _label9.6:
-9.6 イテレーションとマッピング
+イテレーションとマッピング
----------------------------------
.. index::
single: foreach()
.. _label9.6.1:
-9.6.1 foreach
+foreach
^^^^^^^^^^^^^^^^^^^^^^^^^
.. The foreach function maps a function over a sequence.
.. _label9.7:
-9.7 ブーリアン関数群
+ブーリアン関数群
----------------------------------
.. index::
single: sequence-forall()
.. _label9.7.1:
-9.7.1 sequence-forall
+sequence-forall
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. The forall function tests whether a predicate halds for each element of a sequence.
single: sequence-forall()
.. _label9.7.2:
-9.7.2 sequence-exists
+sequence-exists
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. The exists function tests whether a predicate holds for some element of a sequence.
single: sequence-sort()
.. _label9.7.3:
-9.7.3 sequence-sort
+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.
single: compare()
.. _label9.7.4:
-9.7.4 compare
+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.
single: OSTYPE
.. _label3:
-3. OMakeビルドサンプル
+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.
single: OMakefile
.. _label3.1:
-3.1 OMakeroot vs. OMakefile
+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).
single: DefineCommandVars()
.. _label3.2:
-3.2 Cプロジェクトのサンプル
+Cプロジェクトのサンプル
------------------------------
.. To begin, let's start with a simple example. Let's say that we have a full directory tree, containing the following files.
single: OCamlProgram()
.. _label3.3:
-3.3 OCamlプロジェクトのサンプル
+OCamlプロジェクトのサンプル
------------------------------------
.. Let's repeat the example, assuming we are using OCaml instead of C. This time, the directory tree looks like this.
.. _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?
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.
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.
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.
.. _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.
single: OMAKEPATH
.. _label3.4.5:
-3.4.5 終わりに
+終わりに
^^^^^^^^^^^^^^^^^^
.. At this point we are done, but there are a few things we can consider.
single: absname()
.. _label3.5:
-3.5 階層構造、.SUBDIRSの内容を並列化させる
+階層構造、.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.
single: ls()
.. _label3.5.1:
-3.5.1 globパターンを扱う
+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.
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).
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.
.. _label13:
-13. ビルド関数とユーティリティ
+ビルド関数とユーティリティ
==================================
.. index::
single: .BUILD_FAILURE
.. _label13.1:
-13.1 ビルドイン .PHONY ターゲット
+ビルドイン .PHONY ターゲット
--------------------------------------
.. The complete set of builtin .PHONY targets include the following.
.. _label13.2:
-13.2 オプションとバージョン管理
+オプションとバージョン管理
--------------------------------------
.. index::
single: OMakeFlags()
.. _label13.2.1:
-13.2.1 OMakeFlags
+OMakeFlags
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: OMakeVersion()
.. _label13.2.2:
-13.2.2 OMakeVersion
+OMakeVersion
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: cmp-versions()
.. _label13.2.3:
-13.2.3 cmp-versions
+cmp-versions
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: DefineCommandVars()
.. _label13.2.4:
-13.2.4 DefineCommandVars
+DefineCommandVars
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
::
.. _label13.3:
-13.3 依存関係グラフの調査
+依存関係グラフの調査
--------------------------------------
.. index::
single: dependencies-proper()
.. _label13.3.1:
-13.3.1 dependencies, dependencies-all, dependencies-proper
+dependencies, dependencies-all, dependencies-proper
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: target()
.. _label13.3.2:
-13.3.2 target
+target
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: find-build-targets()
.. _label13.3.3:
-13.3.3 find-build-targets
+find-build-targets
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: project-directories()
.. _label13.3.4:
-13.3.4 project-directories
+project-directories
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: rule()
.. _label13.3.5:
-13.3.5 rule
+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.
single: build()
.. _label13.3.6:
-13.3.6 build
+build
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
::
.. _label13.4:
-13.4 OMakerootファイル
+OMakerootファイル
--------------------------------------
.. The standard OMakeroot file defines the functions are rules for building standard projects.
single: SCANNER_MODE
.. _label13.4.1:
-13.4.1 変数
+変数
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
* **ROOT**
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).
.. _label13.5:
-13.5 C/C++コードのビルド
+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.
.. _label13.5.1:
-13.5.1 自動設定変数(Autoconfiguration variables)
+自動設定変数(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.
single: GXX_FOUND
.. _label13.5.1.1:
-13.5.1.1 Unixライクなシステム
+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.
single: LIB_FOUND
.. _label13.5.1.2:
-13.5.1.2 Win32
+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.
single: LEX
.. _label13.5.2:
-13.5.2 C/C++用の設定変数
+C/C++用の設定変数
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. The following variables can be redefined in your project.
.. _label13.5.3:
-13.5.3 Cファイルの生成
+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.
single: LocalCGeneratedFiles()
.. _label13.5.3.1:
-13.5.3.1 CGeneratedFiles, LocalCGeneratedFiles
+CGeneratedFiles, LocalCGeneratedFiles
""""""""""""""""""""""""""""""""""""""""""""""""""""
::
.. _label13.5.4:
-13.5.4 Cプログラムとライブラリをビルド
+Cプログラムとライブラリをビルド
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. index::
single: CDLL_IMPLIES_STATIC
.. _label13.5.4.1:
-13.5.4.1 StaticCLibrary, DynamicCLibrary
+StaticCLibrary, DynamicCLibrary
"""""""""""""""""""""""""""""""""""""""""""""""
.. The StaticCLibrary builds a static library and the DynamicCLibrary function builds a shared library (DLL).
single: DynamicCLibraryCopy()
.. _label13.5.4.2:
-13.5.4.2 StaticCLibraryCopy, DynamicCLibraryCopy
+StaticCLibraryCopy, DynamicCLibraryCopy
"""""""""""""""""""""""""""""""""""""""""""""""""""""
.. The StaticCLibraryCopy and DynamicCLibraryCopy functions copy a library to an install location.
single: DynamicCLibraryInstall()
.. _label13.5.4.3:
-13.5.4.3 StaticCLibraryInstall, DynamicCLibraryInstall
+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.
single: StaticCObjectInstall()
.. _label13.5.4.4:
-13.5.4.4 StaticCObject, StaticCObjectCopy, StaticCObjectInstall
+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).
single: LIBS
.. _label13.5.4.5:
-13.5.4.5 CProgram
+CProgram
"""""""""""""""""""""""""
.. The CProgram function builds a C program from a set of object files and libraries.
single: CProgramCopy()
.. _label13.5.4.6:
-13.5.4.6 CProgramCopy
+CProgramCopy
""""""""""""""""""""""""""""""""""""""
.. The CProgramCopy function copies a file to an install location.
single: CProgramInstall()
.. _label13.5.4.7:
-13.5.4.7 CProgramInstall
+CProgramInstall
""""""""""""""""""""""""""""""""""""""
.. The CProgramInstall function specifies a program to build, and a location to install, simultaneously.
single: CXXFLAGS
.. _label13.5.4.8:
-13.5.4.8 CXXProgram, CXXProgramInstall
+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).
single: DynamicCXXLibraryInstall()
.. _label13.5.4.9:
-13.5.4.9 StaticCXXLibrary, StaticCXXLibraryCopy, StaticCXXLibraryInstall, DynamicCXXLibrary, DynamicCXXLibraryCopy, DynamicCXXLibararyInstall
+StaticCXXLibrary, StaticCXXLibraryCopy, StaticCXXLibraryInstall, DynamicCXXLibrary, DynamicCXXLibraryCopy, DynamicCXXLibararyInstall
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
.. Similarly, the six CXXLibrary functions the C++ equivalents of the corresponding CLibrary functions.
.. _label13.6:
-13.6 OCamlコードのビルド
+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
single: MENHIR_AVAILABLE
.. _label13.6.1:
-13.6.1 OCamlコンパイルに用いる自動設定用の変数
+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.
single: MENHIR_ENABLED
.. _label13.6.2:
-13.6.2 OCamlコンパイルに用いる設定用の変数
+OCamlコンパイルに用いる設定用の変数
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. The following variables can be redefined in your project.
single: MENHIR_FLAGS
.. _label13.6.3:
-13.6.3 OCamlコマンドフラグ
+OCamlコマンドフラグ
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. The following variables specify additional options to be passed to the OCaml tools.
single: ABORT_ON_DEPENDENCY_ERRORS
.. _label13.6.4:
-13.6.4 ライブラリ変数
+ライブラリ変数
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. The following variables are used during linking.
.. _label13.6.5:
-13.6.5 OCamlファイルを生成
+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,
single: LocalOCamlGeneratedFiles()
.. _label13.6.5.1:
-13.6.5.1 OCamlGeneratedFiles, LocalOCamlGeneratedFiles
+OCamlGeneratedFiles, LocalOCamlGeneratedFiles
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
::
.. _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.
single: Menhir
.. _label13.6.6:
-13.6.6 Menhirパーサジェネレータを使用
+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/).
single: OCamlLibrary()
.. _label13.6.6.1:
-13.6.6.1 OCamlLibrary
+OCamlLibrary
""""""""""""""""""""""""""""""""""""""
.. The OCamlLibrary function builds an OCaml library.
single: OCamlPackage()
.. _label13.6.6.2:
-13.6.6.2 OCamlPackage
+OCamlPackage
""""""""""""""""""""""""""""""""""""""
.. The OCamlPackage function builds an OCaml package.
single: OCamlLibraryCopy()
.. _label13.6.6.3:
-13.6.6.3 OCamlLibraryCopy
+OCamlLibraryCopy
""""""""""""""""""""""""""""""""""""""
.. The OCamlLibraryCopy function copies a library to an install location.
single: OCamlLibraryInstall()
.. _label13.6.6.4:
-13.6.6.4 OCamlLibraryInstall
+OCamlLibraryInstall
""""""""""""""""""""""""""""""""""""""
.. The OCamlLibraryInstall function builds a library and copies it to an install location in one step.
single: OCAMLE_LINK_FLAGS
.. _label13.6.6.5:
-13.6.6.5 OCamlProgram
+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).
single: NATIVE_ENABLED
.. _label13.6.6.6:
-13.6.6.6 OCamlProgramCopy
+OCamlProgramCopy
""""""""""""""""""""""""""""""""""""""
.. The OCamlProgramCopy function copies an OCaml program to an install location.
single: OCamlProgramInstall()
.. _label13.6.6.7:
-13.6.6.7 OCamlProgramInstall
+OCamlProgramInstall
""""""""""""""""""""""""""""""""""""""
.. The OCamlProgramInstall function builds a programs and copies it to an install location in one step.
.. _label13.7:
-13.7 LaTeXファイルのビルド
+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.
single: USEPDFLATEX
.. _label13.7.1:
-13.7.1 設定用の変数
+設定用の変数
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. The following variables can be modified in your project.
.. _label13.7.2:
-13.7.2 LaTeXドキュメントのビルド
+LaTeXドキュメントのビルド
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. index::
single: TEXVARS
.. _label13.7.2.1:
-13.7.2.1 LaTeXDocument
+LaTeXDocument
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
.. The LaTeXDocument produces a LATEX document.
single: LocalTeXGeneratedFiles()
.. _label13.7.2.2:
-13.7.2.2 TeXGeneratedFiles, LocalTeXGeneratedFiles
+TeXGeneratedFiles, LocalTeXGeneratedFiles
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
::
single: LaTeXDocumentCopy()
.. _label13.7.2.3:
-13.7.2.3 LaTeXDocumentCopy
+LaTeXDocumentCopy
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
.. The LaTeXDocumentCopy copies the document to an install location.
single: LaTeXDocumentInstall()
.. _label13.7.2.4:
-13.7.2.4 LaTeXDocumentInstall
+LaTeXDocumentInstall
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
.. The LaTeXDocumentInstall builds a document and copies it to an install location in one step.
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.
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.
.. _label6.2:
-6.2 関数評価
+関数評価
----------------------------------
.. Apart from I/O, omake programs are entirely functional. This has two parts:
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.
single: export
.. _label6.3.1:
-6.3.1 区域のエクスポート
+区域のエクスポート
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. This feature was introduced in version 0.9.8.5.
single: return
.. _label6.3.2:
-6.3.2 エクスポートされた区域から値を返す
+エクスポートされた区域から値を返す
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. This feature was introduced in version 0.9.8.5.
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.
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.
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.
.. _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.
.. 1-guide:
-1. ガイド
-==================
-.. 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` では実際にプログラミングするときに役立つ、いくつかの一例を紹介しています。
-
-1.1 注意事項
-------------------
-*OMakeマニュアル 日本語訳 v1.2.6*
-
-このドキュメントは `OMake <http://omake.metaprl.org/>`_ バージョン0.9.8.5の `マニュアル <http://omake.metaprl.org/manual/omake.html>`_ を日本語訳したものです。 **この翻訳に関して原作者の許可は取っておりませんので、正当な権利者からの申し立てにより予告なく削除する場合があります。**
-
-原文のニュアンスを忠実に翻訳するよう心がけていますが、意図しない翻訳ミスやドキュメントの不備があるかもしれません。よって、 **内容の正確さについて保証することはできません。**
-
-1.2 コンテンツ
--------------------
-
.. toctree::
- :hidden:
-
+ :maxdepth: 3
+ :numbered:
+
+ about
quickstart
build-examples
language
autoconf
osh
omake-options
- omake-grammar
-
-* :ref:`2. クイックスタート<label2>`
-
- OMakeを利用するためのクイックスタートガイド
-
-* :ref:`3. ビルドサンプル<label3>`
-
- さらに発展したOMakeのビルドサンプルについての解説
-
-* :ref:`4. OMake言語<label4>`
-
- OMake言語のオブジェクト、式、値について解説します
-
-* :ref:`5. 変数と名前空間<label5>`
-
- OMake言語の変数、名前、環境について説明します
-
-* :ref:`6. 式と値<label6>`
-
- スコープ、評価、オブジェクトを含んだ、さらなるOMake言語の解説
-
-* :ref:`7. さらなる言語例<label7>`
-
- OMakeの言語についての、より詳しい解説
-
-* :ref:`8. ビルドルール<label8>`
-
- プログラムをビルドするために用いるルールの定義方法について学びます
-
-* :ref:`9. 基本的なビルドイン関数<label9>`
-
- 標準ライブラリの核となる関数や変数についての解説
-
-* :ref:`10. システム関数<label10>`
-
- ファイル、入出力、システムコマンドについての関数
-
-* :ref:`11. シェルコマンド<label11>`
-
- OMakeのシェルを用いてコマンドラインを操作します
-
-* :ref:`12. 標準的なオブジェクト群<label12>`
-
- 広く使われているビルドインオブジェクトについての解説
-
-* :ref:`13. ビルド関数とユーティリティ<label13>`
-
- OMakeの標準ライブラリを使って、プログラミング言語のビルド設定を行います
-
-* :ref:`14. 自動設定用の変数と関数<label14>`
-
- 自動的に設定テストを行うための、OMake標準ライブラリ
-
-* :ref:`15. OSHシェル<label15>`
-
- ``osh`` コマンドラインインタープリターについての解説
-
-* **付録**
-
- * :ref:`A. OMake コマンドラインオプション<labelA>`
-
- ``omake`` のコマンドラインオプション
-
-.. * :ref:`B. OMakeの文法<labelB>`
-
- OMake言語についての、さらに詳細な解説
-
-1.3 翻訳に関して
--------------------
-1.3.1 索引と検索
-^^^^^^^^^^^^^^^^^^^^^^^^^^^
-* 『OMakeマニュアル 日本語訳』では、独自に索引機能を搭載しております。右上もしくは右下にある『 `索引 <http://omake-japanese.sourceforge.jp/genindex.html>`_ 』リンクをクリックすることで、検索したい用語をたどることができます。
-* 分かりやすさのため、関数には ``()`` が接尾辞として付与されています。
-* クイック検索も左にありますが、(使ってみれば分かると思いますが)あまり役に立ちません。大抵の場合、索引のほうがより早く目的の情報にアクセスできます。
-
-1.3.2 その他の考慮事項
-^^^^^^^^^^^^^^^^^^^^^^^^^^^
-* 忠実に翻訳するというよりは読みやすさを重視して、多少崩した形の翻訳となっています。
-* 特に指定されていない括弧内の意見は全て原作者の意見です。翻訳者の意見はすべて *『訳注:』* をつけています。
-* 字句解析については翻訳者の専門外ですので、意図しない翻訳ミスが含まれている可能性が高いです。
-* OMake独自の専門用語も分かりやすさのため翻訳していますが、後に原文と比較できるようにするため、括弧書きで原文を載せています。
-* 原文と翻訳文を比較したい方は左の『ソースコードを表示』で.rstファイルを参照してください。コメントに原文を載せています。
-* このドキュメントはSphinxを用いて生成しました。元のコードは全て `Gitリポジトリ上で管理 <http://git.sourceforge.jp/view?p=omake-japanese/omake_trans.git>`_ しています。
-* (10/01/28)HTMLドキュメントの印刷に対応しました。Sphinxのデフォルトの状態では印刷が正常に行えなかったのですが、CSSを独自に変更して対応しました。
-
-1.3.3 翻訳者について
-^^^^^^^^^^^^^^^^^^^^^^^^^^^
-このドキュメントは *rezoo* が翻訳しました。
-翻訳に関して不備がある場合は連絡をいただけるとありがたいです。
-
-* mailaddr: rezoolab@gmail.com
-* blog_url: http://mglab.blogspot.com/
-
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).
.. _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.
.. _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.
.. _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.
single: foreach()
.. _label7.4:
-7.4 イテレーション、マップ、foreach
+イテレーション、マップ、foreach
---------------------------------------
.. Most builtin functions operate transparently on arrays.
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.
.. _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.
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.
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.
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.
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.
single: export
.. _label5.1:
-5.1 private.
+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.
single: this.
.. _label5.2:
-5.2 this.
+this.
----------------------------------
.. The this. qualifier is used to define fields that are local to an object. Object variables are dynamically scoped.
single: global.
.. _label5.3:
-5.3 global.
+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.
single: protected.
.. _label5.4:
-5.4 protected.
+protected.
----------------------------------
.. In OMake 0.9.8, protected is a synonym for this.
single: public.
.. _label5.5:
-5.5 public.
+public.
----------------------------------
.. In OMake 0.9.8, public is a synonym for global.
.. _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.
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.
.. _label4:
-4. OMake言語の概要と構文
+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.
single: 変数
.. _label4.1:
-4.1 変数
+変数
-------------
.. Variables are defined with the following syntax. The name is any sequence of alphanumeric characters, underscore _, and hyphen -.
.. _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.
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.
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 \.
single: value
.. _label4.5:
-4.5 関数定義
+関数定義
----------------
.. Functions are defined using the following syntax.
single: コメント
.. _label4.6:
-4.6 コメント
+コメント
----------------
.. Comments begin with the # character and continue to the end of the line.
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.
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.
single: if
.. _label4.9:
-4.9 条件分岐
+条件分岐
----------------
.. Top level conditionals have the following form.
single: 正規表現
.. _label4.10:
-4.10 マッチング
+マッチング
-------------------
.. Pattern matching is performed with the switch and match forms.
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.
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.
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.
single: ConfMsgResult()
.. _label4.14:
-4.14 static.
+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.
single: awk()
.. _label4.14.1:
-4.14.1 .STATIC
+.STATIC
^^^^^^^^^^^^^^^^^^
.. This feature was introduced in version 0.9.8.5.
single: .MEMO
.. _label4.14.1.1:
-4.14.1.1 .MEMO
+.MEMO
""""""""""""""""""
.. A .MEMO rule is just like a .STATIC rule, except that the results are not saved between independent runs of omake.
single: 再帰関数
.. _label4.14.1.2:
-4.14.1.2 :key:
+\: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.
single: パーサ
.. _label4.15:
-4.15 定数
+定数
-----------------
.. Internally, OMake represents values in several forms, which we list here.
+++ /dev/null
-.. 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 ダラー修飾子
----------------------------------------
.. _label15:
-15. OSHシェル
+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.
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.
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.
.. _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.
.. _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
+Object
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
親オブジェクト : 無し
single: Map
.. _label12.1.2:
-12.1.2 Map
+Map
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
親オブジェクト : ``Object``
single: Number
.. _label12.1.3:
-12.1.3 Number
+Number
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
親オブジェクト : ``Object``
single: Int
.. _label12.1.4:
-12.1.4 Int
+Int
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
親オブジェクト : ``Number``
single: Float
.. _label12.1.5:
-12.1.5 Float
+Float
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
親オブジェクト : ``Number``
single: Sequence
.. _label12.1.6:
-12.1.6 Sequence
+Sequence
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
親オブジェクト : ``Object``
single: Array
.. _label12.1.7:
-12.1.7 Array
+Array
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
親オブジェクト : ``Sequence``
single: String
.. _label12.1.8:
-12.1.8 String
+String
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
親オブジェクト : ``Array``
single: Fun
.. _label12.1.9:
-12.1.9 Fun
+Fun
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
親オブジェクト : ``Object``
single: Rule
.. _label12.1.10:
-12.1.10 Rule
+Rule
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
親オブジェクト : ``Object``
single: Target
.. _label12.1.11:
-12.1.11 Target
+Target
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
親オブジェクト : ``Object``
single: Node
.. _label12.1.12:
-12.1.12 Node
+Node
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
親オブジェクト : ``Object``
single: File
.. _label12.1.13:
-12.1.13 File
+File
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
親オブジェクト : ``Node``
single: Dir
.. _label12.1.14:
-12.1.14 Dir
+Dir
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
親オブジェクト : ``Node``
single: Channel
.. _label12.1.15:
-12.1.15 Channel
+Channel
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
親オブジェクト : ``Object``
single: InChannel
.. _label12.1.16:
-12.1.16 InChannel
+InChannel
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
親オブジェクト : ``Channel``
single: OutChannel
.. _label12.1.17:
-12.1.17 OutChannel
+OutChannel
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
親オブジェクト : ``Channel``
single: Location
.. _label12.1.18:
-12.1.18 Location
+Location
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
親オブジェクト : ``Location``
single: Exception
.. _label12.1.19:
-12.1.19 Exception
+Exception
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
親オブジェクト : ``Object``
single: RuntimeException
.. _label12.1.20:
-12.1.20 RuntimeException
+RuntimeException
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
親オブジェクト : ``Exception``
single: UnbuildableException
.. _label12.1.21:
-12.1.21 UnbuildableException
+UnbuildableException
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
親オブジェクト : ``Exception``
single: find()
.. _label12.1.22:
-12.1.22 Shell
+Shell
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
親オブジェクト : ``Object``
.. _label2:
-2. OMakeクイックスタートガイド
+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.
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
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.
single: .SUFFIXES
.. _label2.2:
-2.2 既にmakeに慣れている人向けの注意事項
+既にmakeに慣れている人向けの注意事項
------------------------------------------
.. For users already familiar with the make(1) command, here is a list of differences to keep in mind when using omake.
single: .DEFAULT
.. _label2.3:
-2.3 小さなCプログラムのビルド
+小さな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.
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.
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.
.. _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.
single: OMakeroot
.. _label2.8:
-2.8 OMakefileとOMakeroot
+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.
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.
.. _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.
single: $<
.. _label8:
-8. ビルドルール
+ビルドルール
==================================
.. Rules are used by OMake to specify how to build files. At its simplest, a rule has the following form.
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.
.. _label8.2:
-8.2 束縛された暗黙のルール
+束縛された暗黙のルール
----------------------------------
.. Implicit rules may specify the set of files they apply to. The following syntax is used.
single: section
.. _label8.3:
-8.3 section
+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.
single: section rule
.. _label8.4:
-8.4 section rule
+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.
.. _label8.5:
-8.5 特別な依存関係
+特別な依存関係
----------------------------------
.. index::
single: :exists:
.. _label8.5.1:
-8.5.1 :exists:
+\: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.
single: :effects:
.. _label8.5.2:
-8.5.2 :effects:
+\: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.
single: :value:
.. _label8.5.3:
-8.5.3 :value:
+\:value:
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. The :value: dependency is used to specify that the rule execution depends on the value of an expression. For example, the following rule
single: digest-in-path-optional()
.. _label8.6:
-8.6 .SCANNER ルール
+.SCANNER ルール
----------------------------------
.. Scanner rules define a way to specify automatic dependency scanning. A .SCANNER rule has the following form.
single: :scanner:
.. _label8.6.1:
-8.6.1 スキャナの命名と :scanner: 依存関係
+スキャナの命名と :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.
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.
single: .DEFAULT
.. _label8.7:
-8.7 .DEFAULT
+.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
single: .SUBDIRS
.. _label8.8:
-8.8 .SUBDIRS
+.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.
single: .INCLUDE
.. _label8.9:
-8.9 .INCLUDE
+.INCLUDE
----------------------------------
.. The .INCLUDE target is like the include directive, but it specifies a rule to build the file if it does not exist.
single: .PHONY
.. _label8.10:
-8.10 .PHONY
+.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).
.. _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).
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.
single: :scanner:
.. _label8.11.2:
-8.11.2 .SCANNER ルールのスコーピング
+.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.
single: .SUBDIRS
.. _label8.11.3:
-8.11.3 .PHONY ターゲットのスコーピング
+.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.
.. _label8.12:
-8.12 サブディレクトリからOMakeを実行
+サブディレクトリから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.
single: .PHONY
.. _label8.12.1:
-8.12.1 サブディレクトリのPhonyターゲット
+サブディレクトリの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
.. _label8.12.2:
-8.12.2 .PHONYターゲットの階層構造
+.PHONYターゲットの階層構造
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. When the the root OMakefile contains a .PHONY: clean directive, it creates:
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.
.. _label11:
-11. シェルコマンド
+シェルコマンド
==================================
.. Shell commands (commands to be executed by the operating system) can be freely mixed with other code.
.. _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.
.. _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.
.. _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.
single: ファイルのリダイレクション
.. _label11.4:
-11.4 ファイルのリダイレクション
+ファイルのリダイレクション
----------------------------------
.. Input and output can be redirected to files by using the <, >, and >& directives after the command.
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.
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.
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.
.. _label11.8:
-11.8 シェルコマンドとは何か?
+シェルコマンドとは何か?
----------------------------------
.. Syntactially, shell commands are any line that is not one of the following
.. _label11.9:
-11.9 基本的なビルドイン関数
+基本的なビルドイン関数
----------------------------------
.. index::
single: echo()
.. _label11.9.1:
-11.9.1 echo
+echo
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. The echo function prints a string.
single: cd()
.. _label11.9.2:
-11.9.2 cd
+cd
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. The cd function changes the current directory.
.. _label11.10:
-11.10 ジョブを制御するビルドイン関数
+ジョブを制御するビルドイン関数
---------------------------------------
.. index::
single: jobs()
.. _label11.10.1:
-11.10.1 jobs
+jobs
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. The jobs function prints a list of jobs.
single: bg()
.. _label11.10.2:
-11.10.2 bg
+bg
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. The bg function places a job in the background.
single: fg()
.. _label11.10.3:
-11.10.3 fg
+fg
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. The fg function brings a job to the foreground.
single: stop()
.. _label11.10.4:
-11.10.4 stop
+stop
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. The stop function suspends a job.
single: wait()
.. _label11.10.5:
-11.10.5 wait
+wait
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. The wait function waits for a job to finish. If no process identifiers are given, the shell waits for all jobs to complete.
single: kill()
.. _label11.10.6:
-11.10.6 kill
+kill
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. The kill function signals a job.
.. _label11.10.7:
-11.11 コマンド履歴
+コマンド履歴
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. index::
single: history()
.. _label11.11.1:
-11.11.1 history
+history
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
::
.. _label10:
-10. システム関数
+システム関数
==================================
.. _label10.1:
-10.1 ファイル名
+ファイル名
----------------------------------
.. index::
single: dir()
.. _label10.1.1:
-10.1.1 file, dir
+file, dir
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: tmpfile()
.. _label10.1.2:
-10.1.2 tmpfile
+tmpfile
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: in()
.. _label10.1.3:
-10.1.3 in
+in
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: basename()
.. _label10.1.4:
-10.1.4 basename
+basename
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: dirname()
.. _label10.1.5:
-10.1.5 dirname
+dirname
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: rootname()
.. _label10.1.6:
-10.1.6 rootname
+rootname
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: dirof()
.. _label10.1.7:
-10.1.7 dirof
+dirof
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: fullname()
.. _label10.1.8:
-10.1.8 fullname
+fullname
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: absname()
.. _label10.1.9:
-10.1.9 absname
+absname
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: homename()
.. _label10.1.10:
-10.1.10 homename
+homename
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: suffix()
.. _label10.1.11:
-10.1.11 suffix
+suffix
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
::
.. _label10.2:
-10.2 パスによる検索
+パスによる検索
----------------------------------
.. index::
single: where()
.. _label10.2.2:
-10.2.2 where
+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.
single: rehash()
.. _label10.2.3:
-10.2.3 rehash
+rehash
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: exists-in-path()
.. _label10.2.4:
-10.2.4 exists-in-path
+exists-in-path
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: digest-optional()
.. _label10.2.5:
-10.2.5 digest, digest-optional
+digest, digest-optional
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: find-in-path-optional()
.. _label10.2.6:
-10.2.6 find-in-path, find-in-path-optional
+find-in-path, find-in-path-optional
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: digest-in-path-optional()
.. _label10.2.7:
-10.2.7 digest-in-path, digest-in-path-optional
+digest-in-path, digest-in-path-optional
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
::
.. _label10.3:
-10.3 ファイル検査
+ファイル検査
----------------------------------
.. index::
single: target-is-proper()
.. _label10.3.1:
-10.3.1 file-exists, target-exists, target-is-proper
+file-exists, target-exists, target-is-proper
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: stat-reset()
.. _label10.3.2:
-10.3.2 stat-reset
+stat-reset
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: filter-proper-targets()
.. _label10.3.3:
-10.3.3 filter-exists, filter-targets, filter-proper-targets
+filter-exists, filter-targets, filter-proper-targets
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
::
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, find-targets-in-path-optional
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: find-ocaml-targets-in-path-optional()
.. _label10.3.5:
-10.3.5 find-ocaml-targets-in-path-optional
+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.
single: file-sort()
.. _label10.3.6:
-10.3.6 file-sort
+file-sort
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
::
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.
single: file-check-sort()
.. _label10.3.7:
-10.3.7 file-check-sort
+file-check-sort
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
::
.. _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.
single: glob()
.. _label10.4.1:
-10.4.1 glob
+glob
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: ls()
.. _label10.4.2:
-10.4.2 ls
+ls
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: subdirs()
.. _label10.4.3:
-10.4.3 subdirs
+subdirs
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
::
.. _label10.5:
-10.5 ファイル操作
+ファイル操作
----------------------------------
.. index::
single: mkdir()
.. _label10.5.1:
-10.5.1 mkdir
+mkdir
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: Stat
.. _label10.5.2:
-10.5.2 Stat
+Stat
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. The Stat object represents an information about a filesystem node, as returned by the stat and lstat functions. It contains the following fields.
single: lstat()
.. _label10.5.3:
-10.5.3 stat, lstat
+stat, lstat
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: unlink()
.. _label10.5.4:
-10.5.4 unlink
+unlink
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: cp()
.. _label10.5.5:
-10.5.5 rename
+rename
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: link()
.. _label10.5.6:
-10.5.6 link
+link
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: symlink()
.. _label10.5.7:
-10.5.7 symlink
+symlink
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: readlink()
.. _label10.5.8:
-10.5.8 readlink
+readlink
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: chmod()
.. _label10.5.9:
-10.5.9 chmod
+chmod
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: chown()
.. _label10.5.10:
-10.5.10 chown
+chown
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: truncate()
.. _label10.5.11:
-10.5.11 truncate
+truncate
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: umask()
.. _label10.5.12:
-10.5.12 umask
+umask
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
::
.. _label10.6:
-10.6 vmount
+vmount
----------------------------------
.. index::
single: vmount()
.. _label10.6.1:
-10.6.1 vmount
+vmount
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: add-project-directories()
.. _label10.6.2:
-10.6.2 add-project-directories
+add-project-directories
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: remove-project-directories()
.. _label10.6.3:
-10.6.3 remove-project-directories
+remove-project-directories
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
::
.. _label10.7:
-10.7 ファイルの内容を元にした検索
+ファイルの内容を元にした検索
----------------------------------
.. index::
single: test()
.. _label10.7.1:
-10.7.1 test
+test
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: find()
.. _label10.7.2:
-10.7.2 find
+find
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
::
.. _label10.8:
-10.8 I/O 関数
+I/O 関数
----------------------------------
.. index::
single: stderr
.. _label10.8.1:
-10.8.1 標準出力先
+標準出力先
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. The following variables define the standard channels.
single: open-in-string()
.. _label10.8.2:
-10.8.2 open-in-string
+open-in-string
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. The open-in-string treats a string as if it were a file and returns a channel for reading.
single: out-contents()
.. _label10.8.3:
-10.8.3 open-out-string, out-contents
+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.
single: fopen()
.. _label10.8.4:
-10.8.4 fopen
+fopen
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. The fopen function opens a file for reading or writing.
single: close()
.. _label10.8.5:
-10.8.5 close
+close
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: input-line()
.. _label10.8.6:
-10.8.6 read, input-line
+read, input-line
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: write()
.. _label10.8.7:
-10.8.7 write
+write
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: lseek()
.. _label10.8.8:
-10.8.8 lseek
+lseek
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: rewind()
.. _label10.8.9:
-10.8.9 rewind
+rewind
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: tell()
.. _label10.8.10:
-10.8.10 tell
+tell
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: flush()
.. _label10.8.11:
-10.8.11 flush
+flush
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: channel-name()
.. _label10.8.12:
-10.8.12 channel-name
+channel-name
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: dup()
.. _label10.8.13:
-10.8.13 dup
+dup
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: dup2()
.. _label10.8.14:
-10.8.14 dup2
+dup2
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: set-nonblock()
.. _label10.8.15:
-10.8.15 set-nonblock
+set-nonblock
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: set-close-on-exec-mode()
.. _label10.8.16:
-10.8.16 set-close-on-exec-mode
+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.
single: pipe()
.. _label10.8.17:
-10.8.17 pipe
+pipe
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: mkfifo()
.. _label10.8.18:
-10.8.18 mkfifo
+mkfifo
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: select()
.. _label10.8.19:
-10.8.19 select
+select
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: lockf()
.. _label10.8.20:
-10.8.20 lockf
+lockf
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: InetAddr
.. _label10.8.21:
-10.8.21 InetAddr
+InetAddr
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. The InetAddr object describes an Internet address. It contains the following fields.
single: Host
.. _label10.8.22:
-10.8.22 Host
+Host
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. A Host object contains the following fields.
single: gethostbyname()
.. _label10.8.23:
-10.8.23 gethostbyname
+gethostbyname
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: Protocol
.. _label10.8.24:
-10.8.24 Protocol
+Protocol
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. The Protocol object represents a protocol entry. It has the following fields.
single: getprotobyname()
.. _label10.8.25:
-10.8.25 getprotobyname
+getprotobyname
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: Service
.. _label10.8.26:
-10.8.26 Service
+Service
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. The Service object represents a network service. It has the following fields.
single: getservbyname()
.. _label10.8.27:
-10.8.27 getservbyname
+getservbyname
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: socket()
.. _label10.8.28:
-10.8.28 socket
+socket
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: bind()
.. _label10.8.29:
-10.8.29 bind
+bind
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: listen()
.. _label10.8.30:
-10.8.30 listen
+listen
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: accept()
.. _label10.8.31:
-10.8.31 accept
+accept
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: connect()
.. _label10.8.32:
-10.8.32 connect
+connect
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: getchar()
.. _label10.8.33:
-10.8.33 getchar
+getchar
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: gets()
.. _label10.8.34:
-10.8.34 gets
+gets
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: fgets()
.. _label10.8.35:
-10.8.35 fgets
+fgets
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
::
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.
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.
.. _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
""""""""""""""""""""""""""""""""""
::
.. _label10.11:
-10.11 高レベルな I/O 関数
+高レベルな I/O 関数
----------------------------------
.. index::
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).
single: cat()
.. _label10.11.2:
-10.11.2 cat
+cat
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: grep()
.. _label10.11.3:
-10.11.3 grep
+grep
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: scan()
.. _label10.11.4:
-10.11.4 scan
+scan
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: awk()
.. _label10.11.5:
-10.11.5 awk
+awk
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: fsubst()
.. _label10.11.6:
-10.11.6 fsubst
+fsubst
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: lex()
.. _label10.11.7:
-10.11.7 lex
+lex
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: lex-search()
.. _label10.11.8:
-10.11.8 lex-search
+lex-search
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: Lexer
.. _label10.11.9:
-10.11.9 Lexer
+Lexer
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. The Lexer object defines a facility for lexical analysis, similar to the lex(1) and flex(1) programs.
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.
.. _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.
.. _label10.11.12:
-10.11.12 lexerオブジェクトを扱いやすくする
+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.
single: Parser
.. _label10.11.13:
-10.11.13 Parser
+Parser
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. The ``Parser`` object provides a facility for syntactic analysis based on context-free grammars.
.. _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.
.. _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.
.. _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.
single: Passwd
.. _label10.11.17:
-10.11.17 Passwd
+Passwd
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. The Passwd object represents an entry in the system's user database. It contains the following fields.
single: getpwuid()
.. _label10.11.18:
-10.11.18 getpwnam, getpwuid
+getpwnam, getpwuid
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: getpwents()
.. _label10.11.19:
-10.11.19 getpwents
+getpwents
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: Group
.. _label10.11.20:
-10.11.20 Group
+Group
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. The Group object represents an entry in the system's user group database. It contains the following fields.
single: getgrgid()
.. _label10.11.21:
-10.11.21 getgrnam, getgrgid
+getgrnam, getgrgid
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: tgetstr()
.. _label10.11.22:
-10.11.22 tgetstr
+tgetstr
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: xterm-escape-end()
.. _label10.11.23:
-10.11.23 xterm-escape-begin, xterm-escape-end
+xterm-escape-begin, xterm-escape-end
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: xterm-escape()
.. _label10.11.24:
-10.11.24 xterm-escape
+xterm-escape
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: prompt-invisible-end()
.. _label10.11.25:
-10.11.25 prompt-invisible-begin, prompt-invisible-end
+prompt-invisible-begin, prompt-invisible-end
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: prompt-invisible()
.. _label10.11.26:
-10.11.26 prompt-invisible
+prompt-invisible
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: gettimeofday()
.. _label10.11.27:
-10.11.27 gettimeofday
+gettimeofday
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
::