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

  • Descarregar
  • Adicionar aos meus manuais
  • Imprimir
  • Página
    / 212
  • Índice
  • MARCADORES
  • Avaliado. / 5. Com base em avaliações de clientes
Vista de página 62
Chapter 5: Writing Recipes in Rules 53
variable := value
export variable
Likewise,
export variable += value
is just like:
variable += value
export variable
See Section 6.6 [Appending More Text to Variables], page 66.
You may notice that the export and unexport directives work in make in the same way
they work in the shell, sh.
If you want all variables to be exported by default, you can use export by itself:
export
This tells make that variables which are not explicitly mentioned in an export or unexport
directive should be exported. Any variable given in an unexport directive will still not be
exported. If you use export by itself to export variables by default, variables whose names
contain characters other than alphanumerics and underscores will not be exported unless
specifically mentioned in an export directive.
The behavior elicited by an export directive by itself was the default in older versions of
GNU make. If your makefiles depend on this behavior and you want to be compatible with
old versions of make, you can write a rule for the special target .EXPORT_ALL_VARIABLES
instead of using the export directive. This will be ignored by old makes, while the export
directive will cause a syntax error.
Likewise, you can use unexport by itself to tell make not to export variables by default.
Since this is the default behavior, you would only need to do this if export had been used
by itself earlier (in an included makefile, perhaps). You cannot use export and unexport
by themselves to have variables exported for some recipes and not for others. The last
export or unexport directive that appears by itself determines the behavior for the entire
run of make.
As a special feature, the variable MAKELEVEL is changed when it is passed down from
level to level. This variable’s value is a string which is the depth of the level as a decimal
number. The value is 0 for the top-level make; 1 for a sub-make, 2 for a sub-sub-make,
and so on. The incrementation happens when make sets up the environment for a recipe.
The main use of MAKELEVEL is to test it in a conditional directive (see Chapter 7 [Con-
ditional Parts of Makefiles], page 77); this way you can write a makefile that behaves one
way if run recursively and another way if run directly by you.
You can use the variable MAKEFILES to cause all sub-make commands to use additional
makefiles. The value of MAKEFILES is a whitespace-separated list of file names. This variable,
if defined in the outer-level makefile, is passed down through the environment; then it serves
as a list of extra makefiles for the sub-make to read before the usual or specified ones. See
Section 3.4 [The Variable MAKEFILES], page 14.
Vista de página 62
1 2 ... 58 59 60 61 62 63 64 65 66 67 68 ... 211 212

Comentários a estes Manuais

Sem comentários