Re: .ONESHELL enhancement?
Eric Melski <[email protected]>
| Newsgroups | gmane.comp.gnu.make.devel |
|---|---|
| Message-ID | <[email protected]> |
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/