[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: Breaking from a for loop?
From: |
David Aldrich |
Subject: |
RE: Breaking from a for loop? |
Date: |
Tue, 24 Nov 2009 11:03:45 +0000 |
Hi Philip
>Answer #1: it's just a /bin/sh 'for' loop; the shell's 'break'
>built-in works there:
Thanks very much for your answer.
I have modified my code accordingly and laid the shell script out better:
.PHONY : makedynamiclibs
makedynamiclibs :
for d in $(DYNAMIC_LIBS); do \
$(MAKE) --quiet --directory=$$d $(MAKECMDGOALS); \
if ( $$? > 0 ); \
then \
break; \
else :; fi; \
done
# EOF
All lines of the script start with one tab. I get an error:
$ make
for d in <list>; do \
make --quiet --directory=$d ; \
if ( $? > 0 ); \
then \
break; \
else :; fi; \
/bin/sh: -c: line 6: syntax error: unexpected end of file
make: *** [makedynamiclibs] Error 2
I can't see the reason for the syntax error. Can you help please?
Also, I would like to pass the command line options (e.g. -k) to the lower
level makefile in the second line of this script. How would I do that please?
Best regards
David
- make gives exit status of 0 even when compile fails, David Aldrich, 2009/11/23
- Re: make gives exit status of 0 even when compile fails, Paul Smith, 2009/11/23
- RE: make gives exit status of 0 even when compile fails, David Aldrich, 2009/11/23
- Breaking from a for loop?, David Aldrich, 2009/11/23
- Re: Breaking from a for loop?, Philip Guenther, 2009/11/23
- RE: Breaking from a for loop?,
David Aldrich <=
- RE: Breaking from a for loop?, Paul Smith, 2009/11/24
- RE: Breaking from a for loop?, David Aldrich, 2009/11/24
- RE: Breaking from a for loop?, Paul Smith, 2009/11/24
- RE: Breaking from a for loop?, David Aldrich, 2009/11/24
- RE: Breaking from a for loop?, Paul Smith, 2009/11/24
- RE: Breaking from a for loop?, David Aldrich, 2009/11/24