Hello list. Can someone please help me fix the
below Makefile snippet. I try to understand why the sh-script doesn't exit the makefile when make returns with !=0 exit-code.
Here is a snippet from my Makefile:

DIRS = dir1 \
dir2 # etc. a long list of dirs.

depend all clean distclean:
 rm -f make.log ; \
 _cwd=`pwd` ; \
 for d in $(DIRS) ; do \
   $(MAKE) -C $$d $@ | tee -a make.log ; \
   if [ $$? -ne 0 ]; then \
     echo "make failed with error $$?" | tee -a make.log; \
     exit 1; \
   fi; \
 cd $$_cwd ; \
 done

----------

But the 'exit' isn't called when $(MAKE) fails on a target.
Anybody see the problem?

Reply via email to