Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!uwm.edu!uakari.primate.wisc.edu!aplcen!haven!adm!xadmx!Leisner.Henr@xerox.com From: Leisner.Henr@xerox.com (Marty) Newsgroups: comp.unix.wizards Subject: using /bin/sh in make commands Message-ID: <21173@adm.BRL.MIL> Date: 17 Oct 89 20:23:44 GMT Sender: news@adm.BRL.MIL Lines: 32 In making a large system, I stumbled across some interesting behavior I'd like some help with. Often people have rules in makefiles of the form: DIRS=lib src 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? This seems to be somewhat unexpected when making systems (i.e. generally a make should stop when a command fails). marty ARPA: leisner.henr@xerox.com GV: leisner.henr NS: leisner:wbst139:xerox UUCP: hplabs!arisia!leisner