GNU make manual 翻译(九)
继续翻译
A "recipe" is an action that `make' carries out. A recipe may have more than one command, either on the same line or each on its own line. *Please note:* you need to put a tab character at the beginning of every recipe line! This is an obscurity that catches the unwary. If you prefer to prefix your recipes with a character other than tab, you can set the `.RECIPEPREFIX' variable to an alternate character (*note Special Variables::). Usually a recipe is in a rule with prerequisites and serves to create a target file if any of the prerequisites change. However, the rule that specifies a recipe for the target need not have prerequisites. For example, the rule containing the delete command associated with the target `clean' does not have prerequisites.
片段(recipe)是 make 所执行的一个动作。一个片段可以由多个命令,或者在一行,或者每个命令各自一行。
请注意:你需要在每个 片段行前 输入一个 tab 符!这是容易被粗心的人忽略的地方。
如果你想用 tab 符之外的其他字符,你可以设置 .RECIPEPREFIX 变量 为其他字符。(*note Special Variables::(特殊变量))
通常,一个片段是在带有前提条件的 规则里面。一旦前提条件发生变化,就会生成目的(target)文件。
但是,规定了片段的规则也可以不需要前提条件。例如,关联到目的 clean 的,包含 delete 命令的规则,就不需要什么前提条件。
后文待续