- Add a new UNIVERSE_TARGET variable for 'make universe'. If it is set,

then that target is invoked for each architecture rather than the
  default action of building world and kernels for each architecture.
- Add a 'make toolchains' wrapper which uses UNIVERSE_TARGET to build
  toolchains for all architectures.
- Document JFLAG, MAKE_JUST_KERNELS, and MAKE_JUST_WORLDS variables for
  'make universe'.

Reviewed by:	bz
MFC after:	1 week
This commit is contained in:
John Baldwin
2011-02-10 18:54:52 +00:00
parent 2bb3ab3f9a
commit 4e889921ef
2 changed files with 49 additions and 14 deletions
+17 -8
View File
@@ -30,6 +30,7 @@
# delete-old-libs - Delete obsolete libraries. # delete-old-libs - Delete obsolete libraries.
# targets - Print a list of supported TARGET/TARGET_ARCH pairs # targets - Print a list of supported TARGET/TARGET_ARCH pairs
# for world and kernel targets. # for world and kernel targets.
# toolchains - Build a toolchain for all world and kernel targets.
# #
# This makefile is simple by design. The FreeBSD make automatically reads # This makefile is simple by design. The FreeBSD make automatically reads
# the /usr/share/mk/sys.mk unless the -m argument is specified on the # the /usr/share/mk/sys.mk unless the -m argument is specified on the
@@ -307,8 +308,10 @@ make: .PHONY
${MMAKE} install DESTDIR=${MAKEPATH} BINDIR= ${MMAKE} install DESTDIR=${MAKEPATH} BINDIR=
tinderbox: tinderbox:
@cd ${.CURDIR} && \ @cd ${.CURDIR} && ${MAKE} DOING_TINDERBOX=YES universe
DOING_TINDERBOX=YES ${MAKE} JFLAG=${JFLAG} universe
toolchains:
@cd ${.CURDIR} && ${MAKE} UNIVERSE_TARGET=toolchain universe
# #
# universe # universe
@@ -328,6 +331,12 @@ TARGET_ARCHES_sun4v?= sparc64
TARGET_ARCHES_${target}?= ${target} TARGET_ARCHES_${target}?= ${target}
.endfor .endfor
.if defined(UNIVERSE_TARGET)
MAKE_JUST_WORLDS= YES
.else
UNIVERSE_TARGET?= buildworld
.endif
targets: targets:
@echo "Supported TARGET/TARGET_ARCH pairs for world and kernel targets" @echo "Supported TARGET/TARGET_ARCH pairs for world and kernel targets"
.for target in ${TARGETS} .for target in ${TARGETS}
@@ -361,16 +370,16 @@ universe_${target}_prologue:
.for target_arch in ${TARGET_ARCHES_${target}} .for target_arch in ${TARGET_ARCHES_${target}}
universe_${target}: universe_${target}_${target_arch} universe_${target}: universe_${target}_${target_arch}
universe_${target}_${target_arch}: universe_${target}_prologue universe_${target}_${target_arch}: universe_${target}_prologue
@echo ">> ${target}.${target_arch} buildworld started on `LC_ALL=C date`" @echo ">> ${target}.${target_arch} ${UNIVERSE_TARGET} started on `LC_ALL=C date`"
@(cd ${.CURDIR} && env __MAKE_CONF=/dev/null \ @(cd ${.CURDIR} && env __MAKE_CONF=/dev/null \
${MAKE} ${JFLAG} buildworld \ ${MAKE} ${JFLAG} ${UNIVERSE_TARGET} \
TARGET=${target} \ TARGET=${target} \
TARGET_ARCH=${target_arch} \ TARGET_ARCH=${target_arch} \
> _.${target}.${target_arch}.buildworld 2>&1 || \ > _.${target}.${target_arch}.${UNIVERSE_TARGET} 2>&1 || \
(echo "${target}.${target_arch} world failed," \ (echo "${target}.${target_arch} ${UNIVERSE_TARGET} failed," \
"check _.${target}.${target_arch}.buildworld for details" | \ "check _.${target}.${target_arch}.${UNIVERSE_TARGET} for details" | \
${MAKEFAIL})) ${MAKEFAIL}))
@echo ">> ${target}.${target_arch} buildworld completed on `LC_ALL=C date`" @echo ">> ${target}.${target_arch} ${UNIVERSE_TARGET} completed on `LC_ALL=C date`"
.endfor .endfor
.endif .endif
.if !defined(MAKE_JUST_WORLDS) .if !defined(MAKE_JUST_WORLDS)
+32 -6
View File
@@ -24,7 +24,7 @@
.\" .\"
.\" $FreeBSD$ .\" $FreeBSD$
.\" .\"
.Dd January 25, 2011 .Dd February 10, 2011
.Dt BUILD 7 .Dt BUILD 7
.Os .Os
.Sh NAME .Sh NAME
@@ -218,13 +218,14 @@ on how to make it start at boot time.
Create the build toolchain needed to build the rest of the system. Create the build toolchain needed to build the rest of the system.
For cross-architecture builds, this step creates a cross-toolchain. For cross-architecture builds, this step creates a cross-toolchain.
.It Cm universe .It Cm universe
Execute a For each architecture,
execute a
.Cm buildworld .Cm buildworld
and followed by a
.Cm buildkernel .Cm buildkernel
for all kernels including for all kernels for that architecture,
.Pa LINT , including
for each architecture supported by the build system. .Pa LINT .
This command takes a long time. This command takes a long time.
.It Cm update .It Cm update
Get updated sources as configured in Get updated sources as configured in
@@ -240,6 +241,8 @@ Execute the same targets as
.Cm universe . .Cm universe .
In addition print a summary of all failed targets at the end and In addition print a summary of all failed targets at the end and
exit with an error if there were any. exit with an error if there were any.
.It Cm toolchains
Create a build toolchain for each architecture supported by the build system.
.El .El
.Pp .Pp
Kernel specific build targets in Kernel specific build targets in
@@ -508,6 +511,29 @@ If set, restricts the documentation build to the language subdirectories
specified as its content. specified as its content.
The default action is to build documentation for all languages. The default action is to build documentation for all languages.
.El .El
.Pp
Builds using the
.Cm universe
target are influenced by the following
.Xr make 1
variables:
.Bl -tag -width ".Va MAKE_JUST_KERNELS"
.It Va JFLAG
Pass the value of this variable to each
.Xr make 1
invocation used to build worlds and kernels.
This can be used to enable multiple jobs within a single architecture's build
while still building each architecture serially.
.It Va MAKE_JUST_KERNELS
Only build kernels for each supported architecture.
.It Va MAKE_JUST_WORLDS
Only build worlds for each supported architecture.
.It Va UNIVERSE_TARGET
Execute the specified
.Xr make 1
target for each supported architecture instead of the default action of
building a world and one or more kernels.
.El
.Sh FILES .Sh FILES
.Bl -tag -width ".Pa /usr/share/examples/etc/make.conf" -compact .Bl -tag -width ".Pa /usr/share/examples/etc/make.conf" -compact
.It Pa /usr/doc/Makefile .It Pa /usr/doc/Makefile