Path: utzoo!attcan!utgpu!watmath!iuvax!purdue!haven!mimsy!chris
From: chris@mimsy.UUCP (Chris Torek)
Newsgroups: comp.unix.questions
Subject: SysV make (was YAPQ (yet another prompt question))
Message-ID: <19017@mimsy.UUCP>
Date: 11 Aug 89 20:07:11 GMT
References: <1356@unhd.unh.UUCP> <1157@mitisft.Convergent.COM> <2354@auspex.auspex.com>
Organization: U of Maryland, Dept. of Computer Science, Coll. Pk., MD 20742
Lines: 41

>>If you do use the SHELL trick, remember to set your SHELL variable back after
>>running make ....

In article <2354@auspex.auspex.com> guy@auspex.auspex.com (Guy Harris) writes:
>Or set it in the Makefile instead, and save yourself (and anybody else
>running "make" with that Makefile) the trouble of remembering to set it
>before running "make" and set it back after doing so.

Or better yet, rip the bogosity out of make in the first place.  It is
(somewhat) all right for make to use ${SHELL} as the shell to run
commands in the makefile, but it is then *not* all right for it to
arbitrarily import $SHELL from the environment.  J. Random User's login
shell has very little to do with the shell that should be used to run
make recipies.

If you are stuck with the SysV make and its bogus import (either because
you have no source code, or for some reason cannot modify it), you can
write your own `make' shell script that runs the real `make' but with
SHELL=/bin/sh:

	: import dependencies from .depend if appropriate
	: just like 4.3BSD-tahoe
	if [ -f .depend ]; then
		if [ -f makefile ]; then
			f="-f makefile -f .depend"
		else
			f="-f Makefile -f .depend"
		fi
		for i do
			case "$i" in -f*) f=;; esac
		done
	else
		f=
	fi

	SHELL=/bin/sh; export SHELL
	: ${MACHINE=`machine`}		# optional
	exec /bin/make $f ${1+"$@"}
-- 
In-Real-Life: Chris Torek, Univ of MD Comp Sci Dept (+1 301 454 7163)
Domain:	chris@mimsy.umd.edu	Path:	uunet!mimsy!chris