[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: using if statement
From: |
Eli Zaretskii |
Subject: |
Re: using if statement |
Date: |
Fri, 04 May 2007 13:50:32 +0300 |
> Date: Thu, 3 May 2007 18:58:46 +0530
> From: "Satish Somasundaram" <address@hidden>
>
> I have an recursive make file to invoke all Makefiles in the
> subdirectories. But i want the execution to stop when we encounter an error
> in any of the sub directories. I thought of using if [ $? -ne 0 ] trap .But
> i belive it wont work, since Makefile already has $? defined for a different
> cause. Can someone help me out with this.
>
> all:
>
> for dir in `$(SUB_DIRS)`; do \
> $(MAKE) -C $$dir; \
> done
Does the following (100% untested) modification work?
for dir in `$(SUB_DIRS)`; do \
$(MAKE) -C $$dir || (echo "ERROR" && exit 1); \
done
- using if statement, Satish Somasundaram, 2007/05/04
- Re: using if statement,
Eli Zaretskii <=