Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!ncar!ames!pacbell!indetech!david From: david@indetech.com (David Kuder) Newsgroups: comp.unix.wizards Subject: Re: using /bin/sh in make commands Message-ID: <1989Oct18.230833.5307@indetech.com> Date: 18 Oct 89 23:08:33 GMT References: <21173@adm.BRL.MIL> Reply-To: david@indetech.UUCP (David Kuder) Organization: Independence Technologies, Inc. Fremont, CA Lines: 28 In article <21173@adm.BRL.MIL> Leisner.Henr@xerox.com (Marty) writes: >Often people have rules in makefiles of the form: foo: for i in $(DIRS); do \ (cd $$i; $(MAKE) foo); \ done >It seems if one of the sub-makes fails, the shell loop continues. >The Bourne shell has a -e flag to exit immediately on errors. >Unfortunately a line like: SHELL=/bin/sh -e >doesn't work. (make tries to exec "/bin/sh -e"). >Is there a good way to get the functionality I'm looking for without having >to hack up all the makefiles? Which make are you using? There are way too many of these beasts. However, on the three that I have at hand, SunOS4, Sys5.3, UCB4.3 (the last two are Pyramid versions), a "make foo" stops as soon as one of the sub makes fails. If you must avoid changing the makefile (arguably broken) if you run the make under a Bourne in which a 'set -e' has been done then the shells started by the make will inherit it. I can't test this but it may work. -- David A. Kuder Comp.lang.perl, the time is now! 415 438-2003 david@indetech.com {uunet,sun,sharkey,pacbell}!indetech!david