GNU make manual 翻译( 一百三十二)

简介:

继续翻译

复制代码
5.2 Recipe Echoing
==================

Normally `make' prints each line of the recipe before it is executed.
We call this "echoing" because it gives the appearance that you are
typing the lines yourself.

   When a line starts with `@', the echoing of that line is suppressed.
The `@' is discarded before the line is passed to the shell.  Typically
you would use this for a command whose only effect is to print
something, such as an `echo' command to indicate progress through the
makefile:

     @echo About to make distribution files

   When `make' is given the flag `-n' or `--just-print' it only echoes
most recipes, without executing them.  *Note Summary of Options:
Options Summary.  In this case even the recipe lines starting with `@'
are printed.  This flag is useful for finding out which recipes `make'
thinks are necessary without actually doing them.

   The `-s' or `--silent' flag to `make' prevents all echoing, as if
all recipes started with `@'.  A rule in the makefile for the special
target `.SILENT' without prerequisites has the same effect (*note
Special Built-in Target Names: Special Targets.).  `.SILENT' is
essentially obsolete since `@' is more flexible.
复制代码

5.2 片段显示
==================

通常 make 在执行片段的一行之前,打印出此行。我们成为显示。因为它给出你自己输入的原样。当一行开始于@, 对此行的显示被禁止。在此行被传递给shell的时候,@被去掉。典型地,你可以用这个命令来单纯打印一些东西,比如用 echo 命令来显示 makefile 的进度,例如:

@echo About to make distribution files

当运行 make 时,给定了标志 -n 或者 --just-print ,它只显示所有的片段,而不执行它们。*Note Summary of Options: Opitons Summary. 在这种场合下既使是开始于 @ 的行也会被显示。 当想要找出 make 认为哪个片段应当执行而不必执行的时候,是有用的。

make 的 -s 或者 --silent 标志,禁止所有的显示,就好像素有的片段都开始于@一样。一个带有特殊目的 没有前提条件的.SLIENT 的makefile 也可以达成同样效果(*note Special Built-bin Target Names: Sepcial Targets.)。.SLIENT 更加的老式应当废弃,因为 @更加灵活。

后文待续






本文转自健哥的数据花园博客园博客,原文链接:http://www.cnblogs.com/gaojian/archive/2012/09/28/2706531.html,如需转载请自行联系原作者

目录
相关文章
|
Linux C语言
make: gcc:命令未找到
make: gcc:命令未找到
make: gcc:命令未找到
|
C语言 C++ Perl
如何处理错误消息Please install the gcc make perl packages
如何处理错误消息Please install the gcc make perl packages
144 0