Skip to content

Instantly share code, notes, and snippets.

@pn11
Created August 3, 2016 02:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pn11/57fe6dab5ad935f1b674f9cf640d63ff to your computer and use it in GitHub Desktop.
Save pn11/57fe6dab5ad935f1b674f9cf640d63ff to your computer and use it in GitHub Desktop.
GNUMake の変数 (automatic variables) のまとめ

GNUMake の変数 (automatic variables) のまとめ

$@ とかの意味がいつも分からなくなるのでまとめておく。ここ でなぜか無料で配布されている Oreilly の GNUMake の本を参考にしている。Chapter 2 (PDF) の p.16 以降に書いてある。

変数 意味
$@ ターゲットのファイル名
$% The filename element of an archive member specification (わからん)
$< 一個目の prerequisite のファイル名
$? ターゲットよりも新しい prerequisite 全部。スペース区切り。
$^ prerequisite 全部。スペース区切り。重複は除かれる
$+ $^ に似ているが、重複を含む。リンカーに渡す引数が重複が意味を持つときなど、特別な場合に使う。
$* ターゲットからサフィックスを取ったもの
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment