DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 

(make.info.gz) Syntax of Functions

Info Catalog (make.info.gz) Functions (make.info.gz) Functions (make.info.gz) Text Functions
 
 8.1 Function Call Syntax
 ========================
 
 A function call resembles a variable reference.  It looks like this:
 
      $(FUNCTION ARGUMENTS)
 
 or like this:
 
      ${FUNCTION ARGUMENTS}
 
    Here FUNCTION is a function name; one of a short list of names that
 are part of `make'.  You can also essentially create your own functions
 by using the `call' builtin function.
 
    The ARGUMENTS are the arguments of the function.  They are separated
 from the function name by one or more spaces or tabs, and if there is
 more than one argument, then they are separated by commas.  Such
 whitespace and commas are not part of an argument's value.  The
 delimiters which you use to surround the function call, whether
 parentheses or braces, can appear in an argument only in matching pairs;
 the other kind of delimiters may appear singly.  If the arguments
 themselves contain other function calls or variable references, it is
 wisest to use the same kind of delimiters for all the references; write
 `$(subst a,b,$(x))', not `$(subst a,b,${x})'.  This is because it is
 clearer, and because only one type of delimiter is matched to find the
 end of the reference.
 
    The text written for each argument is processed by substitution of
 variables and function calls to produce the argument value, which is
 the text on which the function acts.  The substitution is done in the
 order in which the arguments appear.
 
    Commas and unmatched parentheses or braces cannot appear in the text
 of an argument as written; leading spaces cannot appear in the text of
 the first argument as written.  These characters can be put into the
 argument value by variable substitution.  First define variables
 `comma' and `space' whose values are isolated comma and space
 characters, then substitute these variables where such characters are
 wanted, like this:
 
      comma:= ,
      empty:=
      space:= $(empty) $(empty)
      foo:= a b c
      bar:= $(subst $(space),$(comma),$(foo))
      # bar is now `a,b,c'.
 
 Here the `subst' function replaces each space with a comma, through the
 value of `foo', and substitutes the result.
 
Info Catalog (make.info.gz) Functions (make.info.gz) Functions (make.info.gz) Text Functions
automatically generated byinfo2html