Ralf Angeli <[EMAIL PROTECTED]> writes: > * David Kastrup (2005-06-09) writes: > >> Ralf Angeli <[EMAIL PROTECTED]> writes: >> >>> +DESCEND=if test -n "$(subdirs)"; then OLDPWD="`pwd`";for i in >>> ""$(subdirs);do cd $$i;echo "Descending into `pwd`";$(MAKE) >>> 'DESTDIR=$(DESTDIR)' PACKAGE=$(PACKAGE) $@ || exit $$?;cd $$OLDPWD;echo >>> "Ascending into $$OLDPWD";done;fi >>> >> >> One note here: avoid "if" in Makefile rules, rather use the >> short-circuit operators || and &&. The reason is that not all Bourne >> shells return "success" for "if false", causing "make" to bomb out. > > I guess the something like the following should work. > > DESCEND=test -n "$(subdirs)" && (OLDPWD="`pwd`";for i in ""$(subdirs);do cd > $$i;echo "Descending into `pwd`";$(MAKE) 'DESTDIR=$(DESTDIR)' > PACKAGE=$(PACKAGE) $@ || exit $$?;cd $$OLDPWD;echo "Ascending into > $$OLDPWD";done)
No, the other way round. test -z "$(subdirs)" || (... Same problem: the exit code. >> The alternative is to put in >> >> else : >> >> at the end. Yes, this is idiotic. > > "else :"? Never heard of that. : is a noop in the Bourne Shell. See (info "(autoconf)Limitations of Builtins") which will make your stomach turn... -- David Kastrup, Kriemhildstr. 15, 44793 Bochum _______________________________________________ auctex-devel mailing list [email protected] http://lists.gnu.org/mailman/listinfo/auctex-devel
