help-gnu-utils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: shell for-loop in make


From: ElChino
Subject: Re: shell for-loop in make
Date: Thu, 23 Oct 2014 21:50:35 +0200

"Bob Proulx" <bob@proulx.com> wrote:

If tee exits last then it will set the $? exit code.  I didn't try it
but I think that is your problem.  I didn't try it so I could be wrong.

You were right.

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

I actually did this before I read your reply.

Additionally that pwd save and cd restore was useless in the example
you showed.

I don't know 'sh' that well. I imagined I had to push pop the directery.

Thanks for your help!




reply via email to

[Prev in Thread] Current Thread [Next in Thread]