Re: Using Guile in a Makefile

Paul Smith <[email protected]>
Newsgroups gmane.comp.gnu.make.general
Organization GNU's Not UNIX!
Message-ID <[email protected]>
On Wed, 2022-12-14 at 13:12 +0100, johol wrote:
> FOO = $(guile (fnord “F N O R D”))

I'm not sure what environment you're using, but my version of Guile
doesn't work with these special UTF-8 quote characters you're using
here: “ and ”.

When I try to use them, and the sample makefile you've provided, I get
all sorts of bizarre errors from the Guile interpreter.

If I replace these characters with standard ASCII double-quote
characters " then it seems to work fine:

  $ cat Makefile
  define FNORD
  ;; Simple initial Guile-test
  (define (fnord value)
     value)
  endef

  # Internalize the Guile code
  $(guile $(FNORD))

  FOO = $(guile (fnord "F N O R D"))
  $(info $$FOO is [$(FOO)])

  fnord: ; for i in "$(FOO)"; do echo $$i; done

  $ make
  $FOO is [F N O R D]
  for i in "F N O R D"; do echo $i; done
  F N O R D

If you don't see this behavior you'll need to provide more details such
as which version of Guile you compiled with.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.