Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

make: disable parallel building in subdirectory for single target only

I have a rather huge autotools-powered project that lives in a directory tree consisting of a lot of directories with subdirectories. It's got a target check (in each subdirectory as well as the main directory) that executes a whole lot of automated tests. The check target is built recursively.

Building as well as testing in parallel (via the -j option to make) works for most of the directories. There is however one directory that contains test that don't work when executed in parallel (timing sensitivity), but pass when run serially.

The question is: Is there a way to force make to build the check target serially in just this one subdirectory while building everything else in parallel?

like image 424
arne Avatar asked Jun 18 '13 15:06

arne


2 Answers

Add to your Makefile:

.NOTPARALLEL:

See the documentation of GNU make here.

like image 56
Anthony Scemama Avatar answered Nov 10 '22 20:11

Anthony Scemama


If I understood you correctly, then when you run the recursive make that builds the check target you can just pass -j1 specifically, to ensure that it runs serially:

check: ; $(MAKE) -j1 ...
like image 40
MadScientist Avatar answered Nov 10 '22 19:11

MadScientist