summaryrefslogtreecommitdiff
path: root/mk
diff options
context:
space:
mode:
authordholland <dholland@pkgsrc.org>2019-03-17 03:59:11 +0000
committerdholland <dholland@pkgsrc.org>2019-03-17 03:59:11 +0000
commit98a976c5f9ebcc364f2cc9cad887e79cf9497620 (patch)
treec08ec8a8aba9ec8feab549f9af9c940682185006 /mk
parentefbc4edb868cff34cc93a49a824a35d1224a8100 (diff)
downloadpkgsrc-98a976c5f9ebcc364f2cc9cad887e79cf9497620.tar.gz
Add support for MAKE_JOBS.pkgpath.
This allows setting MAKE_JOBS high and then setting e.g. MAKE_JOBS.emulators/qemu=2 (or some such low value) to keep it from thrashing during build. Discussed/approved on tech-pkg two months ago and then I forgot to actually commit it.
Diffstat (limited to 'mk')
-rw-r--r--mk/build/build.mk4
-rw-r--r--mk/defaults/mk.conf17
2 files changed, 16 insertions, 5 deletions
diff --git a/mk/build/build.mk b/mk/build/build.mk
index aa9dbffec9a..012cd92f67f 100644
--- a/mk/build/build.mk
+++ b/mk/build/build.mk
@@ -1,4 +1,4 @@
-# $NetBSD: build.mk,v 1.24 2018/11/30 18:38:19 rillig Exp $
+# $NetBSD: build.mk,v 1.25 2019/03/17 03:59:11 dholland Exp $
#
# This file defines what happens in the build phase, excluding the
# self-test, which is defined in test.mk.
@@ -55,6 +55,8 @@ BUILD_MAKE_CMD= \
.if defined(MAKE_JOBS_SAFE) && !empty(MAKE_JOBS_SAFE:M[nN][oO])
_MAKE_JOBS= # nothing
+.elif defined(MAKE_JOBS.${PKGPATH})
+_MAKE_JOBS= -j${MAKE_JOBS.${PKGPATH}}
.elif defined(MAKE_JOBS)
_MAKE_JOBS= -j${MAKE_JOBS}
.endif
diff --git a/mk/defaults/mk.conf b/mk/defaults/mk.conf
index fe3d998769f..17a1db3dfd1 100644
--- a/mk/defaults/mk.conf
+++ b/mk/defaults/mk.conf
@@ -1,4 +1,4 @@
-# $NetBSD: mk.conf,v 1.300 2019/02/04 09:36:41 wiz Exp $
+# $NetBSD: mk.conf,v 1.301 2019/03/17 03:59:11 dholland Exp $
#
# This file provides default values for variables that may be overridden
@@ -50,20 +50,29 @@ GZIP?= -9
# Possible: -[0-9], --fast, --best (see gzip(1))
# Default: -9
-#MAKE_JOBS= 3
+#MAKE_JOBS= 3
+#MAKE_JOBS.category/dir= 2
# When defined, specifies the maximum number of jobs ("make -j")
# that are run in parallel when building packages with the default
# do-build action. MAKE_JOBS only affects the "build" target,
# neither "test" nor "install".
#
+# May be specified on a per-package basis; any package-specific
+# value overrides the global setting. Package-specific settings are
+# by source directory, not package name, as the circumstances that
+# would lead one to make them are based on properties of sources.
+#
# Possible values: any positive integer. Useful values are around
# the number of processors on the machine.
#
# Default value: (undefined)
#
-# Warning: This is experimental. Some packages will not build with
-# this. Disabling this for an individual package can be done by
+# Warning: Some packages will not build with this. Disabling
+# parallel builds for an individual package can be done by
# setting MAKE_JOBS_SAFE=NO within the per package Makefile.
+# When doing so, please include a comment indicating what went
+# wrong so it can be crosschecked in the future after upstream
+# changes.
#OBJHOSTNAME=
# use hostname-specific object directories, e.g. work.amnesiac, work.localhost