help-make
[Top][All Lists]
Advanced

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

Re: question about parallel optimzation


From: Paul Smith
Subject: Re: question about parallel optimzation
Date: Wed, 13 Apr 2011 21:52:50 -0400

On Wed, 2011-04-13 at 16:30 +0300, Oleksandr Gavenko wrote:
> parallel-build:
>       make -C $(dir1) & make -C $(dir2) &

Note: _never_ use the literal string "make" in a recipe.  Always use
$(MAKE).

> Above example have disadvantage as main Make do not wait for spawned 
> child processes.

You should instead write it as something like:

        build: $(dir1) $(dir2)
        $(dir1) $(dir2):
                $(MAKE) -C $@
        .PHONY: build $(dir1) $(dir2)

-- 
-------------------------------------------------------------------------------
 Paul D. Smith <address@hidden>          Find some GNU make tips at:
 http://www.gnu.org                      http://make.mad-scientist.net
 "Please remain calm...I may be mad, but I am a professional." --Mad Scientist




reply via email to

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