bug-make
[Top][All Lists]
Advanced

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

Parallel Build, but Not for the Command-Line Targets.


From: Ralph Corderoy
Subject: Parallel Build, but Not for the Command-Line Targets.
Date: Sat, 23 Aug 2014 16:25:21 +0100

Hi,

I find it odd that -j breaks the idiomatic `make clean all check
install'.  Consider

    $ cat makefile
    #! /usr/bin/make -f

    SHELL = /bin/bash

    all:
            sleep 0.$$((RANDOM % 10)) && echo all

    clean::
            sleep 0.$$((RANDOM % 10)) && echo clean

    check::
            sleep 0.$$((RANDOM % 10)) && echo check

    install::
            sleep 0.$$((RANDOM % 10)) && echo install

Everything is normally slow, but correct.

    $ make -s clean all check install
    clean
    all
    check
    install
    $

I want the more faster parallel, but still correct, so try

    $ make -sj clean all check install
    all
    install
    check
    clean
    $

It seems a design flaw that I must

    make -sj clean && make -sj all && make -sj check && make -sj install

or the icky

    eval 'make -sj '{clean,all,check,install}' &&' :

How do I tell make that the targets I explicitly name, which don't
depend on one another, should be built sequentially, but parallelism may
be used in building them?

In looking at other makes, I see pmake/bmake has .WAIT and .ORDER;
http://manned.org/pmake.1  But I'm after something at the command line
that keeps things brief, e.g. `make -sJ ...'.

Cheers, Ralph.



reply via email to

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