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