This is the mail archive of the
cygwin
mailing list for the Cygwin project.
Re: How does make determine which shells to invoke when executing external commands?
- From: Warren Young <warren at etr-usa dot com>
- To: Cygwin-L <cygwin at cygwin dot com>
- Date: Wed, 05 Jun 2013 10:41:57 -0600
- Subject: Re: How does make determine which shells to invoke when executing external commands?
- References: <CAPzB_RzA3LBR8QKZA0NT6UJmkt6dr=qHj-s85RmY2xAd4K3KAQ at mail dot gmail dot com>
On 6/5/2013 09:32, Hua Ai wrote:
I have gone through FAQ and mailing lists but couldn't find an answer
to this.
The answer is in the GNU make docs, or in the O'Reilly book if you prefer.
Especially, this line:
@mkdir -p $(dir $@)
It seems that, for the computers where it didn't work, the makefile
always invokes the mkdir from windows (Windows 7 64bit).
That means those computers have a native Windows version of GNU make on
them, most likely the one from MinGW. MinGW GNU make is built to use
cmd.exe to interpret shell commands, not /bin/sh as Cygwin's GNU make
does by default.
The docs will further enlighten you about how the SHELL variable can
override this default behavior. I suspect "SHELL=/bin/sh" still won't
do the right thing, though, since MinGW GNU make doesn't understand
POSIX paths. Something like SHELL=c:\cygwin\bin\sh.exe *might* work.
A superior solution is to get everyone to use Cygwin make.
If you can't do that, because you don't have any influence over the
software installed on the other computers, you might have to switch to
one of the portable Makefile builders, so you can ship both POSIX and
MinGW makefiles. Bakefile (http://bakefile.org/) can do this for sure.
CMake and Scons probably can, too.
--
Problem reports: http://cygwin.com/problems.html
FAQ: http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple