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

  • Descarregar
  • Adicionar aos meus manuais
  • Imprimir
  • Página
    / 212
  • Índice
  • MARCADORES
  • Avaliado. / 5. Com base em avaliações de clientes
Vista de página 147
138 GNU make
Data Structures
gmk_floc This structure represents a filename/location pair. It is provided when defining
items, so GNU make can inform the user later where the definition occurred if
necessary.
Registering Functions
There is currently one way for makefiles to invoke operations provided by the loaded object:
through the make function call interface. A loaded object can register one or more new
functions which may then be invoked from within the makefile in the same way as any
other function.
Use gmk_add_function to create a new make function. Its arguments are as follows:
name The function name. This is what the makefile should use to invoke the function.
The name must be between 1 and 255 characters long and it may only contain
alphanumeric, period (‘.’), dash (‘-’), and underscore (‘_’) characters. It may
not begin with a period.
func_ptr A pointer to a function that make will invoke when it expands the function in
a makefile. This function must be defined by the loaded object.
min_args The minimum number of arguments the function will accept. Must be between
0 and 255. GNU make will check this and fail before invoking func_ptr if the
function was invoked with too few arguments.
max_args The maximum number of arguments the function will accept. Must be between
0 and 255. GNU make will check this and fail before invoking func_ptr if the
function was invoked with too few arguments. If the value is 0, then any number
of arguments is accepted. If the value is greater than 0, then it must be greater
than or equal to min_args.
flags Flags that specify how this function will operate; the desired flags should be
OR’d together. If the GMK_FUNC_NOEXPAND flag is given then the function ar-
guments will not be expanded before the function is called; otherwise they will
be expanded first.
Registered Function Interface
A function registered with make must match the gmk_func_ptr type. It will be invoked
with three parameters: name (the name of the function), argc (the number of arguments
to the function), and argv (an array of pointers to arguments to the function). The last
pointer (that is, argv[argc]) will be null (0).
The return value of the function is the result of expanding the function. If the function
expands to nothing the return value may be null. Otherwise, it must be a pointer to a
string created with gmk_alloc. Once the function returns, make owns this string and will
free it when appropriate; it cannot be accessed by the loaded object.
GNU make Facilities
There are some facilities exported by GNU make for use by loaded objects. Typically these
would be run from within the setup function and/or the functions registered via gmk_add_
function, to retrieve or modify the data make works with.
Vista de página 147
1 2 ... 143 144 145 146 147 148 149 150 151 152 153 ... 211 212

Comentários a estes Manuais

Sem comentários