help-make
[Top][All Lists]
Advanced

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

Re: how to use 'tcl' as SHELL?


From: Philip Guenther
Subject: Re: how to use 'tcl' as SHELL?
Date: Mon, 21 Jul 2008 20:56:51 -0600

On Mon, Jul 21, 2008 at 3:18 PM, Garrett Cooper <address@hidden> wrote:
...
> Something like this works when sh is present at least:
>
> override SHELL := sh -c "exec tclsh '$0' ${1+'$@'}"

Umm, no, no it doesn't.  If you're going to propose something weird
like that, please test it before sending your message.

$ cat Makefile
override SHELL := sh -c "exec tclsh '$0' ${1+'$@'}"
all:
        puts foo
$ gmake
puts foo
couldn't read file "": no such file or directory
gmake: *** [all] Error 1
$

The problem is this: make expects to be able to pass commands to
$SHELL on the command line, NOT as a file of commands to execute.  In
particular, when you write

all:
        puts foo

make executes "$SHELL -c 'puts foo'".  Tclsh does *NOT* have a builtin
option that makes it execute stuff from its command line instead of
reading from a file.  If you *really* wanted to use tclsh as make's
$SHELL, you would have to include a tclsh script in your package that
would accept the -c option and parse and execute the next argument as
a set of (tcl) commands.


Philip Guenther




reply via email to

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