svn commit: r50880 - head/share/mk

Glen Barber gjb at FreeBSD.org
Tue Sep 19 14:24:00 UTC 2017


On Tue, Sep 19, 2017 at 10:03:26AM +0000, Wolfram Schneider wrote:
> Author: wosch
> Date: Tue Sep 19 10:03:26 2017
> New Revision: 50880
> URL: https://svnweb.freebsd.org/changeset/doc/50880
> 
> Log:
>   Implement workaround for a parallel doc build
>   
>   $ make p-all
>   
>   It works for the sub-directories in a given directory.
>   
>   On a standard quad core machine the build time goes down
>   from ca. 20min to 5 minutes.
>   
>   PR: 222322
> 
> Modified:
>   head/share/mk/doc.project.mk
> 
> Modified: head/share/mk/doc.project.mk
> ==============================================================================
> --- head/share/mk/doc.project.mk	Tue Sep 19 09:57:15 2017	(r50879)
> +++ head/share/mk/doc.project.mk	Tue Sep 19 10:03:26 2017	(r50880)
> @@ -104,3 +104,9 @@ DOC_LOCAL_MK=	${DOC_PREFIX}/${LANGCODE}/share/mk/doc.l
>  
>  # Subdirectory glue.
>  .include "doc.subdir.mk"
> +
> +# parallel build for target "all"
> +NCPU?= 8
> +p-all:
> +	make -V SUBDIR | sed -E 's/[ ]+$$//' | tr " " "\n" | sed -E 's/^/make -C /' | tr '\n' '\0' | xargs -0 -n1 -P${NCPU} /bin/sh -c
> +
> 

Would it be more preferable to use the number of CPUs available on the
system, instead of hard-coding a value?  Such as:

NCPU?= $$(sysctl -n hw.ncpu)

This would allow those with fewer than 8 CPUs to not need to specify
CPU=n when invoking make(1).

On an additional point, is there any reason in particular you did not
make parallel builds the default?

Glen

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://lists.freebsd.org/pipermail/svn-doc-head/attachments/20170919/9568ca80/attachment.sig>


More information about the svn-doc-head mailing list