get the number of max_jobs from the command line args as well,

e..g:

$ make -j16 p-all
This commit is contained in:
Wolfram Schneider 2017-09-20 09:28:40 +00:00
parent 43d98be176
commit b814de5aaf
Notes: svn2git 2020-12-08 03:00:23 +00:00
svn path=/head/; revision=50889

View file

@ -106,9 +106,9 @@ DOC_LOCAL_MK= ${DOC_PREFIX}/${LANGCODE}/share/mk/doc.local.mk
.include "doc.subdir.mk"
# parallel build for target "all" and "clean"
NCPU?= 8
NCPU?= ${.MAKE.JOBS}
p-all p-clean:
make -V SUBDIR | sed -E 's/[ ]+$$//' | tr " " "\n" | \
sed -E 's/^/make -C /; s/$$/ ${.TARGET:S/^p-//}/' | \
tr '\n' '\0' | xargs -0 -n1 -P${NCPU} /bin/sh -c
tr '\n' '\0' | xargs -0 -n1 -P${NCPU:S/^$$/8/} /bin/sh -c