Roland Ver. 4.5 Información técnica Pagina 146

  • Descarga
  • Añadir a mis manuales
  • Imprimir
  • Pagina
    / 212
  • Tabla de contenidos
  • MARCADORES
  • Valorado. / 5. Basado en revisión del cliente
Vista de pagina 145
136 GNU make
Warning: The load directive and extension capability is considered a “technology
preview” in this release of GNU make. We encourage you to experiment with this
feature and we appreciate any feedback on it. However we cannot guarantee to
maintain backward-compatibility in the next release. Consider using GNU Guile
instead for extending GNU make (see Section 8.14 [The guile Function], page 97).
Many operating systems provide a facility for dynamically loading compiled objects. If
your system provides this facility, GNU make can make use of it to load dynamic objects at
runtime, providing new capabilities which may then be invoked by your makefile.
The load directive is used to load a dynamic object. Once the object is loaded, a “setup”
function will be invoked to allow the object to initialize itself and register new facilities
with GNU make. A dynamic object might include new make functions, for example, and
the “setup” function would register them with GNU make’s function handling system.
12.2.1 The load Directive
Objects are loaded into GNU make by placing the load directive into your makefile. The
syntax of the load directive is as follows:
load object-file ...
or:
load object-file(symbol-name) ...
The file object-file is dynamically loaded by GNU make. If object-file does not include
a directory path then it is first looked for in the current directory. If it is not found there,
or a directory path is included, then system-specific paths will be searched. If the load fails
for any reason, make will print a message and exit.
If the load succeeds make will invoke an initializing function.
If symbol-name is provided, it will be used as the name of the initializing function.
If no symbol-name is provided, the initializing function name is created by taking the
base file name of object-file, up to the first character which is not a valid symbol name
character (alphanumerics and underscores are valid symbol name characters). To this prefix
will be appended the suffix _gmk_setup.
More than one object file may be loaded with a single load directive, and both forms of
load arguments may be used in the same directive.
The initializing function will be provided the file name and line number of the invocation
of the load operation. It should return a value of type int, which must be 0 on failure and
non-0 on success. If the return value is -1, then GNU make will not attempt to rebuild the
object file (see
Section 12.2.2 [How Loaded Objects Are Remade], page 137).
For example:
load ../mk_funcs.so
will load the dynamic object ../mk_funcs.so. After the object is loaded, make will
invoke the function (assumed to be defined by the shared object) mk_funcs_gmk_setup.
On the other hand:
load ../mk_funcs.so(init_mk_func)
will load the dynamic object ../mk_funcs.so. After the object is loaded, make will
invoke the function init_mk_func.
Vista de pagina 145
1 2 ... 141 142 143 144 145 146 147 148 149 150 151 ... 211 212

Comentarios a estos manuales

Sin comentarios