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