help-make
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: how to use a string in a .SHELLFLAGS option?


From: Cook, Malcolm
Subject: RE: how to use a string in a .SHELLFLAGS option?
Date: Mon, 10 Jan 2022 17:29:26 +0000

>I'd like to use:
>
>SHELL = /usr/bin/perl
>.SHELLFLAGS = -w -E 'use warnings FATAL => "all";' -E
>
>but it doesn't work, saying at recipe execution time:
>
>Can't find string terminator "'" anywhere before EOF at -e line 1.

Your problem is in the recipe that you don't show.  

This works perfectly in my hands 

        SHELL = /usr/bin/perl
        .SHELLFLAGS = -w -E 'use warnings FATAL => "all";' -E
        all:
                print 'it works'

however, I get your reported error message exactly if I omit the closing single 
quote from the recipe:

        SHELL = /usr/bin/perl
        .SHELLFLAGS = -w -E 'use warnings FATAL => "all";' -E
        all:
                print 'it works

>
>I tried a few other quoting combinations without any luck. It looks
>like maybe the problem is that there's no way to group words at all.
>This works to get the fatal warnings pragma:
>
>.SHELLFLAGS = -w -e use -e warnings -e FATAL -e => -e "all";
>
>but it's sort of gruesome and there are still other reasons I'd like
>to be able to pass spaces, for example to get the line number right as
>in:
>
>perl -Mv5.20 -e \#line\ 42 -e 'say "$undeclared_var"'
>
>That pragma has to go all on one line and I didn't find a substitute.
>Anything I'm missing here?
>
>Britton
>

reply via email to

[Prev in Thread] Current Thread [Next in Thread]