Make problems

Bob Blean blean at rwb.esd.sgi.com
Sat Mar 17 05:08:16 AEST 1990


In article <9003051914.AA28827 at blumiris.chem.umr.edu>,
bobf at BLUMIRIS.CHEM.UMR.EDU ("Robert B. Funchess") writes:
> I finally figured out what was causing the Make problems, by comparing a 
> Makefile from ~4Dgifts with the problem one.  Apparently on some systems it
> is NOT necessary to explicitly specify SHELL=/bin/sh, that being taken as a
> given.  Irix *seems* to require this, or at least it generally works if I
> include it.  Unless of course I need the BSD-flavor install.  The real 
> problem is that there are (at least) two main kinds of unix and whatever it
> is that you need was written for the other one, no matter which one it
is that
> you have.  
> --
> 						< Bob | bobf | Funchess >
> 
> 		Stay alert!  Trust no one!  Keep your laser handy!


This is not really an Irix matter.  This is a difference between BSD make and
System V make.  In System V, "make" uses the SHELL variable to decide how to
interpret the commands in the makefile.

BSD: according to the man page on a DECstation 3100 (Ultrix):

     When invoked as make or /bin/make, the environment variable
     SHELL is ignored and /bin/sh is always used as the command
     interpreter.


In System V make, which Irix has, the man page says:

     Command lines are executed	one at a time, each by its own shell.  The
     SHELL environment variable	can be used to specify which shell make	should
     use to execute commands.  The default is /bin/sh.


Since the environment variable SHELL is generally set to be your interactive
shell, you need to arrange to have it reset if the makefile is written for
another shell.  Or, assuming you don't run "make -e", you can set SHELL in the
makefile as the /usr/people/4Dgifts/Makefile does.

(Note that it is common to use csh as your interactive shell, and so to have
the environment variable $SHELL set to /bin/csh, but to have a Makefile written
for Bourne shell.)

One way for csh users to do this is with an alias:

	alias make	'(setenv SHELL /bin/sh; exec make \!*)'



More information about the Comp.sys.sgi mailing list