help-make
[Top][All Lists]
Advanced

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

Re: how to exit the parent_make immediately when get an error in submake


From: Tao T
Subject: Re: how to exit the parent_make immediately when get an error in submake
Date: Wed, 26 Nov 2008 00:40:47 -0800 (PST)

Could you show me the code in detail?
Thanks a lot

 Tao


Sam Ravnborg wrote:
> 
> On Tue, Nov 25, 2008 at 08:51:38PM +0000, Greg Chicares wrote:
>> On 2008-11-25 15:12Z, Tao T wrote:
>> > for some reason it seems more complicated to get rid of shell.
>> > do you have any suggestion to use shell? thanks~
>> > currently my command have to change to :BUILDUNITS := $(shell $(foreach
>> > unit,$(ALL_UNITS),cd $(REPOSITORY_ROOT)/units/$(unit)  && $(MAKE)
>> > $(MAKECMDGOALS) BUILD_TYPE=$(BUILD_TYPE) 1>&2;))
>> > It looks more complicated.
>> 
>> The original question was how to stop on the first error. That's
>> the normal behavior of 'make'. But the $(shell) command simply
>> passes a string to a shell, and 'make' doesn't know what that
>> shell is doing until it returns. So, if you really want to use
>> $(shell) this way, you have to write the command so that it
>> stops on error. I guess you could write '&&' instead of ';', and
>> do something about the last '&&', e.g. add 'true' at the end:
>>   $(shell command0 && command1 && ... && command99 && true)
> 
> I usually uses "set -e; bla; bla" to exit on first error in a shell
> command.
> That should work here too.
> 
>       Sam
> 
> 
> _______________________________________________
> Help-make mailing list
> address@hidden
> http://lists.gnu.org/mailman/listinfo/help-make
> 
> 

-- 
View this message in context: 
http://www.nabble.com/how-to-exit-the-parent_make-immediately-when-get-an-error-in-submake-tp20660308p20696758.html
Sent from the Gnu - Make - Help mailing list archive at Nabble.com.





reply via email to

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