Stan Brown
2011-05-26 22:40:07 UTC
On my Windows XP computer, I built my web sites with makefiles in GNU
Make 3.81 under 4NT, and all was well. With Windows 7, that's TCCLE,
and unfortunately it doesn't work. The basic problem seems to be
that, although I invoke make from a TCCLE command prompt, it passes
the generated commands to cmd and not to TCCLE. Make is also pulling
environment variables from cmd and not from TCCLE.
Yes, TCCLE does set COMSPEC to "C:\Utilities\TCCLE\TCC.EXE", so there
should be no problem.
My question is this: Under Windows 7, with the command prompt being
TCCLE, how can I cause make to invoke that shell instead of cmd to
run the generated commands? Here is what I tried:
1. I tried a makefile to see what happens in the default shell:
==========================================
MYVER := $(shell ver)
all :
echo from default $$(shell): ver = [$(MYVER)]
echo from command prompt:
ver
==========================================
I get these results, showing that it's accessing cmd even though it
was run from inside TCCLE, which has COMSPEC properly set.
==========================================
echo from default $(shell): ver = [ Microsoft Windows [Version
6.1.7601]]
from default $(shell): ver = [ Microsoft Windows [Version 6.1.7601]]
echo from command prompt:
from command prompt:
ver
Microsoft Windows [Version 6.1.7601]
==========================================
2. I tried setting COMSPEC inside the file, per the documentation:
==========================================
COMSPEC = C:\Utilities\TCCLE\TCC.EXE /c
MYVER := $(shell ver)
all :
echo from default $$(shell): ver = [$(MYVER)]
echo from command prompt:
ver
==========================================
The variable is set but ignored; the "ver" command is still being
executed by cmd, not TCCLE, ans the $(shell) function is using the
same wrong shell.
==========================================
echo from default $(shell): ver = [ Microsoft Windows [Version
6.1.7601]]
from default $(shell): ver = [ Microsoft Windows [Version 6.1.7601]]
echo from command prompt:
from command prompt:
ver
Microsoft Windows [Version 6.1.7601]
==========================================
3. I tried forcing an invocation of TCCLE on every command:
==========================================
COMSPEC = C:\Utilities\TCCLE\TCC.EXE /c
MYVER := $(shell ver)
all :
$(COMSPEC) echo from default $$(shell): ver = [$(MYVER)]
$(COMSPEC) echo from command prompt:
$(COMSPEC) ver
==========================================
This does indeed invoke TCCLE, finally, but I'm sure it's at the cost
of first invoking cmd and then having *it* invoke TCCLE. Not only is
this inefficient, it's dangerous because cmd doesn't expans command
lines the same way as TCCLE.
==========================================
C:\Utilities\TCCLE\TCC.EXE /c echo from default $(shell): ver = [
Microsoft Win
dows [Version 6.1.7601]]
from default $(shell): ver = [ Microsoft Windows [Version 6.1.7601]]
C:\Utilities\TCCLE\TCC.EXE /c echo from command prompt:
from command prompt:
C:\Utilities\TCCLE\TCC.EXE /c ver
TCC LE 12.10.62 Windows 7 [Version 6.1.7601]
==========================================
4. Finally, I ruled out problems with / versus \, thusly:
==========================================
COMSPEC = C:/Utilities/TCCLE/TCC.EXE /c
MYVER := $(shell ver)
all :
echo from default $$(shell): ver = [$(MYVER)]
echo from command prompt:
ver
echo COMSPEC = [$(COMSPEC)]
==========================================
but that's not it:
==========================================
echo from default $(shell): ver = [ Microsoft Windows [Version
6.1.7601]]
from default $(shell): ver = [ Microsoft Windows [Version 6.1.7601]]
echo from command prompt:
from command prompt:
ver
Microsoft Windows [Version 6.1.7601]
==========================================
Make 3.81 under 4NT, and all was well. With Windows 7, that's TCCLE,
and unfortunately it doesn't work. The basic problem seems to be
that, although I invoke make from a TCCLE command prompt, it passes
the generated commands to cmd and not to TCCLE. Make is also pulling
environment variables from cmd and not from TCCLE.
Yes, TCCLE does set COMSPEC to "C:\Utilities\TCCLE\TCC.EXE", so there
should be no problem.
My question is this: Under Windows 7, with the command prompt being
TCCLE, how can I cause make to invoke that shell instead of cmd to
run the generated commands? Here is what I tried:
1. I tried a makefile to see what happens in the default shell:
==========================================
MYVER := $(shell ver)
all :
echo from default $$(shell): ver = [$(MYVER)]
echo from command prompt:
ver
==========================================
I get these results, showing that it's accessing cmd even though it
was run from inside TCCLE, which has COMSPEC properly set.
==========================================
echo from default $(shell): ver = [ Microsoft Windows [Version
6.1.7601]]
from default $(shell): ver = [ Microsoft Windows [Version 6.1.7601]]
echo from command prompt:
from command prompt:
ver
Microsoft Windows [Version 6.1.7601]
==========================================
2. I tried setting COMSPEC inside the file, per the documentation:
==========================================
COMSPEC = C:\Utilities\TCCLE\TCC.EXE /c
MYVER := $(shell ver)
all :
echo from default $$(shell): ver = [$(MYVER)]
echo from command prompt:
ver
==========================================
The variable is set but ignored; the "ver" command is still being
executed by cmd, not TCCLE, ans the $(shell) function is using the
same wrong shell.
==========================================
echo from default $(shell): ver = [ Microsoft Windows [Version
6.1.7601]]
from default $(shell): ver = [ Microsoft Windows [Version 6.1.7601]]
echo from command prompt:
from command prompt:
ver
Microsoft Windows [Version 6.1.7601]
==========================================
3. I tried forcing an invocation of TCCLE on every command:
==========================================
COMSPEC = C:\Utilities\TCCLE\TCC.EXE /c
MYVER := $(shell ver)
all :
$(COMSPEC) echo from default $$(shell): ver = [$(MYVER)]
$(COMSPEC) echo from command prompt:
$(COMSPEC) ver
==========================================
This does indeed invoke TCCLE, finally, but I'm sure it's at the cost
of first invoking cmd and then having *it* invoke TCCLE. Not only is
this inefficient, it's dangerous because cmd doesn't expans command
lines the same way as TCCLE.
==========================================
C:\Utilities\TCCLE\TCC.EXE /c echo from default $(shell): ver = [
Microsoft Win
dows [Version 6.1.7601]]
from default $(shell): ver = [ Microsoft Windows [Version 6.1.7601]]
C:\Utilities\TCCLE\TCC.EXE /c echo from command prompt:
from command prompt:
C:\Utilities\TCCLE\TCC.EXE /c ver
TCC LE 12.10.62 Windows 7 [Version 6.1.7601]
==========================================
4. Finally, I ruled out problems with / versus \, thusly:
==========================================
COMSPEC = C:/Utilities/TCCLE/TCC.EXE /c
MYVER := $(shell ver)
all :
echo from default $$(shell): ver = [$(MYVER)]
echo from command prompt:
ver
echo COMSPEC = [$(COMSPEC)]
==========================================
but that's not it:
==========================================
echo from default $(shell): ver = [ Microsoft Windows [Version
6.1.7601]]
from default $(shell): ver = [ Microsoft Windows [Version 6.1.7601]]
echo from command prompt:
from command prompt:
ver
Microsoft Windows [Version 6.1.7601]
==========================================
--
Stan Brown, Oak Road Systems, Tompkins County, New York, USA
http://OakRoadSystems.com
Shikata ga nai...
Stan Brown, Oak Road Systems, Tompkins County, New York, USA
http://OakRoadSystems.com
Shikata ga nai...