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

  • Descarregar
  • Adicionar aos meus manuais
  • Imprimir
  • Página
    / 212
  • Índice
  • MARCADORES
  • Avaliado. / 5. Com base em avaliações de clientes
Vista de página 111
102 GNU make
modification times remain the same. You can use the -W flag in conjunction
with the -n flag to see what would happen if you were to modify specific files.
With the -n flag, make prints the recipe that it would normally execute but usually
does not execute it.
With the ‘-t’ flag, make ignores the recipes in the rules and uses (in effect) the command
touch for each target that needs to be remade. The touch command is also printed, unless
-s or .SILENT is used. For speed, make does not actually invoke the program touch. It
does the work directly.
With the -q flag, make prints nothing and executes no recipes, but the exit status code
it returns is zero if and only if the targets to be considered are already up to date. If the
exit status is one, then some updating needs to be done. If make encounters an error, the
exit status is two, so you can distinguish an error from a target that is not up to date.
It is an error to use more than one of these three flags in the same invocation of make.
The -n’, -t’, and -q options do not affect recipe lines that begin with + characters
or contain the strings $(MAKE) or ${MAKE}’. Note that only the line containing the +
character or the strings $(MAKE) or ${MAKE} is run regardless of these options. Other
lines in the same rule are not run unless they too begin with + or contain $(MAKE) or
${MAKE} (See
Section 5.7.1 [How the MAKE Variable Works], page 51.)
The -t flag prevents phony targets (see Section 4.5 [Phony Targets], page 29) from
being updated, unless there are recipe lines beginning with + or containing $(MAKE) or
${MAKE}’.
The -W flag provides two features:
If you also use the -n or -q flag, you can see what make would do if you were to
modify some files.
Without the -n or -q flag, when make is actually executing recipes, the -W flag
can direct make to act as if some files had been modified, without actually running the
recipes for those files.
Note that the options -p and -v allow you to obtain other information about make or
about the makefiles in use (see Section 9.7 [Summary of Options], page 104).
9.4 Avoiding Recompilation of Some Files
Sometimes you may have changed a source file but you do not want to recompile all the
files that depend on it. For example, suppose you add a macro or a declaration to a header
file that many other files depend on. Being conservative, make assumes that any change
in the header file requires recompilation of all dependent files, but you know that they do
not need to be recompiled and you would rather not waste the time waiting for them to
compile.
If you anticipate the problem before changing the header file, you can use the -t flag.
This flag tells make not to run the recipes in the rules, but rather to mark the target up to
date by changing its last-modification date. You would follow this procedure:
1. Use the command make to recompile the source files that really need recompilation,
ensuring that the object files are up-to-date before you begin.
2. Make the changes in the header files.
Vista de página 111
1 2 ... 107 108 109 110 111 112 113 114 115 116 117 ... 211 212

Comentários a estes Manuais

Sem comentários