[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: make and cygwin issue

From: Leeuwesteijn,Joost
Subject: RE: make and cygwin issue
Date: Thu, 27 Apr 2006 08:19:06 +0200

Hi Luoyi,

I believe make uses sh when it's in the PATH. You're trying to do 'type
hello' which is a cmd.exe command, sh doesn't know 'type'. When you rename
sh to sh.bak it does use cmd.exe and type succeeds.

You could use external commands to do the work. If you use 'cat hello' it
might work in both cases. Internal commands have some advantages though but
it's less portable. And cmd.exe's echo is just horrible :-)

Also, sh might use a different path if it reads some .profile or .rc files.
You might want to check that by displaying the PATH from the makefile.
'$(info $(PATH))' could even give a different result than 'echo $(PATH)' I
guess, not sure. Does $(info ...) use SHELL and an extra process to display
it's info or is it an internal print command that displays make's PATH (from

Check the manual for the SHELL variable. I explicitly set SHELL to cmd.exe
in my makefile to make sure cmd.exe is used. Not sure if it's overruled if
you have a sh in your PATH, I'll check that in a minute.

But if anyone has a standalone, native, Win32 bash.exe please let me know
:-) (Cygwin etc. is not an option in my case.)

Good luck!


-----Original Message-----
From: luoyi [mailto:address@hidden 
Sent: donderdag 27 april 2006 7:03
To: address@hidden
Subject: make and cygwin issue

Hi, after I installed cygwin, I found some strange behavior with make, hope
you can help!

my cygwin dir is : d:\cygwin
F:\maketest>echo %PATH%
Files\Editplus 2;D:\texmf\miktex\bin;d:\ora90\bin;C:\Program=20
\bin;E:\LAMP\Perl\bin;D:\Program Files\doxygen\bin;D:\Program=20
Files\svn\bin;;C:\Program Files\Common Files\GTK\2.0\bin;C:\Program=20

F:\maketest>type hello
hello, world!

F:\maketest>type makefile
        type hello

type hello
process_begin: CreateProcess((null), type hello, ...) failed.
make (e=3D2): =CF=B5=CD=B3=D5=D2=B2=BB=B5=BD=D6=B8=B6=A8=B5=C4=CE=C4=BC=FE=
make: *** [all] Error 2

and after I rename d:\cygwin\bin\sh.exe to sh.exe.bak, then make can do t=
F:\maketest>rename d:\cygwin\bin\sh.exe sh.exe.bak

type hello
hello, world!

can anyone explain it here ?

reply via email to

[Prev in Thread] Current Thread [Next in Thread]