Scott Merz
2003-08-12 19:33:29 UTC
Hello everyone
This is my first post here, so if this issue has already been addressed, I
am apologizing ahead of time.
I was tasked to get all of our console C code to compile under Microsoft
Visual Studio. The code is compiled using a GCC cross compiler, so I created
a console makefile that will handle it all from the command line. The next
task was interfacing visual studio with it. This was actually fairly
straightforward, and I created a wrapper visual C++ makefile project with
custom build commands. I overrode each command with calls to a batch file
(NMAKE-BuildUtilityScript.bat) that would, in turn, invoke a Jscript file to
extract the list of source files from the Visual Studio XML based project
file (.vcproj), and write them into a text file. Now this is where the
problems arise.
The console makefile simply has to parse the text file of line delimited
source file names into a variable, so it knows what files to "build". This
should be VERY straightforward using the shell command.
srcFiles = $(shell type srcFiles.txt)
that command should populate srcFiles with a series of space delimited
filenames (since the description of shell in GNU make says that when using
shell, all carriage returns and end of line characters are converted to
spaces). However, subsequent echo calls show that srcFiles remains EMPTY,
thus the shell call is not working. Another thing, even though there is no
SHELL environment variable, 'make' sets it to sh.exe. Even if I call make
with the "-e" argument (which ignores environmental variables) and override
SHELL=%SystemRoot%\system32\cmd.exe, echoing $(SHELL) still brings up
sh.exe. This is very confusing, and I have tried everything I can think of,
and am stuck at the following avenues to place blame:
1. SHELL=sh.exe
2. Windows XP Command Shell
3. MS-DOS in General
I am wondering if when Microsoft implemented their newer XP command shell if
it doesn't support the shell function. Some pertinent information:
Running GNU Make version 3.77
Running GCC version 2.95.2
Running Windows XP version 2002 Service Pack 1
Thanks to any who help.
-Scott Merz
Scott Merz
Software Intern
The InsituGroup
www.insitugroup.net <http://www.insitugroup.net/>
This is my first post here, so if this issue has already been addressed, I
am apologizing ahead of time.
I was tasked to get all of our console C code to compile under Microsoft
Visual Studio. The code is compiled using a GCC cross compiler, so I created
a console makefile that will handle it all from the command line. The next
task was interfacing visual studio with it. This was actually fairly
straightforward, and I created a wrapper visual C++ makefile project with
custom build commands. I overrode each command with calls to a batch file
(NMAKE-BuildUtilityScript.bat) that would, in turn, invoke a Jscript file to
extract the list of source files from the Visual Studio XML based project
file (.vcproj), and write them into a text file. Now this is where the
problems arise.
The console makefile simply has to parse the text file of line delimited
source file names into a variable, so it knows what files to "build". This
should be VERY straightforward using the shell command.
srcFiles = $(shell type srcFiles.txt)
that command should populate srcFiles with a series of space delimited
filenames (since the description of shell in GNU make says that when using
shell, all carriage returns and end of line characters are converted to
spaces). However, subsequent echo calls show that srcFiles remains EMPTY,
thus the shell call is not working. Another thing, even though there is no
SHELL environment variable, 'make' sets it to sh.exe. Even if I call make
with the "-e" argument (which ignores environmental variables) and override
SHELL=%SystemRoot%\system32\cmd.exe, echoing $(SHELL) still brings up
sh.exe. This is very confusing, and I have tried everything I can think of,
and am stuck at the following avenues to place blame:
1. SHELL=sh.exe
2. Windows XP Command Shell
3. MS-DOS in General
I am wondering if when Microsoft implemented their newer XP command shell if
it doesn't support the shell function. Some pertinent information:
Running GNU Make version 3.77
Running GCC version 2.95.2
Running Windows XP version 2002 Service Pack 1
Thanks to any who help.
-Scott Merz
Scott Merz
Software Intern
The InsituGroup
www.insitugroup.net <http://www.insitugroup.net/>