Date: Wed, 20 Apr 2005 09:23:27 GMT From: Michael Johnson <ahze@FreeBSD.org> To: freebsd-gnats-submit@FreeBSD.org Subject: ports/80132: [PATCH] bsd.port.mk -- Add support for -j (make jobs) in do-build: Message-ID: <200504200923.j3K9NRPl059353@www.freebsd.org> Resent-Message-ID: <200504200930.j3K9UL5o047238@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 80132 >Category: ports >Synopsis: [PATCH] bsd.port.mk -- Add support for -j (make jobs) in do-build: >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Wed Apr 20 09:30:21 GMT 2005 >Closed-Date: >Last-Modified: >Originator: Michael Johnson >Release: >Organization: >Environment: >Description: This patch adds -j (make jobs) support in do-build: with the user defined knob of MAKE_JOBS (ie. MAKE_JOBS=4, would set -j4) , also ports can use MAX_JOBS (ie. MAX_JOBS=1, would set -j1 if MAX_JOBS < MAKE_JOBS) or NOMAKEJOBS and this would make MAKEJOBS empty. This patch greatly improves compile time speeds esp. if used with distcc. >How-To-Repeat: >Fix: Index: bsd.port.mk =================================================================== RCS file: /home/ncvs/ports/Mk/bsd.port.mk,v retrieving revision 1.511 diff -u -r1.511 bsd.port.mk --- bsd.port.mk 17 Mar 2005 23:22:07 -0000 1.511 +++ bsd.port.mk 20 Apr 2005 09:21:27 -0000 @@ -1412,6 +1412,21 @@ .endif .endif +.if defined(MAKE_JOBS) +.if defined(MAX_JOBS) && ${MAX_JOBS} < ${MAKE_JOBS} +MAKEJOBS= -j${MAX_JOBS} +.else +.if defined(MAKE_JOBS) +MAKEJOBS= -j${MAKE_JOBS} +.endif +.if defined(NOMAKEJOBS) +MAKEJOBS= # empty +.endif +.else +MAKEJOBS= # empty +.endif +.endif + .if defined(USE_IMAKE) && !defined(NO_INSTALL_MANPAGES) MANCOMPRESSED?= yes .else @@ -3300,12 +3315,12 @@ .if !target(do-build) do-build: .if defined(USE_GMAKE) - @(cd ${BUILD_WRKSRC}; ${SETENV} ${MAKE_ENV} ${GMAKE} ${MAKE_FLAGS} ${MAKEFILE} ${MAKE_ARGS} ${ALL_TARGET}) + @(cd ${BUILD_WRKSRC}; ${SETENV} ${MAKE_ENV} ${GMAKE} ${MAKE_FLAGS} ${MAKEFILE} ${MAKEJOBS} ${MAKE_ARGS} ${ALL_TARGET}) .else .if defined(PERL_MODBUILD) @(cd ${BUILD_WRKSRC}; ${SETENV} ${MAKE_ENV} ${PERL5} ${PL_BUILD} ${MAKE_ARGS} ${ALL_TARGET}) .else - @(cd ${BUILD_WRKSRC}; ${SETENV} ${MAKE_ENV} ${MAKE} ${MAKE_FLAGS} ${MAKEFILE} ${MAKE_ARGS} ${ALL_TARGET}) + @(cd ${BUILD_WRKSRC}; ${SETENV} ${MAKE_ENV} ${MAKE} ${MAKE_FLAGS} ${MAKEFILE} ${MAKEJOBS} ${MAKE_ARGS} ${ALL_TARGET}) .endif .endif .endif >Release-Note: >Audit-Trail: >Unformatted:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200504200923.j3K9NRPl059353>