From: huott AT pinebush DOT com (Ed Huott) Subject: Re: Make SHELL variable 6 Feb 1997 13:09:19 -0800 Approved: cygnus DOT gnu-win32 AT cygnus DOT com Distribution: cygnus Message-ID: <199702061903.OAA27084.cygnus.gnu-win32@sol.pinebush.com> Original-To: smithj AT ksu DOT edu Original-cc: Lists - Cygnus GNU Win32 In-reply-to: Your message of "Wed, 05 Feb 1997 14:08:12 CST." <32F8E8AC DOT 50B1 AT ksu DOT edu> Original-Sender: owner-gnu-win32 AT cygnus DOT com In message <32F8E8AC DOT 50B1 AT ksu DOT edu>, "Jeffery G. Smith" writes: >I notice that when make executes a command it actually does a > $(SHELL) -c command > >This appears to be a GNU make thing since it happens on our standard >UNIX platforms as well. I wasn't able to find any documentation that >admitted that this -c was added or how to get rid of it. I really would >like to be able to use cmd.exe as the SHELL but the -c gets in the way. > I ran into this same exact problem and it is indeed a GNU make thing. If you browse through the .info files that come with GNU make, you'll find it documented somewhere in there. (I'm using GNU make v3.75.) My understanding of the doc was that make assumes *all* shells understand '-c' and consequently *hard codes* it to the syntax you give above. I saw no way to change this behavior. Then native win32 (sans gnu-win32 stuff) build of GNU make is set up fall back to an MSDOS mode (using batch files) for launching programs in the absence of of a Bourne/Bash style shell (sh.exe). However they don't recommend it; it hasn't seen much testing. (See the README.WIN32 in the GNU make distribution.) This whole problem is what prompted me to go out and get Cygnus' GNU Win32 bash and tools in the first place. The biggest problem I encountered with doing this was that all the rules must be written so they launch commands with Bourne shell syntax rather than cmd.exe syntax. Mostly this boiled down to quoting or escaping any backslash ('\') characters. Beyond that and ironing out a couple of other little quirks, I found this to be quite a workable solution. If you still want to use cmd.exe as your SHELL, here's another approach you might want to try. You could write a small wrapper program that just eats the initial '-c' argument and uses the remaining arguments to construct the command to be executed via a system() call. I actually did this as part of my experimentation and you'd be more than welcome to the source if you want it (~30 lines of C). One thing you'd still have to watch out for here, though, is how to handle quoted arguments. (My code doesn't handle this.) Good luck. I hope this helps. - For help on using this list, send a message to "gnu-win32-request AT cygnus DOT com" with one line of text: "help".