Next: Guile Interface, Previous: Guile Integration, Up: Guile Integration [Contents][Index]
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
make
conditionals the empty string is considered false.#t
#t
’: in make
conditionals any non-empty string is considered true.symbol
number
character
string
list
'(a b (c d) e)
’ will be converted to the make
string ‘a b c d e
’).other
make
, other Guile types may be converted.The translation of ‘#f
’ (to the empty string) and ‘#t
’ (to
the non-empty string ‘#t
’) is designed to allow you to use Guile
boolean results directly as make
boolean conditions. For
example:
$(if $(guile (access? "myfile" R_OK)),$(info myfile exists))
As a consequence of these conversion rules you must consider the
result of your Guile script, as that result will be converted into a
string and parsed by make
. If there is no natural result for
the script (that is, the script exists solely for its side-effects),
you should add ‘#f
’ as the final expression in order to avoid
syntax errors in your makefile.
Next: Guile Interface, Previous: Guile Integration, Up: Guile Integration [Contents][Index]