delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/1997/06/27/09:55:59

From: huotte AT rpi DOT edu (Ed Huott)
Subject: Re: MAKE.EXE: /bin/sh: Command not found
27 Jun 1997 09:55:59 -0700 :
Approved: cygnus DOT gnu-win32 AT cygnus DOT com
Distribution: cygnus
Message-ID: <199706271516.LAA100412.cygnus.gnu-win32@alumni.rpi.edu>
Original-To: jpmorgan AT unm DOT edu
Original-CC: john AT ERA DOT COM, gnu-win32 AT cygnus DOT com
In-reply-to: <Pine.A41.3.96.970626173843.87692C-100000@callisto.unm.edu> (message from James Paul Morgan on Thu, 26 Jun 1997 17:42:59 -0600 (MDT))
Original-Sender: owner-gnu-win32 AT cygnus DOT com

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
"gnu-win32-request AT cygnus DOT com" with one line of text: "help".

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019