Hello. I've read the GNU Make Manual and looked around in the help
archives for anything related to this problem, but can't find anything.

I am running on Windows NT and I want my shell commands to be interpreted
by cmd.exe instead of sh.exe. I set the SHELL environment variable from 
within the makefile as follows:

######begin makefile#################
SHELL=cmd.exe

all:
        echo $(SHELL)
######end makefile###################

When I execute this makefile, it echos "C:/bin/sh.exe" instead of
cmd.exe. I have experimented with quite a few variations on this makefile,
including:

1) Setting SHELL using simple variable syntax (SHELL := ...)
                                                     ^^

2) Setting SHELL and/or MAKESHELL

3) Using the full path to cmd.exe (with backslashes and with forward
   slashes).

4) Renaming sh.exe to something else (so it isn't found)

5) Setting SHELL via the environment and then using the -e flag to make

6) Setting/unsetting/messing with the COMSPEC environment variable

...and a few other permutations, with no luck.

The only thing that comes even remotely close to the behavior I'd expect
is when I pass a SHELL definition on the make command line:

make SHELL=cmd.exe all

This will spawn cmd.exe all right, but the shell command from the makefile
isn't executed, and the cmd.exe is not closed (so I have to type 'exit'
several times after the makefile finishes to get back to my original
shell).

I am using make 3.79 compiled with VC++ 6.0 on Windows 2000.

Does anyone have any suggestions?

Thanks,
        Chad Loder



Reply via email to