help-make
[Top][All Lists]
Advanced

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

Re: make manual and 5.3.1 Using One Shell


From: Paul Smith
Subject: Re: make manual and 5.3.1 Using One Shell
Date: Sat, 01 Jan 2011 18:34:45 -0500

On Tue, 2010-12-28 at 22:24 -0800, Philip Guenther wrote:
> On Tue, Dec 28, 2010 at 9:59 PM, ali hagigat <address@hidden> wrote:

> However, some other so-called "scripting" languages do treat newline
> uniquely, such that there a scripts you cannot write without using
> literal newlines.  For example, that's true of csh.  Without
> .ONESHELL, you cannot write those scripts as recipes.  With .ONESHELL,
> you can.

Actually, .ONESHELL is also useful for those programming languages which
do NOT require or allow backslashes before newlines, for example Perl.
In languages like this you MUST write your entire script in one physical
line, rather than using multiple physical lines combined with
backslash/newline pairs into logical lines.  .ONESHELL solves this
problem.

And there are other advantages to running the entire script in a single
shell, including some performance advantages (which can be somewhat
mitigated, in most cases, by careful script writing) and other more
esoteric advantages.

> So, .ONESHELL may be more useful or interesting to someone who is
> interested in setting SHELL=/bin/csh or similar.

Setting SHELL=/bin/csh is NEVER a good idea.  csh is quite simply
totally unsuited to be used as the value of SHELL, at least with GNU
make.

For one thing, it does some very dodgy things with open file descriptors
which utterly destroys the ability to use the parallel jobserver
capability of GNU make.

> > Another question is weather i can use newline after each command for 
> > /bin/sh?
> > In make 3.81, it must see <tab> character at the beginning of each
> > line or it complains.

In addition to Philip's reply note that .ONESHELL is introduced in GNU
make 3.82, to be clear.

-- 
-------------------------------------------------------------------------------
 Paul D. Smith <address@hidden>          Find some GNU make tips at:
 http://www.gnu.org                      http://make.mad-scientist.net
 "Please remain calm...I may be mad, but I am a professional." --Mad Scientist




reply via email to

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