[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Using Guile in a Makefile
From: |
John Olsson |
Subject: |
Re: Using Guile in a Makefile |
Date: |
Tue, 3 Jan 2023 10:25:58 +0100 |
Thank you for getting back to me! The weird Unicode double quote characters are
unfortunately an artifact of the text editor I used. I missed spotting that the
editor automatically replaced my normal plain double quotes with the Unicode
ones, I’m very sorry for that. :(
It turned out that the Guile support was not correctly built, but this put the
finger on something else that I’m not sure is an intended feature or a bug.
What I’m talking about is that if you try using a non-existent function, say
like I do in this makefile where fnord is not defined/known by GNU Make
> $ cat Makefile
>
> FOO = $(fnord "F N O R D")
> $(info $$FOO is [$(FOO)])
>
> fnord: ; for i in "$(FOO)"; do echo $$i; done
>
> $ make
I get the exact same behavior I reported in my issue.
So my question is really if this behavior is documented somewhere? Shouldn’t
GNU Make raise an error when a make file calls a non-existing function?
If it is not possible to have GNU Make by default raise an error when this
happens due to backward compatibility concerns, what about a configuration
option (command line and/or configurable from within makefile by setting some
value)?
If I had to choose between the two approaches I would prefer the one where you
configure behavior from within makefile.
>
> On 2 Jan 2023, at 06:28, Paul Smith <psmith@gnu.org> wrote:
>
> 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.