help-make
[Top][All Lists]
Advanced

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

Re: Sequencing targets during a build.


From: John Graham-Cumming
Subject: Re: Sequencing targets during a build.
Date: Wed, 26 Jan 2005 11:28:57 -0500

On Tue, 2005-01-25 at 22:38, Christopher Stranc wrote:
> 1.Sequencing the targets in the COMPONENTS list 2-1-slow first so it
> might be at the beginning of the list for "what to run next".  
> 
> Unfortunately the way the build is structured I cannot actually change
> when the target is first identified.

Well this is the simplest way to handle this problem.  Why can't you
change the structure so that the right order is present?

I made a simple example:

    COMPONENTS := run-2 run-1 run-5 run-10

    .PHONY: all
    all: $(COMPONENTS) ; @echo Build all

    run-1: run-2

    run-%:
        @echo Starting $@
        @sleep $*
        @echo Done $@

Some sample output:

% time make

Starting run-2
Done run-2
Starting run-1
Done run-1
Starting run-5
Done run-5
Starting run-10
Done run-10
Build all
make 0.01s user 0.02s system 0% cpu 18.127 total

% time make -j2

Starting run-2
Starting run-5
Done run-2
Starting run-10
Done run-5
Starting run-1
Done run-1
Done run-10
Build all
make -j2 0.01s user 0.02s system 0% cpu 12.243 total

Now reorder COMPONENTS so that run-10 is first:

% time make -j2

Starting run-10
Starting run-2
Done run-2
Starting run-5
Done run-5
Starting run-1
Done run-1
Done run-10
Build all
make -j2 0.02s user 0.02s system 0% cpu 10.171 total

John.
-- 
John Graham-Cumming

Home: http://www.jgc.org/
Work: http://www.electric-cloud.com/
POPFile: http://getpopfile.org/






reply via email to

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