[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Re[2]: How to order make do the parallel job?
From: |
Paul Smith |
Subject: |
Re: Re[2]: How to order make do the parallel job? |
Date: |
Tue, 22 Dec 2015 07:35:34 -0500 |
On Tue, 2015-12-22 at 09:17 +0300, Igor Sobinov wrote:
> My OS is RHEL 6.6, make version is 3.81
>
> I used CMake to generate makefiles, only the first makefile is
> manually created. The command to execute is:
>
> .PHONY : build_release1
> build_release1: $(RELEASE_TARGET)
> +(@cd $(RELEASE_TARGET); $(MAKE) release -j10)
Please always CC the mailing list rather than replying to individuals
directly.
When reporting that a command fails always include the exact command
line you invoked and the error messages (plus maybe a few lines of
output for context).
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:
@cd $(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:
@cd $(RELEASE_TARGET) && $(MAKE)
and that's all.