summaryrefslogtreecommitdiff
path: root/mk
diff options
context:
space:
mode:
authormaya <maya@pkgsrc.org>2020-01-19 16:51:47 +0000
committermaya <maya@pkgsrc.org>2020-01-19 16:51:47 +0000
commit00d97569e61074eca6edf72a2fd41a82b2214ea4 (patch)
treef06e06d4749bfb99c760f3635140e5332c0c5ca7 /mk
parent79f8f7e18d146c6f9da740f0b9af6f0c9ab69701 (diff)
downloadpkgsrc-00d97569e61074eca6edf72a2fd41a82b2214ea4.tar.gz
Add a visible EFFECTIVE_MAKE_JOBS, a tunable resembling _MAKE_JOBS,
but is defined as 1 in the case of no jobs. No -j prefix for maximum usability. (XXX: is _DEF_VARS the right place to add it?)
Diffstat (limited to 'mk')
-rw-r--r--mk/build/build.mk12
1 files changed, 8 insertions, 4 deletions
diff --git a/mk/build/build.mk b/mk/build/build.mk
index 5bcfb2dbf43..4ba4b0f3ea6 100644
--- a/mk/build/build.mk
+++ b/mk/build/build.mk
@@ -1,4 +1,4 @@
-# $NetBSD: build.mk,v 1.28 2019/09/02 02:59:47 rillig Exp $
+# $NetBSD: build.mk,v 1.29 2020/01/19 16:51:47 maya Exp $
#
# This file defines what happens in the build phase, excluding the
# self-test, which is defined in test.mk.
@@ -38,6 +38,7 @@
# Keywords: build make
_VARGROUPS+= build
+_DEF_VARS.build= EFFECTIVE_MAKE_JOBS
_USER_VARS.build= MAKE_JOBS BUILD_ENV_SHELL
_PKG_VARS.build= MAKE_ENV MAKE_FLAGS BUILD_MAKE_FLAGS BUILD_TARGET MAKE_JOBS_SAFE
_SYS_VARS.build= BUILD_MAKE_CMD
@@ -54,11 +55,14 @@ BUILD_MAKE_CMD= \
-f ${MAKE_FILE}
.if defined(MAKE_JOBS_SAFE) && !empty(MAKE_JOBS_SAFE:M[nN][oO])
-_MAKE_JOBS= # nothing
+_MAKE_JOBS= # nothing
+EFFECTIVE_MAKE_JOBS= 1
.elif defined(MAKE_JOBS.${PKGPATH})
-_MAKE_JOBS= -j${MAKE_JOBS.${PKGPATH}}
+_MAKE_JOBS= -j${MAKE_JOBS.${PKGPATH}}
+EFFECTIVE_MAKE_JOBS= ${MAKE_JOBS.${PKGPATH}}
.elif defined(MAKE_JOBS)
-_MAKE_JOBS= -j${MAKE_JOBS}
+_MAKE_JOBS= -j${MAKE_JOBS}
+EFFECTIVE_MAKE_JOBS= ${MAKE_JOBS}
.endif
######################################################################