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

简介:

继续翻译

复制代码
   We will change how this aspect of `make' works if we find a better
alternative.  In the mean time, you should not rely on any recipe using
standard input at all if you are using the parallel execution feature;
but if you are not using this feature, then standard input works
normally in all recipes.

   Finally, handling recursive `make' invocations raises issues.  For
more information on this, see *note Communicating Options to a
Sub-`make': Options/Recursion.

   If a recipe fails (is killed by a signal or exits with a nonzero
status), and errors are not ignored for that recipe (*note Errors in
Recipes: Errors.), the remaining recipe lines to remake the same target
will not be run.  If a recipe fails and the `-k' or `--keep-going'
option was not given (*note Summary of Options: Options Summary.),
`make' aborts execution.  If make terminates for any reason (including
a signal) with child processes running, it waits for them to finish
before actually exiting.

   When the system is heavily loaded, you will probably want to run
fewer jobs than when it is lightly loaded.  You can use the `-l' option
to tell `make' to limit the number of jobs to run at once, based on the
load average.  The `-l' or `--max-load' option is followed by a
floating-point number.  For example,

     -l 2.5

will not let `make' start more than one job if the load average is
above 2.5.  The `-l' option with no following number removes the load
limit, if one was given with a previous `-l' option.

   More precisely, when `make' goes to start up a job, and it already
has at least one job running, it checks the current load average; if it
is not lower than the limit given with `-l', `make' waits until the load
average goes below that limit, or until all the other jobs finish.

   By default, there is no load limit.
复制代码

如果我们找到了更好的替代办法,我们将会改变这种make 工作的方式。在目前,当你使用并行执行功能的时候,你不能依赖于任何使用标准输入的片段;这样标准输入可以在所有的片段中工作。最后,对make 的嵌套调用导致问题。想要了解更多信息,参见 *note Communicating Options to a Sub - make : Options /Recursion

如果一个片段失败(被一个信号杀掉或以非零状态推出),并且错误没有被此片段忽略(*note Errors in Recipes: Errors),剩下的创建此同一个目的的片段行不会运行。

如果一个片段失败并且 -k 或者 --keep-going 先选项没有被设置(*note Summary of Options: Options Summary.),make 推出执行。如果带有子进程的make 因为任何原因停止(包括因为信号的原因),它会等到这些子进程都退出后再退出。

当系统的负荷很重,你也许想要运行少一点的任务。你可以根据负荷,使用 -l 选项来告诉 限制一次运行的任务数目。这个- l或者 --max-load 选项后面跟一个浮点数。 例如,

-l 2.5

当负荷超过2.5的时候,不会让 make 多启动多一个的任务的。

如果之前给出了 -l 选项,那么后面没有跟 -l 选项的,将会去掉 负荷限制。

更精确地,当 make 要启动一个任务,并且它已经有至少一个任务在运行,它检查当前的负荷平均值; 如果它不比 -l 给出的限制低,那么 make 等待知道负荷低于此限制值,或者等到其它任务都结束。

缺省情况下,没有负荷限制。

后文待续




本文转自健哥的数据花园博客园博客,原文链接:http://www.cnblogs.com/gaojian/archive/2012/10/01/2709531.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