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

  • Descarregar
  • Adicionar aos meus manuais
  • Imprimir
  • Página
    / 212
  • Índice
  • MARCADORES
  • Avaliado. / 5. Com base em avaliações de clientes
Vista de página 142
Chapter 12: Extending GNU make 133
12 Extending GNU make
GNU make provides many advanced capabilities, including many useful functions. However,
it does not contain a complete programming language and so it has limitations. Sometimes
these limitations can be overcome through use of the shell function to invoke a separate
program, although this can be inefficient.
In cases where the built-in capabilities of GNU make are insufficient to your requirements
there are two options for extending make. On systems where it’s provided, you can utilize
GNU Guile as an embedded scripting language (see Section 12.1 [GNU Guile Integration],
page 133). On systems which support dynamically loadable objects, you can write your
own extension in any language (which can be compiled into such an object) and load it to
provide extended capabilities (see Section 12.2.1 [The load Directive], page 136).
12.1 GNU Guile Integration
GNU make may be built with support for GNU Guile as an embedded extension language.
Guile implements the Scheme language. A review of GNU Guile and the Scheme language
and its features is beyond the scope of this manual: see the documentation for GNU Guile
and Scheme.
You can determine if make contains support for Guile by examining the .FEATURES
variable; it will contain the word guile if Guile support is available.
The Guile integration provides one new make function: guile. The guile function takes
one argument which is first expanded by make in the normal fashion, then passed to the
GNU Guile evaluator. The result of the evaluator is converted into a string and used as the
expansion of the guile function in the makefile.
In addition, GNU make exposes Guile procedures for use in Guile scripts.
12.1.1 Conversion of Guile Types
There is only one “data type” in make: a string. GNU Guile, on the other hand, provides
a rich variety of different data types. An important aspect of the interface between make
and GNU Guile is the conversion of Guile data types into make strings.
This conversion is relevant in two places: when a makefile invokes the guile function
to evaluate a Guile expression, the result of that evaluation must be converted into a make
string so it can be further evaluated by make. And secondly, when a Guile script invokes
one of the procedures exported by make the argument provided to the procedure must be
converted into a string.
The conversion of Guile types into make strings is as below:
#f False is converted into the empty string: in make conditionals the empty string
is considered false.
#t True is converted to the string #t’: in make conditionals any non-empty string
is considered true.
symbol
number A symbol or number is converted into the string representation of that symbol
or number.
Vista de página 142
1 2 ... 138 139 140 141 142 143 144 145 146 147 148 ... 211 212

Comentários a estes Manuais

Sem comentários