diff options
author | reed <reed> | 2006-10-05 23:35:23 +0000 |
---|---|---|
committer | reed <reed> | 2006-10-05 23:35:23 +0000 |
commit | 398497eafbb59ef231b748969db71a474a8f4aee (patch) | |
tree | 5af7e6ee6b35e946ece7549d76b2cf18b93b839c /mk/build | |
parent | 7a248a8ef47b3816254c29da92a6d946dbc7f511 (diff) | |
download | pkgsrc-398497eafbb59ef231b748969db71a474a8f4aee.tar.gz |
Add experimental support for -j jobs building in the build
target.
MAKE_JOBS is undefined by default. You can test this by setting
in mk.conf: MAKE_JOBS=5 for example.
Some package just won't build correctly with this -- these individual
packages can set MAKE_JOBS_SAFE=no to disable it.
This is based on discussion from last December 2005. Some pkgsrc
users are using ideas like this.
Note I have been using this since December 2005 on various single
processor and multiprocessor systems. (Once I kept some stats on
performance but have misplaced that now.) I haved tested this with
many packages (but not a bulk build) on Linux, NetBSD and DragonFly.
This commit doesn't include the commits for the MAKE_JOB_SAFE. As
this is experimental it needs more testing. Some examples of problems
are: comms/lrzsz, databases/gramps2, editors/vim, graphics/MesaLib,
graphics/netpbm, net/bind9, print/ghostscript-esp, textproc/libxml,
and www/lynx.
Diffstat (limited to 'mk/build')
-rw-r--r-- | mk/build/build.mk | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/mk/build/build.mk b/mk/build/build.mk index 4bdb931f579..c16acd23eec 100644 --- a/mk/build/build.mk +++ b/mk/build/build.mk @@ -1,4 +1,4 @@ -# $NetBSD: build.mk,v 1.6 2006/09/09 02:35:13 obache Exp $ +# $NetBSD: build.mk,v 1.7 2006/10/05 23:35:23 reed Exp $ # # BUILD_MAKE_FLAGS is the list of arguments that is passed to the make # process. @@ -9,6 +9,12 @@ BUILD_MAKE_FLAGS?= ${MAKE_FLAGS} BUILD_TARGET?= all +.if defined(MAKE_JOBS_SAFE) && !empty(MAKE_JOBS_SAFE:M[nN][oO]) +_MAKE_JOBS= # nothing +.elif defined(MAKE_JOBS) +_MAKE_JOBS= -j${MAKE_JOBS} +.endif + ###################################################################### ### build (PUBLIC) ###################################################################### @@ -96,8 +102,8 @@ do-build: . for _dir_ in ${BUILD_DIRS} ${_PKG_SILENT}${_PKG_DEBUG}${_ULIMIT_CMD} \ cd ${WRKSRC} && cd ${_dir_} && \ - ${SETENV} ${MAKE_ENV} ${MAKE_PROGRAM} ${BUILD_MAKE_FLAGS} \ - -f ${MAKE_FILE} ${BUILD_TARGET} + ${SETENV} ${MAKE_ENV} ${MAKE_PROGRAM} ${_MAKE_JOBS} \ + ${BUILD_MAKE_FLAGS} -f ${MAKE_FILE} ${BUILD_TARGET} . endfor .endif |