how to ask Make to only execute one target after the end of another when using multicore

0

UPDATED

When you run make with the -j option to use multicore, or place each requesting target on a core, it does not respect the order being executed simultaneously.

For example

make Object1 Object2 -j4

It will execute the Objeto1 and the targets associated with it simultaneously Objeto2 and the targets associated with it, if for any reason one of the targets interferes with the product that will be used by the others running will have a conflict. p>

At the moment what I have had as a problem is connected to target clean, which sometimes clears an object that was created.

The use of so-called sequences as make Objeto1 && make Objeto2 does not let me take advantage of the multi-processor feature, which would be the same as calling the make command without the -j4 key, that is, it would be the same as call make Objeto1 Objeto2

    
asked by anonymous 08.10.2016 / 13:39

1 answer

0

Run the make sequentially:

make -j4 clean; make -j4 all

Update:

You can do something like this:

all: clean real_all
    @echo ended all

clean:
    @echo cleaning...

real_all: target1 target2 ...
    @echo ended real_all

target1: ...
    ...
    @echo ended target1

target2: ...
    ...
    @echo ended target2

I think it's gambiarra, I think it's best to run sequentially as I showed above.

    
08.10.2016 / 15:41