xref: /freebsd/share/man/man7/build.7 (revision 02e9120893770924227138ba49df1edb3896112a)
1.\" Copyright (c) 2000
2.\"	Mike W. Meyer
3.\"
4.\" Redistribution and use in source and binary forms, with or without
5.\" modification, are permitted provided that the following conditions
6.\" are met:
7.\" 1. Redistributions of source code must retain the above copyright
8.\"    notice, this list of conditions and the following disclaimer.
9.\" 2. Redistributions in binary form must reproduce the above copyright
10.\"    notice, this list of conditions and the following disclaimer in the
11.\"    documentation and/or other materials provided with the distribution.
12.\"
13.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND
14.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
16.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE
17.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
18.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
19.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
20.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
21.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
22.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
23.\" SUCH DAMAGE.
24.\"
25.Dd August 1, 2023
26.Dt BUILD 7
27.Os
28.Sh NAME
29.Nm build
30.Nd General instructions on how to build the system
31.Sh DESCRIPTION
32The sources for the
33.Fx
34system and its applications are contained in three different directories,
35normally
36.Pa /usr/src ,
37.Pa /usr/doc ,
38and
39.Pa /usr/ports .
40These directories may be initially empty or non-existent until updated with
41Git
42.Po installed from packages with
43.Xr pkg 7
44or from
45.Xr ports 7 Pc .
46Directory
47.Pa /usr/src
48contains the
49.Dq "base system"
50sources, which is loosely defined as the things required to rebuild
51the system to a useful state.
52Directory
53.Pa /usr/doc
54contains the source for the system documentation, excluding the manual
55pages.
56Directory
57.Pa /usr/ports
58contains a tree that provides a consistent interface for building and
59installing third party applications.
60For more information about the ports build process, see
61.Xr ports 7 .
62.Pp
63The
64.Xr make 1
65command is used in each of these directories to build and install the
66things in that directory.
67Issuing the
68.Xr make 1
69command in any directory issues the
70.Xr make 1
71command recursively in all subdirectories.
72With no target specified, the items in the directories are built
73and no further action is taken.
74.Pp
75A source tree is allowed to be read-only.
76As described in
77.Xr make 1 ,
78objects are usually built in a separate object directory hierarchy
79specified by the environment variable
80.Va MAKEOBJDIRPREFIX ,
81or under
82.Pa /usr/obj
83if variable
84.Va MAKEOBJDIRPREFIX
85is not set.
86The canonical object directory is described in the documentation for the
87.Cm buildworld
88target below.
89.Pp
90The build may be controlled by defining
91.Xr make 1
92variables described in the
93.Sx ENVIRONMENT
94section below, and by the variables documented in
95.Xr make.conf 5 .
96.Pp
97The default components included in the build are specified in the file
98.Pa /etc/src.conf
99in the source tree.
100To override the default file, include the SRCCONF option in the make steps,
101pointing to a custom src.conf file.
102For more information see
103.Xr src.conf 5 .
104.Pp
105The following list provides the names and actions for the targets
106supported by the build system:
107.Bl -tag -width ".Cm cleandepend"
108.It Cm analyze
109Run Clang static analyzer against all objects and present output on stdout.
110.It Cm check
111Run tests for a given subdirectory.
112The default directory used is
113.Pa ${.OBJDIR} ,
114but the check directory can be changed with
115.Pa ${CHECKDIR} .
116.It Cm checkworld
117Run the
118.Fx
119test suite on installed world.
120.It Cm clean
121Remove any files created during the build process.
122.It Cm cleandepend
123Remove the
124.Pa ${.OBJDIR}/${DEPENDFILE}*
125files generated by prior
126.Dq Li "make"
127and
128.Dq Li "make depend"
129steps.
130.It Cm cleandir
131Remove the canonical object directory if it exists, or perform
132actions equivalent to
133.Dq Li "make clean cleandepend"
134if it does not.
135This target will also remove an
136.Pa obj
137link in
138.Pa ${.CURDIR}
139if that exists.
140.Pp
141It is advisable to run
142.Dq Li "make cleandir"
143twice: the first invocation will remove the canonical object directory
144and the second one will clean up
145.Pa ${.CURDIR} .
146.It Cm depend
147Generate a list of build dependencies in file
148.Pa ${.OBJDIR}/${DEPENDFILE} .
149Per-object dependencies are generated at build time and stored in
150.Pa ${.OBJDIR}/${DEPENDFILE}.${OBJ} .
151.It Cm install
152Install the results of the build to the appropriate location in the
153installation directory hierarchy specified in variable
154.Va DESTDIR .
155.It Cm obj
156Create the canonical object directory associated with the current
157directory.
158.It Cm objlink
159Create a symbolic link to the canonical object directory in
160.Pa ${.CURDIR} .
161.It Cm tags
162Generate a tags file using the program specified in the
163.Xr make 1
164variable
165.Va CTAGS .
166The build system supports
167.Xr ctags 1
168and
169.Nm "GNU Global" .
170.El
171.Pp
172The other supported targets under directory
173.Pa /usr/src
174are:
175.Bl -tag -width ".Cm distributeworld"
176.It Cm buildenv
177Spawn an interactive shell with environment variables set up for
178building the system or individual components.
179For cross-building the target architecture needs to be specified with
180.Xr make 1
181variables
182.Va TARGET_ARCH
183and
184.Va TARGET .
185.Pp
186This target is only useful after a complete toolchain (including
187the compiler, linker, assembler, headers and libraries) has been
188built; see the
189.Cm toolchain
190target below.
191.It Cm buildworld
192Build everything but the kernel, configure files in
193.Pa etc ,
194and
195.Pa release .
196The object directory can be changed from the default
197.Pa /usr/obj
198by setting the
199.Pa MAKEOBJDIRPREFIX
200.Xr make 1
201variable.
202The actual build location prefix used
203depends on the
204.Va WITH_UNIFIED_OBJDIR
205option from
206.Xr src.conf 5 .
207If enabled it is
208.Pa ${MAKEOBJDIRPREFIX}${.CURDIR}/${TARGET}.${TARGET_ARCH}
209for all builds.
210If disabled it is
211.Pa ${MAKEOBJDIRPREFIX}${.CURDIR}
212for native builds, and
213.Pa ${MAKEOBJDIRPREFIX}/${TARGET}.${TARGET_ARCH}${.CURDIR}
214for cross builds and native builds with variable
215.Va CROSS_BUILD_TESTING
216set.
217.It Cm cleankernel
218Attempts to clean up targets built by a preceding
219.Cm buildkernel ,
220or similar step, built from the same source directory and
221.Va KERNCONF .
222.It Cm cleanworld
223Attempt to clean up targets built by a preceding
224.Cm buildworld ,
225or similar step, built from this source directory.
226.It Cm cleanuniverse
227When
228.Va WITH_UNIFIED_OBJDIR
229is enabled, attempt to clean up targets built by a preceding
230.Cm buildworld ,
231.Cm universe ,
232or similar step, for any architecture built from this source directory.
233.It Cm distributeworld
234Distribute everything compiled by a preceding
235.Cm buildworld
236step.
237Files are placed in the directory hierarchy specified by
238.Xr make 1
239variable
240.Va DISTDIR .
241This target is used while building a release; see
242.Xr release 7 .
243.It Cm native-xtools
244This target builds a cross-toolchain for the given
245.Sy TARGET
246and
247.Sy TARGET_ARCH ,
248as well as a select list of static userland tools for the host system.
249This is intended to be used in a jail where QEMU is used to improve
250performance by avoiding emulating binaries that do not need to be emulated.
251.Sy TARGET
252and
253.Sy TARGET_ARCH
254should be defined.
255.It Cm native-xtools-install
256Installs the results to
257.Pa ${DESTDIR}/${NXTP}
258where
259.Va NXTP
260defaults to
261.Pa nxb-bin .
262.Sy TARGET
263and
264.Sy TARGET_ARCH
265must be defined.
266.It Cm packageworld
267Archive the results of
268.Cm distributeworld ,
269placing the results in
270.Va DISTDIR .
271This target is used while building a release; see
272.Xr release 7 .
273.It Cm installworld
274Install everything built by a preceding
275.Cm buildworld
276step into the directory hierarchy pointed to by
277.Xr make 1
278variable
279.Va DESTDIR .
280.Pp
281If installing onto an NFS file system and running
282.Xr make 1
283with the
284.Fl j
285option, make sure that
286.Xr rpc.lockd 8
287is running on both client and server.
288See
289.Xr rc.conf 5
290on how to make it start at boot time.
291.It Cm toolchain
292Create the build toolchain needed to build the rest of the system.
293For cross-architecture builds, this step creates a cross-toolchain.
294.It Cm universe
295For each architecture,
296execute a
297.Cm buildworld
298followed by a
299.Cm buildkernel
300for all kernels for that architecture,
301including
302.Pa LINT .
303This command takes a long time.
304.It Cm kernels
305Like
306.Cm universe
307with
308.Va WITHOUT_WORLDS
309defined so only the kernels for each architecture are built.
310.It Cm worlds
311Like
312.Cm universe
313with
314.Va WITHOUT_KERNELS
315defined so only the worlds for each architecture are built.
316.It Cm targets
317Print a list of supported
318.Va TARGET
319/
320.Va TARGET_ARCH
321pairs for world and kernel targets.
322.It Cm tinderbox
323Execute the same targets as
324.Cm universe .
325In addition print a summary of all failed targets at the end and
326exit with an error if there were any.
327.It Cm toolchains
328Create a build toolchain for each architecture supported by the build system.
329.It Cm xdev
330Builds and installs a cross-toolchain and sysroot for the given
331.Sy TARGET
332and
333.Sy TARGET_ARCH .
334The sysroot contains target library and headers.
335The target is an alias for
336.Cm xdev-build
337and
338.Cm xdev-install .
339The location of the files installed can be controlled with
340.Va DESTDIR .
341The target location in
342.Va DESTDIR
343is
344.Pa ${DESTDIR}/${XDTP}
345where
346.Va XDTP
347defaults to
348.Pa /usr/${XDDIR}
349and
350.Va XDDIR
351defaults to
352.Pa ${TARGET_ARCH}-freebsd .
353.It Cm xdev-build
354Builds for the
355.Cm xdev
356target.
357.It Cm xdev-install
358Installs the files for the
359.Cm xdev
360target.
361.It Cm xdev-links
362Installs autoconf-style symlinks to
363.Pa ${DESTDIR}/usr/bin
364pointing into the xdev toolchain in
365.Pa ${DESTDIR}/${XDTP} .
366.El
367.Pp
368Kernel specific build targets in
369.Pa /usr/src
370are:
371.Bl -tag -width ".Cm distributekernel"
372.It Cm buildkernel
373Rebuild the kernel and the kernel modules.
374The object directory can be changed from the default
375.Pa /usr/obj
376by setting the
377.Pa MAKEOBJDIRPREFIX
378.Xr make 1
379variable.
380.It Cm installkernel
381Install the kernel and the kernel modules to directory
382.Pa ${DESTDIR}/boot/kernel ,
383renaming any pre-existing directory with this name to
384.Pa kernel.old
385if it contained the currently running kernel.
386The target directory under
387.Pa ${DESTDIR}
388may be modified using the
389.Va INSTKERNNAME
390and
391.Va KODIR
392.Xr make 1
393variables.
394.It Cm distributekernel
395Install the kernel to the directory
396.Pa ${DISTDIR}/kernel/boot/kernel .
397This target is used while building a release; see
398.Xr release 7 .
399.It Cm packagekernel
400Archive the results of
401.Cm distributekernel ,
402placing the results in
403.Va DISTDIR .
404This target is used while building a release; see
405.Xr release 7 .
406.It Cm kernel
407Equivalent to
408.Cm buildkernel
409followed by
410.Cm installkernel
411.It Cm kernel-toolchain
412Rebuild the tools needed for kernel compilation.
413Use this if you did not do a
414.Cm buildworld
415first.
416.It Cm reinstallkernel
417Reinstall the kernel and the kernel modules, overwriting the contents
418of the target directory.
419As with the
420.Cm installkernel
421target, the target directory can be specified using the
422.Xr make 1
423variable
424.Va INSTKERNNAME .
425.El
426.Pp
427Convenience targets for cleaning up the install destination directory
428denoted by variable
429.Va DESTDIR
430include:
431.Bl -tag -width ".Cm delete-old-libs"
432.It Cm check-old
433Print a list of old files and directories in the system.
434.It Cm delete-old
435Delete obsolete base system files and directories interactively.
436When
437.Li -DBATCH_DELETE_OLD_FILES
438is specified at the command line, the delete operation will be
439non-interactive.
440The variables
441.Va DESTDIR ,
442.Va TARGET_ARCH
443and
444.Va TARGET
445should be set as with
446.Dq Li "make installworld" .
447.It Cm delete-old-libs
448Delete obsolete base system libraries interactively.
449This target should only be used if no third party software uses these
450libraries.
451When
452.Li -DBATCH_DELETE_OLD_FILES
453is specified at the command line, the delete operation will be
454non-interactive.
455The variables
456.Va DESTDIR ,
457.Va TARGET_ARCH
458and
459.Va TARGET
460should be set as with
461.Dq Li "make installworld" .
462.El
463.Sh ENVIRONMENT
464Variables that influence all builds include:
465.Bl -tag -width ".Va MAKEOBJDIRPREFIX"
466.It Va DEBUG_FLAGS
467Defines a set of debugging flags that will be used to build all userland
468binaries under
469.Pa /usr/src .
470When
471.Va DEBUG_FLAGS
472is defined, the
473.Cm install
474and
475.Cm installworld
476targets install binaries from the current
477.Va MAKEOBJDIRPREFIX
478without stripping,
479so that debugging information is retained in the installed binaries.
480.It Va DESTDIR
481The directory hierarchy prefix where built objects will be installed.
482If not set,
483.Va DESTDIR
484defaults to the empty string.
485.It Va MAKEOBJDIRPREFIX
486Defines the prefix for directory names in the tree of built objects.
487Defaults to
488.Pa /usr/obj
489if not defined.
490This variable should only be set in the environment or
491.Pa /etc/src-env.conf
492and not via
493.Pa /etc/make.conf
494or
495.Pa /etc/src.conf
496or the command line.
497.It Va WITHOUT_WERROR
498If defined, compiler warnings will not cause the build to halt,
499even if the makefile says otherwise.
500.It Va WITH_CTF
501If defined, the build process will run the DTrace CTF conversion
502tools on built objects.
503.El
504.Pp
505Additionally, builds in
506.Pa /usr/src
507are influenced by the following
508.Xr make 1
509variables:
510.Bl -tag -width ".Va LOCAL_MODULES_DIR"
511.It Va CROSS_TOOLCHAIN
512Requests use of an external toolchain to build either the world or kernel.
513This value of this variable can either be the full path to a file,
514or the base name of a file in
515.Pa ${LOCALBASE}/share/toolchains .
516The file should be a make file which sets variables to request an external
517toolchain such as
518.Va XCC .
519.Pp
520External toolchains are available in ports for both LLVM and GCC/binutils.
521For external toolchains available in ports,
522.Va CROSS_TOOLCHAIN
523should be set to the name of the package.
524LLVM toolchain packages use the name llvm<major version>.
525GCC toolchains provide separate packages for each architecture and use the
526name ${MACHINE_ARCH}-gcc<major version>.
527.It Va KERNCONF
528Overrides which kernel to build and install for the various kernel
529make targets.
530It defaults to
531.Cm GENERIC .
532.It Va KERNCONFDIR
533Overrides the directory in which
534.Va KERNCONF
535and any files included by
536.Va KERNCONF
537should be found.
538Defaults to
539.Pa sys/${ARCH}/conf .
540.It Va KERNFAST
541If set, the build target
542.Cm buildkernel
543defaults to setting
544.Va NO_KERNELCLEAN ,
545.Va NO_KERNELCONFIG ,
546and
547.Va NO_KERNELOBJ .
548When set to a value other than
549.Cm 1
550then
551.Va KERNCONF
552is set to the value of
553.Va KERNFAST .
554.It Va LOCAL_DIRS
555If set, this variable supplies a list of additional directories relative to
556the root of the source tree to build as part of the
557.Cm everything
558target.
559The directories are built in parallel with each other,
560and with the base system directories.
561Insert a
562.Va .WAIT
563directive at the beginning of the
564.Va LOCAL_DIRS
565list to ensure all base system directories are built first.
566.Va .WAIT
567may also be used as needed elsewhere within the list.
568.It Va LOCAL_ITOOLS
569If set, this variable supplies a list of additional tools that are used by the
570.Cm installworld
571and
572.Cm distributeworld
573targets.
574.It Va LOCAL_LIB_DIRS
575If set, this variable supplies a list of additional directories relative to
576the root of the source tree to build as part of the
577.Cm libraries
578target.
579The directories are built in parallel with each other,
580and with the base system libraries.
581Insert a
582.Va .WAIT
583directive at the beginning of the
584.Va LOCAL_DIRS
585list to ensure all base system libraries are built first.
586.Va .WAIT
587may also be used as needed elsewhere within the list.
588.It Va LOCAL_MTREE
589If set, this variable supplies a list of additional mtrees relative to the
590root of the source tree to use as part of the
591.Cm hierarchy
592target.
593.It Va LOCAL_LEGACY_DIRS
594If set, this variable supplies a list of additional directories relative to
595the root of the source tree to build as part of the
596.Cm legacy
597target.
598.It Va LOCAL_BSTOOL_DIRS
599If set, this variable supplies a list of additional directories relative to
600the root of the source tree to build as part of the
601.Cm bootstrap-tools
602target.
603.It Va LOCAL_TOOL_DIRS
604If set, this variable supplies a list of additional directories relative to
605the root of the source tree to build as part of the
606.Cm build-tools
607target.
608.It Va LOCAL_XTOOL_DIRS
609If set, this variable supplies a list of additional directories relative to
610the root of the source tree to build as part of the
611.Cm cross-tools
612target.
613.It Va PORTS_MODULES
614A list of ports with kernel modules that should be built and installed
615as part of the
616.Cm buildkernel
617and
618.Cm installkernel
619process.
620.Bd -literal -offset indent
621make PORTS_MODULES=emulators/virtualbox-ose-kmod kernel
622.Ed
623.It Va LOCAL_MODULES
624A list of external kernel modules that should be built and installed
625as part of the
626.Cm buildkernel
627and
628.Cm installkernel
629process.
630Defaults to the list of sub-directories of
631.Va LOCAL_MODULES_DIR .
632.It Va LOCAL_MODULES_DIR
633The directory in which to search for the kernel modules specified by
634.Va LOCAL_MODULES .
635Each kernel module should consist of a directory containing a makefile.
636Defaults to
637.Pa ${LOCALBASE}/sys/modules .
638.It Va SRCCONF
639Specify a file to override the default
640.Pa /etc/src.conf .
641The src.conf file controls the components to build.
642See
643.Xr src.conf 5
644.It Va STRIPBIN
645Command to use at install time when stripping binaries.
646Be sure to add any additional tools required to run
647.Va STRIPBIN
648to the
649.Va LOCAL_ITOOLS
650.Xr make 1
651variable before running the
652.Cm distributeworld
653or
654.Cm installworld
655targets.
656See
657.Xr install 1
658for more details.
659.It Va SUBDIR_OVERRIDE
660Override the default list of sub-directories and only build the
661sub-directory named in this variable.
662If combined with
663.Cm buildworld
664then all libraries and includes, and some of the build tools will still build
665as well.
666Specifying
667.Cm -DNO_LIBS ,
668and
669.Cm -DWORLDFAST
670will only build the specified directory as was done historically.
671When combined with
672.Cm buildworld
673it is necessary to override
674.Va LOCAL_LIB_DIRS
675with any custom directories containing libraries.
676This allows building a subset of the system in the same way as
677.Cm buildworld
678does using its sysroot handling.
679This variable can also be useful when debugging failed builds.
680.Bd -literal -offset indent
681make some-target SUBDIR_OVERRIDE=foo/bar
682.Ed
683.It Va SYSDIR
684Specify the location of the kernel source to override the default
685.Pa /usr/src/sys .
686The kernel source is located in the
687.Pa sys
688subdirectory of the source tree checked out from the
689.Pa src.git
690repository.
691.It Va TARGET
692The target hardware platform.
693This is analogous to the
694.Dq Nm uname Fl m
695output.
696This is necessary to cross-build some target architectures.
697For example, cross-building for ARM64 machines requires
698.Va TARGET_ARCH Ns = Ns Li aarch64
699and
700.Va TARGET Ns = Ns Li arm64 .
701If not set,
702.Va TARGET
703defaults to the current hardware platform, unless
704.Va TARGET_ARCH
705is also set, in which case it defaults to the appropriate
706value for that architecture.
707.It Va TARGET_ARCH
708The target machine processor architecture.
709This is analogous to the
710.Dq Nm uname Fl p
711output.
712Set this to cross-build for a different architecture.
713If not set,
714.Va TARGET_ARCH
715defaults to the current machine architecture, unless
716.Va TARGET
717is also set, in which case it defaults to the appropriate
718value for that platform.
719Typically, one only needs to set
720.Va TARGET .
721.El
722.Pp
723Builds under directory
724.Pa /usr/src
725are also influenced by defining one or more of the following symbols,
726using the
727.Fl D
728option of
729.Xr make 1 :
730.Bl -tag -width ".Va LOADER_DEFAULT_INTERP"
731.It Va LOADER_DEFAULT_INTERP
732Defines what interpreter the default loader program will have.
733Valid values include
734.Dq 4th ,
735.Dq lua ,
736and
737.Dq simp .
738This creates the default link for
739.Pa /boot/loader
740to the loader with that interpreter.
741It also determines what interpreter is compiled into
742.Pa userboot .
743.It Va NO_CLEANDIR
744If set, the build targets that clean parts of the object tree use the
745equivalent of
746.Dq make clean
747instead of
748.Dq make cleandir .
749.It Va NO_CLEAN
750If set, no object tree files are cleaned at all.
751This is the default when
752.Va WITH_META_MODE
753is used with
754.Xr filemon 4
755loaded.
756See
757.Xr src.conf 5
758for more details.
759Setting
760.Va NO_CLEAN
761implies
762.Va NO_KERNELCLEAN ,
763so when
764.Va NO_CLEAN
765is set no kernel objects are cleaned either.
766.It Va NO_CTF
767If set, the build process does not run the DTrace CTF conversion tools
768on built objects.
769.It Va NO_SHARE
770If set, the build does not descend into the
771.Pa /usr/src/share
772subdirectory (i.e., manual pages, locale data files, timezone data files and
773other
774.Pa /usr/src/share
775files will not be rebuild from their sources).
776.It Va NO_KERNELCLEAN
777If set, the build process does not run
778.Dq make clean
779as part of the
780.Cm buildkernel
781target.
782.It Va NO_KERNELCONFIG
783If set, the build process does not run
784.Xr config 8
785as part of the
786.Cm buildkernel
787target.
788.It Va NO_KERNELOBJ
789If set, the build process does not run
790.Dq make obj
791as part of the
792.Cm buildkernel
793target.
794.It Va NO_LIBS
795If set, the libraries phase will be skipped.
796.It Va NO_OBJWALK
797If set, no object directories will be created.
798This should only be used if object directories were created in a
799previous build and no new directories are connected.
800.It Va UNIVERSE_TOOLCHAIN
801Requests use of the toolchain built as part of the
802.Cm universe
803target as an external toolchain.
804.It Va WORLDFAST
805If set, the build target
806.Cm buildworld
807defaults to setting
808.Va NO_CLEAN ,
809.Va NO_OBJWALK ,
810and will skip most bootstrap phases.
811It will only bootstrap libraries and build all of userland.
812This option should be used only when it is known that none of the bootstrap
813needs changed and that no new directories have been connected to the build.
814.El
815.Pp
816Builds under directory
817.Pa /usr/doc
818are influenced by the following
819.Xr make 1
820variables:
821.Bl -tag -width ".Va DOC_LANG"
822.It Va DOC_LANG
823If set, restricts the documentation build to the language subdirectories
824specified as its content.
825The default action is to build documentation for all languages.
826.El
827.Pp
828Builds using the
829.Cm universe
830and related targets are influenced by the following
831.Xr make 1
832variables:
833.Bl -tag -width ".Va USE_GCC_TOOLCHAINS"
834.It Va JFLAG
835Pass the value of this variable to each
836.Xr make 1
837invocation used to build worlds and kernels.
838This can be used to enable multiple jobs within a single architecture's build
839while still building each architecture serially.
840.It Va MAKE_JUST_KERNELS
841Only build kernels for each supported architecture.
842.It Va MAKE_JUST_WORLDS
843Only build worlds for each supported architecture.
844.It Va WITHOUT_WORLDS
845Only build kernels for each supported architecture.
846.It Va WITHOUT_KERNELS
847Only build worlds for each supported architecture.
848.It Va UNIVERSE_TARGET
849Execute the specified
850.Xr make 1
851target for each supported architecture instead of the default action of
852building a world and one or more kernels.
853This variable implies
854.Va WITHOUT_KERNELS .
855.It Va USE_GCC_TOOLCHAINS
856Use external GCC toolchains to build the requested targets.
857If the required toolchain package for a supported architecture is not installed,
858the build for that architecture is skipped.
859.It Va TARGETS
860Only build the listed targets instead of each supported architecture.
861.It Va EXTRA_TARGETS
862In addition to the supported architectures, build the semi-supported
863architectures.
864A semi-supported architecture has build support in the
865.Fx
866tree, but receives significantly less testing and is generally for
867fringe uses that do not have a wide appeal.
868.El
869.Sh FILES
870.Bl -tag -width ".Pa /usr/share/examples/etc/make.conf" -compact
871.It Pa /usr/doc/Makefile
872.It Pa /usr/doc/share/mk/doc.project.mk
873.It Pa /usr/ports/Mk/bsd.port.mk
874.It Pa /usr/ports/Mk/bsd.sites.mk
875.It Pa /usr/share/examples/etc/make.conf
876.It Pa /usr/src/Makefile
877.It Pa /usr/src/Makefile.inc1
878.El
879.Sh EXAMPLES
880For an
881.Dq approved
882method of updating your system from the latest sources, please see the
883.Sx COMMON ITEMS
884section in
885.Pa src/UPDATING .
886.Pp
887The following sequence of commands can be used to cross-build the
888system for the armv6 architecture on an amd64 host:
889.Bd -literal -offset indent
890cd /usr/src
891make TARGET_ARCH=armv6 buildworld buildkernel
892make TARGET_ARCH=armv6 DESTDIR=/clients/arm installworld installkernel
893.Ed
894.Sh HISTORY
895The
896.Nm
897manpage first appeared in
898.Fx 4.3 .
899.Sh SEE ALSO
900.Xr cc 1 ,
901.Xr install 1 ,
902.Xr make 1 ,
903.Xr make.conf 5 ,
904.Xr src.conf 5 ,
905.Xr arch 7 ,
906.Xr pkg 7 ,
907.Xr ports 7 ,
908.Xr release 7 ,
909.Xr tests 7 ,
910.Xr config 8 ,
911.Xr etcupdate 8 ,
912.Xr reboot 8 ,
913.Xr shutdown 8
914.Sh AUTHORS
915.An Mike W. Meyer Aq Mt mwm@mired.org
916