make: Guile Types
1
1 12.1.1 Conversion of Guile Types
1 --------------------------------
1
1 There is only one "data type" in 'make': a string. GNU Guile, on the
1 other hand, provides a rich variety of different data types. An
1 important aspect of the interface between 'make' and GNU Guile is the
1 conversion of Guile data types into 'make' strings.
1
1 This conversion is relevant in two places: when a makefile invokes
1 the 'guile' function to evaluate a Guile expression, the result of that
1 evaluation must be converted into a make string so it can be further
1 evaluated by 'make'. And secondly, when a Guile script invokes one of
1 the procedures exported by 'make' the argument provided to the procedure
1 must be converted into a string.
1
1 The conversion of Guile types into 'make' strings is as below:
1
1 '#f'
1 False is converted into the empty string: in 'make' conditionals
1 the empty string is considered false.
1
1 '#t'
1 True is converted to the string '#t': in 'make' conditionals any
1 non-empty string is considered true.
1
1 'symbol'
1 'number'
1 A symbol or number is converted into the string representation of
1 that symbol or number.
1
1 'character'
1 A printable character is converted to the same character.
1
1 'string'
1 A string containing only printable characters is converted to the
1 same string.
1
1 'list'
1 A list is converted recursively according to the above rules. This
1 implies that any structured list will be flattened (that is, a
1 result of ''(a b (c d) e)' will be converted to the 'make' string
1 'a b c d e').
1
1 'other'
1 Any other Guile type results in an error. In future versions of
1 'make', other Guile types may be converted.
1
1 The translation of '#f' (to the empty string) and '#t' (to the
1 non-empty string '#t') is designed to allow you to use Guile boolean
1 results directly as 'make' boolean conditions. For example:
1
1 $(if $(guile (access? "myfile" R_OK)),$(info myfile exists))
1
1 As a consequence of these conversion rules you must consider the
1 result of your Guile script, as that result will be converted into a
1 string and parsed by 'make'. If there is no natural result for the
1 script (that is, the script exists solely for its side-effects), you
1 should add '#f' as the final expression in order to avoid syntax errors
1 in your makefile.
1