File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -15,6 +15,7 @@ CFLAGS += ${EXTRA_CFLAGS}
1515CXXFLAGS += ${EXTRA_CXXFLAGS}
1616LDFLAGS += $(EXTRA_LDFLAGS )
1717MACHINE ?= $(shell uname -m)
18+ NPROC ?= $(shell nproc)
1819ARFLAGS = ${EXTRA_ARFLAGS} rs
1920STRIPFLAGS = -S -x
2021
@@ -917,11 +918,13 @@ prioritize_long_running_tests = \
917918 | sed 's/^[.0-9]* //'
918919
919920# "make check" uses
920- # Run with "make J=1 check" to disable parallelism in "make check".
921- # Run with "make J=200% check" to run two parallel jobs per core.
922- # The default is to run one job per core (J=100%).
923- # See "man parallel" for its "-j ..." option.
924- J ?= 100%
921+ # Run with "make J=1 check" to disable parallelism in "make check" or (Docker) container builds.
922+ # Run with "make J=$((`nproc`*2)) check" to run two parallel jobs per core.
923+ # The default is to run one job per core, but leave one core free for the OS, i.e.: J=$((`nproc`-1)).
924+ # This is used both to inform GNU `parrallel` of the number of parallel jobs to execute,
925+ # and also as the number of jobs for Make when executed in (Docker) containers
926+ # See "man parallel" and "man make" for their "-j ..." option syntax.
927+ J ?= $(shell expr $(NPROC ) - 1)
925928
926929# Use this regexp to select the subset of tests whose names match.
927930tests-regexp = .
You can’t perform that action at this time.
0 commit comments