Mail Archives: cygwin/2004/09/14/20:24:48
On Sep 14, 4:01pm, Dave Korn wrote:
-- Subject: Bizarre behaviour of "make --win32"
>
> It appears to be using sh.exe, regardless of the --win32 flag. But if I
> add stdout redirection to the command in question, it uses cmd.exe.
>
-- End of excerpt from "Dave Korn"
On non-Cygwin, UNIX platforms, GNU make will optimize away the shell
invocation for simple commands, which are identified by lack of known
shell metacharacters (like ">"). For example, "foo bar baz" would be
executed directly, using something like execvp(), but "foo bar > baz"
would run /bin/sh -c "foo bar > baz".
If the Makefile sets the SHELL make variable to something other than
the default /bin/sh, then this opimization is disabled: GNU make
conservatively assumes that it has no idea about the syntax for the
nonstandard shell, ignores potential metacharacters, and just always
runs $(SHELL) -c "command". This can have performance implications,
as you might imagine.
I don't know offhand what happens with --win32, but the difference in
behavior with stdout redirection that you report is probably related
to this optimization. I thought --win32 was supposed to use cmd.exe,
but I don't know what the equivalent of execvp() would be for simple
commands, or if make --win32 knows about cmd.exe metacharacters.
What makes you think that sh.exe is being used?
--
Bob
--
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ: http://cygwin.com/faq/
- Raw text -