help-make
[Top][All Lists]
Advanced

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

Re: Re[2]: How to order make do the parallel job?


From: Yann Droneaud
Subject: Re: Re[2]: How to order make do the parallel job?
Date: Tue, 22 Dec 2015 14:02:26 +0100

Le mardi 22 décembre 2015 à 07:35 -0500, Paul Smith a écrit :
> On Tue, 2015-12-22 at 09:17 +0300, Igor Sobinov wrote:
>
> > .PHONY : build_release1
> > build_release1: $(RELEASE_TARGET)
> >         +(@cd $(RELEASE_TARGET); $(MAKE) release -j10)
> 

> Your new error is the syntax above: the "@" is a special character
> for make and cannot be inside the parenthesis.  The recipe line must
> be:
> 
>     +@(cd $(RELEASE_TARGET); $(MAKE) release -j10)
> 
> However, the parentheses here are redundant: make always runs every
> command in a subshell so there's no need for parentheses.  Also, you
> should use "&&" between the commands so that if the first one (the
> "cd") fails, make won't try to run the sub-make.  And finally, the
> "+", while it won't hurt, is not needed because you are using the
> variable $(MAKE) in the recipe so make already knows it's a submake:
> 
> address@hidden $(RELEASE_TARGET) && $(MAKE) release -j10
> 
> However, it's not a good idea to add an explicit "-j10" here.  You
> are invoking "make build_release" with the "-j10" argument so it
> should not be here.  This should just be:
> 
> address@hidden $(RELEASE_TARGET) && $(MAKE)
> 

I think -C can be used too ?

        @$(MAKE) -C $(RELEASE_TARGET)

Regards.

-- 
Yann Droneaud
OPTEYA




reply via email to

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