make-w32
[Top][All Lists]
Advanced

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

Re: setting SHELL variable


From: Jonathan Baccash
Subject: Re: setting SHELL variable
Date: Fri, 29 Jul 2005 11:18:57 -0700

I just want to use cmd shell and no other shell.  Furthermore, I want
to verify in another included makefile that the SHELL has been
properly set.  Of course, verification fails, because setting the
SHELL variable did not work.  Here is another complete makefile
example:

$(warning SHELL=$(SHELL))
dummy := $(shell echo 'a|b')
SHELL := cmd.exe
export SHELL
$(warning SHELL=$(SHELL))
dummy := $(shell echo 'a|b')

.PHONY: all
all:
        echo %SHELL%
        echo 'a|b'

This is what my session looks like:

Z:\makeutil\test\t1> Z:\gnumake\win32\make.exe
Makefile:1: SHELL=C:/mks/mksnt/sh.exe
Makefile:5: SHELL=C:/mks/mksnt/sh.exe
'b'' is not recognized as an internal or external command,
operable program or batch file.
echo %SHELL%
C:/mks/mksnt/sh.exe
echo 'a|b'
'b'' is not recognized as an internal or external command,
operable program or batch file.
ake: *** [all] Error 255

As you can see, at line 5, the SHELL variable has not been updated,
but at line 6, the correct shell is spawned or simulated (compare the
error output to the non-error at line 2 -- the pipe sign is inside
single quotes, which is all part of the argument for sh.exe shell).

Then notice when executing the targets, SHELL is still set to
C:/mks/mksnt/sh.exe, but the cmd.exe shell is spawned or simulated.

Also notice that make thinks its name is "ake"... I think I remember
this bug is perhaps already fixed?

Can I reasonably expect SHELL to be set to what I want to set it to? 
Or do I need to write my own tricky make code to verify that the
correct shell is used?  I saw in the GNU make manual where it talks
about setting SHELL on Windows, and I think the behavior is not the
same as the documentation.  I am not a big fan of all the strange
behavior on Windows.

Jon.




reply via email to

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