I'm using GNU Make with Guile. How do I pass Make variables to Guile?
%.txt:
@echo $* $(guile (string-upcase $*))
What I want to see is this:
$ make foo.txt
foo FOO
What I get is an error, Unbound variable: foo. My Guile invocation expands to (string-upcase foo), and foo is unbound. I can put quotes around the variable and then I get the result I'm looking for:
$(guile (string-upcase "$*"))
This feels wrong. What if the string contains double quotes? It feels like there would be a more formal mechanism for passing values into Guile.
https://www.gnu.org/software/make/manual/html_node/Guile-Types.html goes into some detail about passing values from Guile to to Make, but I can't immediately see anything about passing them in.
You can use
gmk-expandto expand$*more safely, like this:Or you can use the following technique to bind unary functions so that they can be invoked with
$(call):