Subject: Re: MAKE.EXE: /bin/sh: Command not found
From: [email-masked] (Ed Huott)

27 Jun 1997 09:55:59 -0700
Approved: [email-masked]
Distribution: cygnus
Message-ID: <[email-masked]>
Original-To: [email-masked]
Original-CC: [email-masked], [email-masked]
In-reply-to: <[email-masked]> (message from James Paul Morgan on Thu, 26 Jun 1997 17:42:59 -0600 (MDT))
Original-Sender: [email-masked]

James Paul Morgan wrote:
> On Thu, 26 Jun 1997, John E Hein wrote:
> 
> > 
> > I am running under Windows 95 (command.com... not bash).
> > When I run make, I get the following error:
> > 
> > MAKE.EXE: /bin/sh: Command not found
> > 
> 
> Make expects to find that /bin/sh program.  It's not something you can get
> around.  If you want to use make from outside of bash, make a C:\bin and
> put a copy of sh.exe in it.  (Assuming your running off of C-drive.) 
> 
> If your files are on the network at G:\whatever, then I believe (but am
> not sure) that make will look for G:\bin\sh.exe.
> 
> I run under Win'95 as well, and have not found any way around this.  Even
> if sh.exe is somewhere else on the path, make looks for it in /bin.
> 
> If you were running out of bash, you could mount the /bin as wherever your
> sh.exe is located.
> 

The native Windows version of GNU make understands drive letters, so
you can define the SHELL variable in make as:

  SHELL = c:/bin/sh

(Make on Windows understands both '/' and '\' as path separators; I
tend to use '/' since I often write Makefiles that will be used on
both Unix and Windows platforms.)

I believe (though I'm not 100% positive) that make will use the search
path if you don't specify a full path for the SHELL variable.  E.g:

  SHELL = sh

BTW, someone also asked why SHELL is not inherited from the
environment.  Here is an excerpt from the make info file (make.info)
that explains why:

     Unlike most variables, the variable `SHELL' is never set from the
  environment.  This is because the `SHELL' environment variable is used
  to specify your personal choice of shell program for interactive use.
  It would be very bad for personal choices like this to affect the
  functioning of makefiles.  *Note Variables from the Environment:
  Environment.

The info file goes into more of discussion of the interaction of the
shell and make file rules, but the upshot is that those rules are
really input into an interpreter (the shell).  And you don't want any
ambiguity about the shell you use to run your program (rules).

<ED>
-
For help on using this list (especially unsubscribing), send a message to
"[email-masked]" with one line of text: "help".