make-alpha
[Top][All Lists]
Advanced

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

Re: .ONESHELL enhancement?


From: Eric Melski
Subject: Re: .ONESHELL enhancement?
Date: Tue, 22 Sep 2009 22:43:00 -0700
User-agent: Thunderbird 2.0.0.23 (X11/20090817)

Matt McCutchen wrote:

But note the following in the standard:

The single-shell method has the advantages in [...] the lack of a
requirement for many continued lines.

So they are viewing the command recipe as a single shell script, and
constructs like the following would be legal:

foo: bar
        if test -s $<
        then
                echo 'nonempty' >$@
        else
                echo 'empty' >$@
        fi

I assumed that this was the intended use of .ONESHELL. If you imagine that the command recipe is written to a temporary file and invoked as, eg, "sh script.sh" when .ONESHELL is enabled, it would allow you to use arbitrary interpreters as your shell. For example:

.ONESHELL:
SHELL=/bin/perl
all:
        print "foo\n";
        print "bar\n";

This wouldn't work with the "concatenate with &&" proposal.

Best regards,

Eric Melski
http://blog.electric-cloud.com/





reply via email to

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