Roland Ver. 4.5 Informações Técnicas Página 57

  • Descarregar
  • Adicionar aos meus manuais
  • Imprimir
  • Página
    / 212
  • Índice
  • MARCADORES
  • Avaliado. / 5. Com base em avaliações de clientes
Vista de página 56
Chapter 5: Writing Recipes in Rules 47
The effect of the above DOS-specific processing is that a Makefile that contains SHELL
= /bin/sh (as many Unix makefiles do), will work on MS-DOS unaltered if you have e.g.
sh.exe installed in some directory along your PATH.
5.4 Parallel Execution
GNU make knows how to execute several recipes at once. Normally, make will execute
only one recipe at a time, waiting for it to finish before executing the next. However, the
-j or --jobs option tells make to execute many recipes simultaneously. You can inhibit
parallelism in a particular makefile with the .NOTPARALLEL pseudo-target (see Section 4.8
[Special Targets], page 32).
On MS-DOS, the -j option has no effect, since that system doesn’t support multi-
processing.
If the -j option is followed by an integer, this is the number of recipes to execute at
once; this is called the number of job slots. If there is nothing looking like an integer after
the -j option, there is no limit on the number of job slots. The default number of job
slots is one, which means serial execution (one thing at a time).
Handling recursive make invocations raises issues for parallel execution. For more infor-
mation on this, see Section 5.7.3 [Communicating Options to a Sub-make], page 54.
If a recipe fails (is killed by a signal or exits with a nonzero status), and errors are
not ignored for that recipe (see Section 5.5 [Errors in Recipes], page 49), 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 (see Section 9.7 [Summary of Options], page 104),
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.
5.4.1 Output During Parallel Execution
When running several recipes in parallel the output from each recipe appears as soon as
it is generated, with the result that messages from different recipes may be interspersed,
sometimes even appearing on the same line. This can make reading the output very difficult.
To avoid this you can use the --output-sync’ (‘-O’) option. This option instructs make
to save the output from the commands it invokes and print it all once the commands are
Vista de página 56
1 2 ... 52 53 54 55 56 57 58 59 60 61 62 ... 211 212

Comentários a estes Manuais

Sem comentários