help-make
[Top][All Lists]
Advanced

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

How to stop make when an error occurs in a for loop?


From: Warlich, Christof
Subject: How to stop make when an error occurs in a for loop?
Date: Tue, 19 Jul 2011 15:23:08 +0200

Hi,

please consider the following example:

all:
    @for i in false true; do\
        if ! eval $$i; then\
            echo We leave the loop when $$i is called, but ...;\
            false;\
            break;\
        fi;\
    done;
    @echo ... the exit status is always $$?. So how can I cause make\
                to stop when a failure occurs inside a for loop?;
$ make
We leave the loop when false is called, but ...
... the exit status is always 0. So how can I cause make to stop when a failure 
occurs inside a for loop?

I can't find a way to get the (non-zero) exit status of a command inside
a for-loop be evaluated by make, i.e. causing it to stop when something
went wrong inside the for loop.

Any ideas?

Thanks,

Chris


reply via email to

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