From f77b03aa2beec7c3ab694c89a5b193bd9beb8e06 Mon Sep 17 00:00:00 2001 From: Bryan Drewery Date: Fri, 23 Jun 2017 18:26:54 +0000 Subject: [PATCH] packages: Allow actually building individual world packages in parallel. MFC after: 2 weeks Sponsored by: Dell EMC Isilon --- Makefile.inc1 | 46 ++++++++++++++++++++++++++++------------------ 1 file changed, 28 insertions(+), 18 deletions(-) diff --git a/Makefile.inc1 b/Makefile.inc1 index 1917c6ed289c..d7c4b99290d1 100644 --- a/Makefile.inc1 +++ b/Makefile.inc1 @@ -1570,24 +1570,34 @@ create-world-packages: _pkgbootstrap .PHONY awk -f ${SRCDIR}/release/scripts/mtree-to-plist.awk \ ${WSTAGEDIR}/METALOG @for plist in ${WSTAGEDIR}/*.plist; do \ - plist=$${plist##*/} ; \ - pkgname=$${plist%.plist} ; \ - sh ${SRCDIR}/release/packages/generate-ucl.sh -o $${pkgname} \ - -s ${SRCDIR} -u ${WSTAGEDIR}/$${pkgname}.ucl ; \ - done - @for plist in ${WSTAGEDIR}/*.plist; do \ - plist=$${plist##*/} ; \ - pkgname=$${plist%.plist} ; \ - awk -F\" ' \ - /^name/ { printf("===> Creating %s-", $$2); next } \ - /^version/ { print $$2; next } \ - ' ${WSTAGEDIR}/$${pkgname}.ucl ; \ - ${PKG_CMD} -o ABI_FILE=${WSTAGEDIR}/bin/sh -o ALLOW_BASE_SHLIBS=yes \ - create -M ${WSTAGEDIR}/$${pkgname}.ucl \ - -p ${WSTAGEDIR}/$${pkgname}.plist \ - -r ${WSTAGEDIR} \ - -o ${REPODIR}/$$(${PKG_CMD} -o ABI_FILE=${WSTAGEDIR}/bin/sh config ABI)/${PKG_VERSION} ; \ - done + plist=$${plist##*/} ; \ + pkgname=$${plist%.plist} ; \ + echo "_PKGS+= $${pkgname}" ; \ + done > ${WSTAGEDIR}/packages.mk + ${_+_}@cd ${.CURDIR}; \ + ${MAKE} -f Makefile.inc1 create-world-packages-jobs \ + .MAKE.JOB.PREFIX= + +.if make(create-world-packages-jobs) +.include "${WSTAGEDIR}/packages.mk" +.endif + +create-world-packages-jobs: .PHONY +.for pkgname in ${_PKGS} +create-world-packages-jobs: create-world-package-${pkgname} +create-world-package-${pkgname}: .PHONY + @sh ${SRCDIR}/release/packages/generate-ucl.sh -o ${pkgname} \ + -s ${SRCDIR} -u ${WSTAGEDIR}/${pkgname}.ucl + @awk -F\" ' \ + /^name/ { printf("===> Creating %s-", $$2); next } \ + /^version/ { print $$2; next } \ + ' ${WSTAGEDIR}/${pkgname}.ucl ; \ + ${PKG_CMD} -o ABI_FILE=${WSTAGEDIR}/bin/sh -o ALLOW_BASE_SHLIBS=yes \ + create -M ${WSTAGEDIR}/${pkgname}.ucl \ + -p ${WSTAGEDIR}/${pkgname}.plist \ + -r ${WSTAGEDIR} \ + -o ${REPODIR}/$$(${PKG_CMD} -o ABI_FILE=${WSTAGEDIR}/bin/sh config ABI)/${PKG_VERSION} +.endfor create-kernel-packages: _pkgbootstrap .PHONY .if exists(${KSTAGEDIR}/kernel.meta)