My take at improving the universe: allow the worlds to be

built in parallel.  Examples:

make universe
	Build worlds sequentially, each world sequentially.

make universe JFLAG=-j4
	Build worlds sequentially, each world in parallel.

make -j4 universe
make -j4 universe JFLAG=-j2
	Build four worlds in parallel, each world will be
	built in parallel too.  World parallelization is
	set to four in the first synopsis, and to two in
	the second.

make -j4 universe JFLAG=-B
	Build worlds in parallel, each world sequentially.

("world" == buildworld followed by buildkernels.)

Prayers:	obrien, phk
This commit is contained in:
Ruslan Ermilov 2004-08-18 07:17:01 +00:00
parent 8e244f403d
commit d18c990625

View File

@ -150,10 +150,9 @@ ${TGTS}:
# Set a reasonable default # Set a reasonable default
.MAIN: all .MAIN: all
.if defined(HISTORICAL_MAKE_WORLD) || defined(DESTDIR)
.if make(world)
STARTTIME!= LC_ALL=C date STARTTIME!= LC_ALL=C date
.endif
.if defined(HISTORICAL_MAKE_WORLD) || defined(DESTDIR)
# #
# world # world
# #
@ -248,16 +247,20 @@ make: .PHONY
# universe # universe
# #
# Attempt to rebuild *everything* for all supported architectures, # Attempt to rebuild *everything* for all supported architectures,
# with reasonable chance of success, regardless of how old your # with a reasonable chance of success, regardless of how old your
# existing system is. # existing system is.
# #
i386_mach= pc98 universe: universe_prologue
universe: universe_prologue:
@echo "--------------------------------------------------------------" @echo "--------------------------------------------------------------"
@echo ">>> make universe started on ${STARTTIME}" @echo ">>> make universe started on ${STARTTIME}"
@echo "--------------------------------------------------------------" @echo "--------------------------------------------------------------"
.for arch in i386 sparc64 alpha ia64 amd64 .for target in i386 i386:pc98 sparc64 alpha ia64 amd64
.for mach in ${arch} ${${arch}_mach} .for arch in ${target:C/:.*$//}
.for mach in ${target:C/^.*://}
universe: universe_${mach}
.ORDER: universe_prologue universe_${mach} universe_epilogue
universe_${mach}:
@echo ">> ${mach} started on `LC_ALL=C date`" @echo ">> ${mach} started on `LC_ALL=C date`"
-cd ${.CURDIR} && ${MAKE} ${JFLAG} buildworld \ -cd ${.CURDIR} && ${MAKE} ${JFLAG} buildworld \
TARGET_ARCH=${arch} TARGET=${mach} \ TARGET_ARCH=${arch} TARGET=${mach} \
@ -268,10 +271,13 @@ universe:
-cd ${.CURDIR}/sys/${mach}/conf && ${MAKE} LINT \ -cd ${.CURDIR}/sys/${mach}/conf && ${MAKE} LINT \
> ${.CURDIR}/_.${mach}.makeLINT 2>&1 > ${.CURDIR}/_.${mach}.makeLINT 2>&1
.endif .endif
cd ${.CURDIR} && ${MAKE} ${JFLAG} buildkernels TARGET_ARCH=${arch} TARGET=${mach} cd ${.CURDIR} && ${MAKE} buildkernels TARGET_ARCH=${arch} TARGET=${mach}
@echo ">> ${mach} completed on `LC_ALL=C date`" @echo ">> ${mach} completed on `LC_ALL=C date`"
.endfor .endfor
.endfor .endfor
.endfor
universe: universe_epilogue
universe_epilogue:
@echo "--------------------------------------------------------------" @echo "--------------------------------------------------------------"
@echo ">>> make universe completed on `LC_ALL=C date`" @echo ">>> make universe completed on `LC_ALL=C date`"
@echo " (started ${STARTTIME})" @echo " (started ${STARTTIME})"
@ -280,8 +286,6 @@ universe:
.if make(buildkernels) .if make(buildkernels)
KERNCONFS!= cd ${.CURDIR}/sys/${TARGET}/conf && \ KERNCONFS!= cd ${.CURDIR}/sys/${TARGET}/conf && \
find [A-Z]*[A-Z] -type f -maxdepth 0 ! -name NOTES find [A-Z]*[A-Z] -type f -maxdepth 0 ! -name NOTES
.endif
buildkernels: buildkernels:
.for kernel in ${KERNCONFS} .for kernel in ${KERNCONFS}
-cd ${.CURDIR} && ${MAKE} ${JFLAG} buildkernel \ -cd ${.CURDIR} && ${MAKE} ${JFLAG} buildkernel \
@ -289,3 +293,4 @@ buildkernels:
__MAKE_CONF=/dev/null \ __MAKE_CONF=/dev/null \
> _.${TARGET}.${kernel} 2>&1 > _.${TARGET}.${kernel} 2>&1
.endfor .endfor
.endif