Discussion:
TCCLE and Gnu Make
(too old to reply)
Stan Brown
2011-05-26 22:40:07 UTC
Permalink
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]
==========================================
--
Stan Brown, Oak Road Systems, Tompkins County, New York, USA
http://OakRoadSystems.com
Shikata ga nai...
E. S. Fabian
2011-05-27 01:38:21 UTC
Permalink
Stan Brown:

| 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.
...
I would check the GNU Make source code - how does it invoke the command
processor? Most likely it calls the Standard C RTL function "system()". The
issue is: how is that call implemented? If the RTL is statically linked,
presumably COMSPEC is evaluated to determine which program to execute.
However, it may instead call a Windows API, which behaves differently on
Win7 than it does on WinXP. You may need to hide the real CMD.EXE, and
replace it with TCC.EXE when running make... At least that can be done with
directory manipulation, instead of actual file copying.

| Shikata ga nai...

ganaj (Hungarian) = dung (English)
No idea what "ga nai" means in Japanese!
--
HTH, Steve
Henrik Carlqvist
2011-05-27 06:18:21 UTC
Permalink
Post by Stan Brown
Yes, TCCLE does set COMSPEC to "C:\Utilities\TCCLE\TCC.EXE", so there
should be no problem.
I do not have much experience from make in Windows, but did you try to set
the SHELL variable in your Makefile?
http://www.gnu.org/s/hello/manual/make/Choosing-the-Shell.html

The above page says that COMSPEC is used on "MS-DOS", is Windows 7 still
considered to be "MS-DOS"?

regards Henrik
--
The address in the header is only to prevent spam. My real address is:
hc123(at)poolhem.se Examples of addresses which go to spammers:
***@localhost ***@localhost
Laurent Jumet
2011-05-27 08:09:19 UTC
Permalink
Hello Henrik !
Post by Henrik Carlqvist
Post by Stan Brown
Yes, TCCLE does set COMSPEC to "C:\Utilities\TCCLE\TCC.EXE", so there
should be no problem.
I do not have much experience from make in Windows, but did you try to set
the SHELL variable in your Makefile?
http://www.gnu.org/s/hello/manual/make/Choosing-the-Shell.html
The above page says that COMSPEC is used on "MS-DOS", is Windows 7 still
considered to be "MS-DOS"?
From that moment you are in a TCC shell, the COMSPEC variable indicates where the command you type in will be directed.
If a command is redirected to another command interpreter (CMD.EXE), that means it exited somewere. May be have a look to 1st and 2nd command interpreters if nested.

I don't use W7 but I'm used with 4dos since early versions and never noticed that a command in 4DOS called another shell that the one defined in COMSPEC.
--
Laurent Jumet - Point de Chat, Liège, BELGIUM
KeyID: 0xCFAF704C
[Restore address to laurent.jumet for e-mail reply.]
Stan Brown
2011-05-30 17:35:02 UTC
Permalink
Post by Henrik Carlqvist
Post by Stan Brown
Yes, TCCLE does set COMSPEC to "C:\Utilities\TCCLE\TCC.EXE", so there
should be no problem.
I do not have much experience from make in Windows, but did you try to set
the SHELL variable in your Makefile?
http://www.gnu.org/s/hello/manual/make/Choosing-the-Shell.html
Yes, I followed those instructions before posting.
Post by Henrik Carlqvist
The above page says that COMSPEC is used on "MS-DOS", is Windows 7 still
considered to be "MS-DOS"?
Officially no, but most people still use "DOS" for the command prompt
of any Windows version.
--
Stan Brown, Oak Road Systems, Tompkins County, New York, USA
http://OakRoadSystems.com
Shikata ga nai...
Kenny McCormack
2011-07-19 22:30:10 UTC
Permalink
In article <***@news.individual.net>,
Stan Brown <***@fastmail.fm> wrote:
...
Post by Stan Brown
Post by Henrik Carlqvist
The above page says that COMSPEC is used on "MS-DOS", is Windows 7 still
considered to be "MS-DOS"?
Officially no, but most people still use "DOS" for the command prompt
of any Windows version.
Quite so. In fact, I know someone who uses "DOS" to refer to *any* command
prompt (including, e.g., those on Unix systems).
--
One of the best lines I've heard lately:

Obama could cure cancer tomorrow, and the Republicans would be
complaining that he had ruined the pharmaceutical business.

(Heard on Stephanie Miller = but the sad thing is that there is an awful lot
of direct truth in it. We've constructed an economy in which eliminating
cancer would be a horrible disaster. There are many other such examples.)
Steve Fabian
2011-07-19 23:53:46 UTC
Permalink
Kenny McCormack wrote:
| Quite so. In fact, I know someone who uses "DOS" to refer to *any*
| command prompt (including, e.g., those on Unix systems).

... in complete ignorance! DOS = Disk Operating System, nothing whatever to
do with command processing. Most commonly used family of DOS-s today is MS
Windows.

Most OS-s, including DOS-s, also provide one or more command processors,
programs that read commands from a device, interpret them, and perform the
requested action. "Command prompt" is not a progrm, it is a string displayed
on an interactive terminal to indicate it is ready to receive input. In the
*nix world, in accordance with its policy of using some analogy to denote
its various elements, instead of descriptive, plain language words, uses
"shell" (as in eggshell) for its command processors, and "kernel" for the OS
proper.

Using "command prompt" for "command processor" is like referring to an
automobile as an "ignition key".
--
Steve
Stan Brown
2011-05-29 15:19:56 UTC
Permalink
Thanks to those who responded. Perhaps it's because I'm recovering
from surgery, but I opted to take the quick-and-dirty way out. I
wrote a script that adds a -n to the 'make' arguments, pipes the
result into a batch file, and executes the file.
--
Stan Brown, Oak Road Systems, Tompkins County, New York, USA
http://OakRoadSystems.com
Shikata ga nai...
Loading...