最終更新:2016-07-06 (水) 16:27:33 (2849d)  

Makefile/関数
Top / Makefile / 関数

https://www.gnu.org/software/make/manual/html_node/Functions.html#Functions

http://www.ecoop.net/coop/translated/GNUMake3.77/make_8.jp.html

書き方

  • $(関数 引数)
  • または
    ${関数 引数}

種類

Syntax of Functions: How to write a function call.

Text Functions: General-purpose text manipulation functions.

File Name Functions: Functions for manipulating file names.

Conditional Functions: Functions that implement conditions.

Foreach Function: Repeat some text with controlled variation.

File Function: Write text to a file.

Call Function: Expand a user-defined function.

Value Function: Return the un-expanded value of a variable.

Eval Function: Evaluate the arguments as makefile syntax.

Origin Function: Find where a variable got its value.

Flavor Function: Find out the flavor of a variable.

  • flavor?

Make Control Functions: Functions that control how make runs.

Shell Function: Substitute the output of a shell command.

Guile Function: Use GNU Guile embedded scripting language.

  • subst : 置換動作
  • patsubst? : 置換動作,ワイルドカードあり
  • strip : 空白文字の削除
  • findstring? : 文字列を探す
  • filter : 一致する単語の削除
  • filter-out? : 一致しない単語の削除
  • sort : ソートする
  • dir : ディレクトリ部分の抽出
  • nodir? : ファイル部分の抽出
  • suffix? : サフィックス(拡張子)部分
  • basename : サフィックス以外
  • addsuffix? : サフィックスを加える
  • addprefix? : プレフィックスを加える
  • join? : 単語の連結
  • word? : n番目の単語を返す
  • worldlist? : 単語のリストを返す
  • words? : 単語数を返す
  • firstword? : 最初の名前を返す
  • wildcard? : ワイルドカードによりファイル名リストを返す
  • foreach : 引数を複数回展開する
  • shell