1*8327796cSAlexander Ziaee.\"- 2*8327796cSAlexander Ziaee.\" SPDX-License-Identifier: BSD-2-Clause 3*8327796cSAlexander Ziaee.\" 4786aa69aSBen Smithurst.\" Copyright (c) 2000 5786aa69aSBen Smithurst.\" Mike W. Meyer 6786aa69aSBen Smithurst.\" 7786aa69aSBen Smithurst.\" Redistribution and use in source and binary forms, with or without 8786aa69aSBen Smithurst.\" modification, are permitted provided that the following conditions 9786aa69aSBen Smithurst.\" are met: 10786aa69aSBen Smithurst.\" 1. Redistributions of source code must retain the above copyright 11786aa69aSBen Smithurst.\" notice, this list of conditions and the following disclaimer. 12786aa69aSBen Smithurst.\" 2. Redistributions in binary form must reproduce the above copyright 13786aa69aSBen Smithurst.\" notice, this list of conditions and the following disclaimer in the 14786aa69aSBen Smithurst.\" documentation and/or other materials provided with the distribution. 15786aa69aSBen Smithurst.\" 16786aa69aSBen Smithurst.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND 17786aa69aSBen Smithurst.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18786aa69aSBen Smithurst.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 19786aa69aSBen Smithurst.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE 20786aa69aSBen Smithurst.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 21786aa69aSBen Smithurst.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 22786aa69aSBen Smithurst.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 23786aa69aSBen Smithurst.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 24786aa69aSBen Smithurst.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 25786aa69aSBen Smithurst.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 26786aa69aSBen Smithurst.\" SUCH DAMAGE. 27786aa69aSBen Smithurst.\" 2821ef3591SJohn Baldwin.Dd August 1, 2023 29786aa69aSBen Smithurst.Dt BUILD 7 303d45e180SRuslan Ermilov.Os 31786aa69aSBen Smithurst.Sh NAME 32786aa69aSBen Smithurst.Nm build 33e6ca6901SGordon Bergling.Nd General instructions on how to build the system 34786aa69aSBen Smithurst.Sh DESCRIPTION 357b710ab2SJoseph KoshyThe sources for the 36d003b779SRuslan Ermilov.Fx 377b710ab2SJoseph Koshysystem and its applications are contained in three different directories, 38786aa69aSBen Smithurstnormally 39786aa69aSBen Smithurst.Pa /usr/src , 40786aa69aSBen Smithurst.Pa /usr/doc , 41786aa69aSBen Smithurstand 42786aa69aSBen Smithurst.Pa /usr/ports . 4350a994c9SWarren BlockThese directories may be initially empty or non-existent until updated with 44e444a4c6SFernando ApesteguíaGit 45e444a4c6SFernando Apesteguía.Po installed from packages with 46e444a4c6SFernando Apesteguía.Xr pkg 7 47e444a4c6SFernando Apesteguíaor from 48e444a4c6SFernando Apesteguía.Xr ports 7 Pc . 497b710ab2SJoseph KoshyDirectory 50786aa69aSBen Smithurst.Pa /usr/src 51786aa69aSBen Smithurstcontains the 52786aa69aSBen Smithurst.Dq "base system" 53786aa69aSBen Smithurstsources, which is loosely defined as the things required to rebuild 54786aa69aSBen Smithurstthe system to a useful state. 557b710ab2SJoseph KoshyDirectory 56786aa69aSBen Smithurst.Pa /usr/doc 57786aa69aSBen Smithurstcontains the source for the system documentation, excluding the manual 58786aa69aSBen Smithurstpages. 597b710ab2SJoseph KoshyDirectory 60786aa69aSBen Smithurst.Pa /usr/ports 617b710ab2SJoseph Koshycontains a tree that provides a consistent interface for building and 62786aa69aSBen Smithurstinstalling third party applications. 637b710ab2SJoseph KoshyFor more information about the ports build process, see 647b710ab2SJoseph Koshy.Xr ports 7 . 65786aa69aSBen Smithurst.Pp 66786aa69aSBen SmithurstThe 67786aa69aSBen Smithurst.Xr make 1 68786aa69aSBen Smithurstcommand is used in each of these directories to build and install the 691caae057SRuslan Ermilovthings in that directory. 701caae057SRuslan ErmilovIssuing the 711caae057SRuslan Ermilov.Xr make 1 72e6ca6901SGordon Berglingcommand in any directory issues the 73e6ca6901SGordon Bergling.Xr make 1 74e6ca6901SGordon Berglingcommand recursively in all subdirectories. 75e6ca6901SGordon BerglingWith no target specified, the items in the directories are built 76e6ca6901SGordon Berglingand no further action is taken. 777b710ab2SJoseph Koshy.Pp 787b710ab2SJoseph KoshyA source tree is allowed to be read-only. 797b710ab2SJoseph KoshyAs described in 807b710ab2SJoseph Koshy.Xr make 1 , 817b710ab2SJoseph Koshyobjects are usually built in a separate object directory hierarchy 827b710ab2SJoseph Koshyspecified by the environment variable 837b710ab2SJoseph Koshy.Va MAKEOBJDIRPREFIX , 847b710ab2SJoseph Koshyor under 857b710ab2SJoseph Koshy.Pa /usr/obj 867b710ab2SJoseph Koshyif variable 877b710ab2SJoseph Koshy.Va MAKEOBJDIRPREFIX 887b710ab2SJoseph Koshyis not set. 89dfa09989SBryan DreweryThe canonical object directory is described in the documentation for the 907b710ab2SJoseph Koshy.Cm buildworld 917b710ab2SJoseph Koshytarget below. 927b710ab2SJoseph Koshy.Pp 937b710ab2SJoseph KoshyThe build may be controlled by defining 947b710ab2SJoseph Koshy.Xr make 1 957b710ab2SJoseph Koshyvariables described in the 967b710ab2SJoseph Koshy.Sx ENVIRONMENT 977b710ab2SJoseph Koshysection below, and by the variables documented in 987b710ab2SJoseph Koshy.Xr make.conf 5 . 997b710ab2SJoseph Koshy.Pp 100e6ca6901SGordon BerglingThe default components included in the build are specified in the file 101e6ca6901SGordon Bergling.Pa /etc/src.conf 102e6ca6901SGordon Berglingin the source tree. 103e6ca6901SGordon BerglingTo override the default file, include the SRCCONF option in the make steps, 104e6ca6901SGordon Berglingpointing to a custom src.conf file. 105e6ca6901SGordon BerglingFor more information see 106e6ca6901SGordon Bergling.Xr src.conf 5 . 107e6ca6901SGordon Bergling.Pp 1087b710ab2SJoseph KoshyThe following list provides the names and actions for the targets 1097b710ab2SJoseph Koshysupported by the build system: 1107b710ab2SJoseph Koshy.Bl -tag -width ".Cm cleandepend" 111aae63957SBryan Drewery.It Cm analyze 112aae63957SBryan DreweryRun Clang static analyzer against all objects and present output on stdout. 11371b7fa12SEnji Cooper.It Cm check 11471b7fa12SEnji CooperRun tests for a given subdirectory. 11571b7fa12SEnji CooperThe default directory used is 11671b7fa12SEnji Cooper.Pa ${.OBJDIR} , 11771b7fa12SEnji Cooperbut the check directory can be changed with 11871b7fa12SEnji Cooper.Pa ${CHECKDIR} . 11971b7fa12SEnji Cooper.It Cm checkworld 12071b7fa12SEnji CooperRun the 12171b7fa12SEnji Cooper.Fx 12271b7fa12SEnji Coopertest suite on installed world. 1231caae057SRuslan Ermilov.It Cm clean 1247b710ab2SJoseph KoshyRemove any files created during the build process. 1257b710ab2SJoseph Koshy.It Cm cleandepend 126497e8091SBryan DreweryRemove the 127497e8091SBryan Drewery.Pa ${.OBJDIR}/${DEPENDFILE}* 128497e8091SBryan Dreweryfiles generated by prior 129497e8091SBryan Drewery.Dq Li "make" 130497e8091SBryan Dreweryand 1317b710ab2SJoseph Koshy.Dq Li "make depend" 132497e8091SBryan Drewerysteps. 1337b710ab2SJoseph Koshy.It Cm cleandir 1347b710ab2SJoseph KoshyRemove the canonical object directory if it exists, or perform 1357b710ab2SJoseph Koshyactions equivalent to 1367b710ab2SJoseph Koshy.Dq Li "make clean cleandepend" 1377b710ab2SJoseph Koshyif it does not. 1387b710ab2SJoseph KoshyThis target will also remove an 1397b710ab2SJoseph Koshy.Pa obj 1407b710ab2SJoseph Koshylink in 1417b710ab2SJoseph Koshy.Pa ${.CURDIR} 1427b710ab2SJoseph Koshyif that exists. 1437b710ab2SJoseph Koshy.Pp 1447b710ab2SJoseph KoshyIt is advisable to run 1457b710ab2SJoseph Koshy.Dq Li "make cleandir" 1467b710ab2SJoseph Koshytwice: the first invocation will remove the canonical object directory 1477b710ab2SJoseph Koshyand the second one will clean up 1487b710ab2SJoseph Koshy.Pa ${.CURDIR} . 1497b710ab2SJoseph Koshy.It Cm depend 1507b710ab2SJoseph KoshyGenerate a list of build dependencies in file 1517b710ab2SJoseph Koshy.Pa ${.OBJDIR}/${DEPENDFILE} . 152497e8091SBryan DreweryPer-object dependencies are generated at build time and stored in 153497e8091SBryan Drewery.Pa ${.OBJDIR}/${DEPENDFILE}.${OBJ} . 1541caae057SRuslan Ermilov.It Cm install 1557b710ab2SJoseph KoshyInstall the results of the build to the appropriate location in the 1567b710ab2SJoseph Koshyinstallation directory hierarchy specified in variable 1577b710ab2SJoseph Koshy.Va DESTDIR . 1587b710ab2SJoseph Koshy.It Cm obj 1597b710ab2SJoseph KoshyCreate the canonical object directory associated with the current 1607b710ab2SJoseph Koshydirectory. 1617b710ab2SJoseph Koshy.It Cm objlink 1627b710ab2SJoseph KoshyCreate a symbolic link to the canonical object directory in 1637b710ab2SJoseph Koshy.Pa ${.CURDIR} . 1647b710ab2SJoseph Koshy.It Cm tags 1657b710ab2SJoseph KoshyGenerate a tags file using the program specified in the 1667b710ab2SJoseph Koshy.Xr make 1 1677b710ab2SJoseph Koshyvariable 1687b710ab2SJoseph Koshy.Va CTAGS . 1697b710ab2SJoseph KoshyThe build system supports 1707b710ab2SJoseph Koshy.Xr ctags 1 1717b710ab2SJoseph Koshyand 1727b710ab2SJoseph Koshy.Nm "GNU Global" . 1737b710ab2SJoseph Koshy.El 1747b710ab2SJoseph Koshy.Pp 1757b710ab2SJoseph KoshyThe other supported targets under directory 1767b710ab2SJoseph Koshy.Pa /usr/src 1777b710ab2SJoseph Koshyare: 1787b710ab2SJoseph Koshy.Bl -tag -width ".Cm distributeworld" 1797b710ab2SJoseph Koshy.It Cm buildenv 1807b710ab2SJoseph KoshySpawn an interactive shell with environment variables set up for 1814a238795SEd Mastebuilding the system or individual components. 1824a238795SEd MasteFor cross-building the target architecture needs to be specified with 1837b710ab2SJoseph Koshy.Xr make 1 1847b710ab2SJoseph Koshyvariables 1857b710ab2SJoseph Koshy.Va TARGET_ARCH 1867b710ab2SJoseph Koshyand 1877b710ab2SJoseph Koshy.Va TARGET . 1887b710ab2SJoseph Koshy.Pp 1894a238795SEd MasteThis target is only useful after a complete toolchain (including 1904a238795SEd Mastethe compiler, linker, assembler, headers and libraries) has been 1917b710ab2SJoseph Koshybuilt; see the 1927b710ab2SJoseph Koshy.Cm toolchain 1937b710ab2SJoseph Koshytarget below. 1947b710ab2SJoseph Koshy.It Cm buildworld 1957b710ab2SJoseph KoshyBuild everything but the kernel, configure files in 1967b710ab2SJoseph Koshy.Pa etc , 1977b710ab2SJoseph Koshyand 1987b710ab2SJoseph Koshy.Pa release . 199d90f12e3SWarren BlockThe object directory can be changed from the default 200d90f12e3SWarren Block.Pa /usr/obj 201d90f12e3SWarren Blockby setting the 202d90f12e3SWarren Block.Pa MAKEOBJDIRPREFIX 203d90f12e3SWarren Block.Xr make 1 204d90f12e3SWarren Blockvariable. 205dfa09989SBryan DreweryThe actual build location prefix used 206dfa09989SBryan Drewerydepends on the 207dfa09989SBryan Drewery.Va WITH_UNIFIED_OBJDIR 208dfa09989SBryan Dreweryoption from 209dfa09989SBryan Drewery.Xr src.conf 5 . 210dfa09989SBryan DreweryIf enabled it is 211dfa09989SBryan Drewery.Pa ${MAKEOBJDIRPREFIX}${.CURDIR}/${TARGET}.${TARGET_ARCH} 212dfa09989SBryan Dreweryfor all builds. 213dfa09989SBryan DreweryIf disabled it is 2147b710ab2SJoseph Koshy.Pa ${MAKEOBJDIRPREFIX}${.CURDIR} 2157b710ab2SJoseph Koshyfor native builds, and 216dfa09989SBryan Drewery.Pa ${MAKEOBJDIRPREFIX}/${TARGET}.${TARGET_ARCH}${.CURDIR} 2177b710ab2SJoseph Koshyfor cross builds and native builds with variable 2187b710ab2SJoseph Koshy.Va CROSS_BUILD_TESTING 2197b710ab2SJoseph Koshyset. 2203e65b7d9SWarner Losh.It Cm cleankernel 2213e65b7d9SWarner LoshAttempts to clean up targets built by a preceding 2223e65b7d9SWarner Losh.Cm buildkernel , 2233e65b7d9SWarner Loshor similar step, built from the same source directory and 2243e65b7d9SWarner Losh.Va KERNCONF . 2257b710ab2SJoseph Koshy.It Cm cleanworld 2267b710ab2SJoseph KoshyAttempt to clean up targets built by a preceding 227c10062b9SBryan Drewery.Cm buildworld , 2283e65b7d9SWarner Loshor similar step, built from this source directory. 229c10062b9SBryan Drewery.It Cm cleanuniverse 230c10062b9SBryan DreweryWhen 231c10062b9SBryan Drewery.Va WITH_UNIFIED_OBJDIR 232c10062b9SBryan Dreweryis enabled, attempt to clean up targets built by a preceding 233c10062b9SBryan Drewery.Cm buildworld , 234c10062b9SBryan Drewery.Cm universe , 235c10062b9SBryan Dreweryor similar step, for any architecture built from this source directory. 2367b710ab2SJoseph Koshy.It Cm distributeworld 2377b710ab2SJoseph KoshyDistribute everything compiled by a preceding 2387b710ab2SJoseph Koshy.Cm buildworld 2397b710ab2SJoseph Koshystep. 2407b710ab2SJoseph KoshyFiles are placed in the directory hierarchy specified by 2417b710ab2SJoseph Koshy.Xr make 1 2427b710ab2SJoseph Koshyvariable 2437b710ab2SJoseph Koshy.Va DISTDIR . 2447b710ab2SJoseph KoshyThis target is used while building a release; see 2457b710ab2SJoseph Koshy.Xr release 7 . 2467441e255SBryan Drewery.It Cm native-xtools 2477441e255SBryan DreweryThis target builds a cross-toolchain for the given 2487441e255SBryan Drewery.Sy TARGET 2497441e255SBryan Dreweryand 2507441e255SBryan Drewery.Sy TARGET_ARCH , 2517441e255SBryan Dreweryas well as a select list of static userland tools for the host system. 2527441e255SBryan DreweryThis is intended to be used in a jail where QEMU is used to improve 2537441e255SBryan Dreweryperformance by avoiding emulating binaries that do not need to be emulated. 2547441e255SBryan Drewery.Sy TARGET 2557441e255SBryan Dreweryand 2567441e255SBryan Drewery.Sy TARGET_ARCH 2577441e255SBryan Dreweryshould be defined. 2585bd47cc5SBryan Drewery.It Cm native-xtools-install 2595bd47cc5SBryan DreweryInstalls the results to 2605bd47cc5SBryan Drewery.Pa ${DESTDIR}/${NXTP} 2615bd47cc5SBryan Drewerywhere 2625bd47cc5SBryan Drewery.Va NXTP 2635bd47cc5SBryan Drewerydefaults to 2645bd47cc5SBryan Drewery.Pa nxb-bin . 2655bd47cc5SBryan Drewery.Sy TARGET 2665bd47cc5SBryan Dreweryand 2675bd47cc5SBryan Drewery.Sy TARGET_ARCH 2685bd47cc5SBryan Drewerymust be defined. 269e8423d00SNathan Whitehorn.It Cm packageworld 270e8423d00SNathan WhitehornArchive the results of 271e8423d00SNathan Whitehorn.Cm distributeworld , 272e8423d00SNathan Whitehornplacing the results in 273e8423d00SNathan Whitehorn.Va DISTDIR . 274e8423d00SNathan WhitehornThis target is used while building a release; see 275e8423d00SNathan Whitehorn.Xr release 7 . 2767b710ab2SJoseph Koshy.It Cm installworld 2777b710ab2SJoseph KoshyInstall everything built by a preceding 2787b710ab2SJoseph Koshy.Cm buildworld 2797b710ab2SJoseph Koshystep into the directory hierarchy pointed to by 2807b710ab2SJoseph Koshy.Xr make 1 2817b710ab2SJoseph Koshyvariable 2827b710ab2SJoseph Koshy.Va DESTDIR . 283a3aed80dSRuslan Ermilov.Pp 28404876cf3SRuslan ErmilovIf installing onto an NFS file system and running 2858ed6451eSRuslan Ermilov.Xr make 1 2868ed6451eSRuslan Ermilovwith the 28704876cf3SRuslan Ermilov.Fl j 28804876cf3SRuslan Ermilovoption, make sure that 289a3aed80dSRuslan Ermilov.Xr rpc.lockd 8 290a3aed80dSRuslan Ermilovis running on both client and server. 291a3aed80dSRuslan ErmilovSee 292a3aed80dSRuslan Ermilov.Xr rc.conf 5 293a3aed80dSRuslan Ermilovon how to make it start at boot time. 2947b710ab2SJoseph Koshy.It Cm toolchain 2957b710ab2SJoseph KoshyCreate the build toolchain needed to build the rest of the system. 2967b710ab2SJoseph KoshyFor cross-architecture builds, this step creates a cross-toolchain. 2977b710ab2SJoseph Koshy.It Cm universe 2984e889921SJohn BaldwinFor each architecture, 2994e889921SJohn Baldwinexecute a 3007b710ab2SJoseph Koshy.Cm buildworld 3014e889921SJohn Baldwinfollowed by a 3027b710ab2SJoseph Koshy.Cm buildkernel 3034e889921SJohn Baldwinfor all kernels for that architecture, 3044e889921SJohn Baldwinincluding 3054e889921SJohn Baldwin.Pa LINT . 3067b710ab2SJoseph KoshyThis command takes a long time. 307e1b9162fSWarner Losh.It Cm kernels 308e1b9162fSWarner LoshLike 309e1b9162fSWarner Losh.Cm universe 310e1b9162fSWarner Loshwith 311e1b9162fSWarner Losh.Va WITHOUT_WORLDS 312e1b9162fSWarner Loshdefined so only the kernels for each architecture are built. 313e1b9162fSWarner Losh.It Cm worlds 314e1b9162fSWarner LoshLike 315e1b9162fSWarner Losh.Cm universe 316e1b9162fSWarner Loshwith 317e1b9162fSWarner Losh.Va WITHOUT_KERNELS 318e1b9162fSWarner Loshdefined so only the worlds for each architecture are built. 319f1d16bd8SBjoern A. Zeeb.It Cm targets 320f1d16bd8SBjoern A. ZeebPrint a list of supported 321f1d16bd8SBjoern A. Zeeb.Va TARGET 322f1d16bd8SBjoern A. Zeeb/ 323f1d16bd8SBjoern A. Zeeb.Va TARGET_ARCH 324f1d16bd8SBjoern A. Zeebpairs for world and kernel targets. 325eee8163bSBjoern A. Zeeb.It Cm tinderbox 326eee8163bSBjoern A. ZeebExecute the same targets as 327eee8163bSBjoern A. Zeeb.Cm universe . 328eee8163bSBjoern A. ZeebIn addition print a summary of all failed targets at the end and 329eee8163bSBjoern A. Zeebexit with an error if there were any. 3304e889921SJohn Baldwin.It Cm toolchains 3314e889921SJohn BaldwinCreate a build toolchain for each architecture supported by the build system. 332b135fb6eSBryan Drewery.It Cm xdev 333b135fb6eSBryan DreweryBuilds and installs a cross-toolchain and sysroot for the given 334b135fb6eSBryan Drewery.Sy TARGET 335b135fb6eSBryan Dreweryand 336b135fb6eSBryan Drewery.Sy TARGET_ARCH . 337b135fb6eSBryan DreweryThe sysroot contains target library and headers. 338b135fb6eSBryan DreweryThe target is an alias for 339b135fb6eSBryan Drewery.Cm xdev-build 340b135fb6eSBryan Dreweryand 341b135fb6eSBryan Drewery.Cm xdev-install . 342b135fb6eSBryan DreweryThe location of the files installed can be controlled with 343b135fb6eSBryan Drewery.Va DESTDIR . 344b135fb6eSBryan DreweryThe target location in 345b135fb6eSBryan Drewery.Va DESTDIR 346b135fb6eSBryan Dreweryis 347b135fb6eSBryan Drewery.Pa ${DESTDIR}/${XDTP} 348b135fb6eSBryan Drewerywhere 349b135fb6eSBryan Drewery.Va XDTP 350b135fb6eSBryan Drewerydefaults to 351b135fb6eSBryan Drewery.Pa /usr/${XDDIR} 352b135fb6eSBryan Dreweryand 353b135fb6eSBryan Drewery.Va XDDIR 354b135fb6eSBryan Drewerydefaults to 355b135fb6eSBryan Drewery.Pa ${TARGET_ARCH}-freebsd . 356b135fb6eSBryan Drewery.It Cm xdev-build 357b135fb6eSBryan DreweryBuilds for the 358b135fb6eSBryan Drewery.Cm xdev 359b135fb6eSBryan Drewerytarget. 360b135fb6eSBryan Drewery.It Cm xdev-install 361b135fb6eSBryan DreweryInstalls the files for the 362b135fb6eSBryan Drewery.Cm xdev 363b135fb6eSBryan Drewerytarget. 364b135fb6eSBryan Drewery.It Cm xdev-links 365b135fb6eSBryan DreweryInstalls autoconf-style symlinks to 366b135fb6eSBryan Drewery.Pa ${DESTDIR}/usr/bin 367b135fb6eSBryan Drewerypointing into the xdev toolchain in 368b135fb6eSBryan Drewery.Pa ${DESTDIR}/${XDTP} . 369786aa69aSBen Smithurst.El 370786aa69aSBen Smithurst.Pp 3717b710ab2SJoseph KoshyKernel specific build targets in 372786aa69aSBen Smithurst.Pa /usr/src 3737b710ab2SJoseph Koshyare: 374e8423d00SNathan Whitehorn.Bl -tag -width ".Cm distributekernel" 3751caae057SRuslan Ermilov.It Cm buildkernel 3761caae057SRuslan ErmilovRebuild the kernel and the kernel modules. 377d90f12e3SWarren BlockThe object directory can be changed from the default 378d90f12e3SWarren Block.Pa /usr/obj 379d90f12e3SWarren Blockby setting the 380d90f12e3SWarren Block.Pa MAKEOBJDIRPREFIX 381d90f12e3SWarren Block.Xr make 1 382d90f12e3SWarren Blockvariable. 3831caae057SRuslan Ermilov.It Cm installkernel 3847b710ab2SJoseph KoshyInstall the kernel and the kernel modules to directory 3857b710ab2SJoseph Koshy.Pa ${DESTDIR}/boot/kernel , 3867b710ab2SJoseph Koshyrenaming any pre-existing directory with this name to 3877b710ab2SJoseph Koshy.Pa kernel.old 3887b710ab2SJoseph Koshyif it contained the currently running kernel. 3897b710ab2SJoseph KoshyThe target directory under 3907b710ab2SJoseph Koshy.Pa ${DESTDIR} 3917b710ab2SJoseph Koshymay be modified using the 3927b710ab2SJoseph Koshy.Va INSTKERNNAME 3937b710ab2SJoseph Koshyand 3947b710ab2SJoseph Koshy.Va KODIR 3957b710ab2SJoseph Koshy.Xr make 1 3967b710ab2SJoseph Koshyvariables. 397e8423d00SNathan Whitehorn.It Cm distributekernel 398e8423d00SNathan WhitehornInstall the kernel to the directory 399e8423d00SNathan Whitehorn.Pa ${DISTDIR}/kernel/boot/kernel . 400e8423d00SNathan WhitehornThis target is used while building a release; see 401e8423d00SNathan Whitehorn.Xr release 7 . 402e8423d00SNathan Whitehorn.It Cm packagekernel 403e8423d00SNathan WhitehornArchive the results of 404e8423d00SNathan Whitehorn.Cm distributekernel , 405e8423d00SNathan Whitehornplacing the results in 406e8423d00SNathan Whitehorn.Va DISTDIR . 407e8423d00SNathan WhitehornThis target is used while building a release; see 408e8423d00SNathan Whitehorn.Xr release 7 . 409389e98a7STom Rhodes.It Cm kernel 410389e98a7STom RhodesEquivalent to 411389e98a7STom Rhodes.Cm buildkernel 412389e98a7STom Rhodesfollowed by 413389e98a7STom Rhodes.Cm installkernel 4147b710ab2SJoseph Koshy.It Cm kernel-toolchain 4157b710ab2SJoseph KoshyRebuild the tools needed for kernel compilation. 4167b710ab2SJoseph KoshyUse this if you did not do a 4177b710ab2SJoseph Koshy.Cm buildworld 4187b710ab2SJoseph Koshyfirst. 4197b710ab2SJoseph Koshy.It Cm reinstallkernel 4207b710ab2SJoseph KoshyReinstall the kernel and the kernel modules, overwriting the contents 4217b710ab2SJoseph Koshyof the target directory. 4227b710ab2SJoseph KoshyAs with the 4237b710ab2SJoseph Koshy.Cm installkernel 4247b710ab2SJoseph Koshytarget, the target directory can be specified using the 4257b710ab2SJoseph Koshy.Xr make 1 4267b710ab2SJoseph Koshyvariable 4277b710ab2SJoseph Koshy.Va INSTKERNNAME . 4287b710ab2SJoseph Koshy.El 4297b710ab2SJoseph Koshy.Pp 4307b710ab2SJoseph KoshyConvenience targets for cleaning up the install destination directory 4317b710ab2SJoseph Koshydenoted by variable 4327b710ab2SJoseph Koshy.Va DESTDIR 4337b710ab2SJoseph Koshyinclude: 4347b710ab2SJoseph Koshy.Bl -tag -width ".Cm delete-old-libs" 4357b710ab2SJoseph Koshy.It Cm check-old 436abfabbeaSMike PritchardPrint a list of old files and directories in the system. 437e2a36081SAlexander Leidinger.It Cm delete-old 438e2a36081SAlexander LeidingerDelete obsolete base system files and directories interactively. 43978ad5421SRuslan ErmilovWhen 44078ad5421SRuslan Ermilov.Li -DBATCH_DELETE_OLD_FILES 4417b710ab2SJoseph Koshyis specified at the command line, the delete operation will be 4427b710ab2SJoseph Koshynon-interactive. 443c8ef0ed5SRuslan ErmilovThe variables 4447b710ab2SJoseph Koshy.Va DESTDIR , 4457b710ab2SJoseph Koshy.Va TARGET_ARCH 446c8ef0ed5SRuslan Ermilovand 447c8ef0ed5SRuslan Ermilov.Va TARGET 448c8ef0ed5SRuslan Ermilovshould be set as with 449c8ef0ed5SRuslan Ermilov.Dq Li "make installworld" . 450e2a36081SAlexander Leidinger.It Cm delete-old-libs 451e2a36081SAlexander LeidingerDelete obsolete base system libraries interactively. 452d90f12e3SWarren BlockThis target should only be used if no third party software uses these 4537b710ab2SJoseph Koshylibraries. 45478ad5421SRuslan ErmilovWhen 45578ad5421SRuslan Ermilov.Li -DBATCH_DELETE_OLD_FILES 4567b710ab2SJoseph Koshyis specified at the command line, the delete operation will be 4577b710ab2SJoseph Koshynon-interactive. 458c8ef0ed5SRuslan ErmilovThe variables 4597b710ab2SJoseph Koshy.Va DESTDIR , 4607b710ab2SJoseph Koshy.Va TARGET_ARCH 461c8ef0ed5SRuslan Ermilovand 462c8ef0ed5SRuslan Ermilov.Va TARGET 463c8ef0ed5SRuslan Ermilovshould be set as with 464c8ef0ed5SRuslan Ermilov.Dq Li "make installworld" . 465786aa69aSBen Smithurst.El 466b82e53e2SMurray Stokely.Sh ENVIRONMENT 4677b710ab2SJoseph KoshyVariables that influence all builds include: 4687b710ab2SJoseph Koshy.Bl -tag -width ".Va MAKEOBJDIRPREFIX" 469fea87c03SGiorgos Keramidas.It Va DEBUG_FLAGS 470fea87c03SGiorgos KeramidasDefines a set of debugging flags that will be used to build all userland 471fea87c03SGiorgos Keramidasbinaries under 472fea87c03SGiorgos Keramidas.Pa /usr/src . 473fea87c03SGiorgos KeramidasWhen 474fea87c03SGiorgos Keramidas.Va DEBUG_FLAGS 475fea87c03SGiorgos Keramidasis defined, the 476fea87c03SGiorgos Keramidas.Cm install 477fea87c03SGiorgos Keramidasand 478fea87c03SGiorgos Keramidas.Cm installworld 479fea87c03SGiorgos Keramidastargets install binaries from the current 480fea87c03SGiorgos Keramidas.Va MAKEOBJDIRPREFIX 481fea87c03SGiorgos Keramidaswithout stripping, 482fea87c03SGiorgos Keramidasso that debugging information is retained in the installed binaries. 4837b710ab2SJoseph Koshy.It Va DESTDIR 4847b710ab2SJoseph KoshyThe directory hierarchy prefix where built objects will be installed. 4857b710ab2SJoseph KoshyIf not set, 4867b710ab2SJoseph Koshy.Va DESTDIR 4877b710ab2SJoseph Koshydefaults to the empty string. 4887b710ab2SJoseph Koshy.It Va MAKEOBJDIRPREFIX 4897b710ab2SJoseph KoshyDefines the prefix for directory names in the tree of built objects. 4907b710ab2SJoseph KoshyDefaults to 4917b710ab2SJoseph Koshy.Pa /usr/obj 4927b710ab2SJoseph Koshyif not defined. 493dfa09989SBryan DreweryThis variable should only be set in the environment or 494dfa09989SBryan Drewery.Pa /etc/src-env.conf 495dfa09989SBryan Dreweryand not via 4967b710ab2SJoseph Koshy.Pa /etc/make.conf 497dfa09989SBryan Dreweryor 498dfa09989SBryan Drewery.Pa /etc/src.conf 4997b710ab2SJoseph Koshyor the command line. 5007fa2f2a6SAlex Richardson.It Va WITHOUT_WERROR 5017b710ab2SJoseph KoshyIf defined, compiler warnings will not cause the build to halt, 5027b710ab2SJoseph Koshyeven if the makefile says otherwise. 50321edb039SAlexander Leidinger.It Va WITH_CTF 50421edb039SAlexander LeidingerIf defined, the build process will run the DTrace CTF conversion 50521edb039SAlexander Leidingertools on built objects. 5067b710ab2SJoseph Koshy.El 5077b710ab2SJoseph Koshy.Pp 5087b710ab2SJoseph KoshyAdditionally, builds in 5097b710ab2SJoseph Koshy.Pa /usr/src 5107b710ab2SJoseph Koshyare influenced by the following 5117b710ab2SJoseph Koshy.Xr make 1 5127b710ab2SJoseph Koshyvariables: 51321ef3591SJohn Baldwin.Bl -tag -width ".Va LOCAL_MODULES_DIR" 51421ef3591SJohn Baldwin.It Va CROSS_TOOLCHAIN 51521ef3591SJohn BaldwinRequests use of an external toolchain to build either the world or kernel. 51621ef3591SJohn BaldwinThis value of this variable can either be the full path to a file, 51721ef3591SJohn Baldwinor the base name of a file in 51821ef3591SJohn Baldwin.Pa ${LOCALBASE}/share/toolchains . 51921ef3591SJohn BaldwinThe file should be a make file which sets variables to request an external 52021ef3591SJohn Baldwintoolchain such as 52121ef3591SJohn Baldwin.Va XCC . 52221ef3591SJohn Baldwin.Pp 52321ef3591SJohn BaldwinExternal toolchains are available in ports for both LLVM and GCC/binutils. 52421ef3591SJohn BaldwinFor external toolchains available in ports, 52521ef3591SJohn Baldwin.Va CROSS_TOOLCHAIN 52621ef3591SJohn Baldwinshould be set to the name of the package. 52721ef3591SJohn BaldwinLLVM toolchain packages use the name llvm<major version>. 52821ef3591SJohn BaldwinGCC toolchains provide separate packages for each architecture and use the 52921ef3591SJohn Baldwinname ${MACHINE_ARCH}-gcc<major version>. 530e6cdeeddSWarner Losh.It Va KERNCONF 531e6cdeeddSWarner LoshOverrides which kernel to build and install for the various kernel 532e6cdeeddSWarner Loshmake targets. 533e6cdeeddSWarner LoshIt defaults to 534e6cdeeddSWarner Losh.Cm GENERIC . 5354b2cc4d1SKyle Evans.It Va KERNCONFDIR 5364b2cc4d1SKyle EvansOverrides the directory in which 5374b2cc4d1SKyle Evans.Va KERNCONF 5384b2cc4d1SKyle Evansand any files included by 5394b2cc4d1SKyle Evans.Va KERNCONF 5404b2cc4d1SKyle Evansshould be found. 5414b2cc4d1SKyle EvansDefaults to 5424b2cc4d1SKyle Evans.Pa sys/${ARCH}/conf . 543e6cdeeddSWarner Losh.It Va KERNFAST 544e6cdeeddSWarner LoshIf set, the build target 545e6cdeeddSWarner Losh.Cm buildkernel 546e6cdeeddSWarner Loshdefaults to setting 547e6cdeeddSWarner Losh.Va NO_KERNELCLEAN , 5486d50d5e4SWarner Losh.Va NO_KERNELCONFIG , 549e6cdeeddSWarner Loshand 5506d50d5e4SWarner Losh.Va NO_KERNELOBJ . 551e6cdeeddSWarner LoshWhen set to a value other than 552e6cdeeddSWarner Losh.Cm 1 553e6cdeeddSWarner Loshthen 554e6cdeeddSWarner Losh.Va KERNCONF 555e6cdeeddSWarner Loshis set to the value of 556e6cdeeddSWarner Losh.Va KERNFAST . 5577b710ab2SJoseph Koshy.It Va LOCAL_DIRS 558ca6a54ceSBryan DreweryIf set, this variable supplies a list of additional directories relative to 559ca6a54ceSBryan Drewerythe root of the source tree to build as part of the 560ca6a54ceSBryan Drewery.Cm everything 561ca6a54ceSBryan Drewerytarget. 562e93e5bb0SIan LeporeThe directories are built in parallel with each other, 563e93e5bb0SIan Leporeand with the base system directories. 564e93e5bb0SIan LeporeInsert a 565e93e5bb0SIan Lepore.Va .WAIT 566e93e5bb0SIan Leporedirective at the beginning of the 567e93e5bb0SIan Lepore.Va LOCAL_DIRS 568e93e5bb0SIan Leporelist to ensure all base system directories are built first. 569e93e5bb0SIan Lepore.Va .WAIT 570e93e5bb0SIan Leporemay also be used as needed elsewhere within the list. 571a0e6a013SBryan Drewery.It Va LOCAL_ITOOLS 572a0e6a013SBryan DreweryIf set, this variable supplies a list of additional tools that are used by the 573a0e6a013SBryan Drewery.Cm installworld 574a0e6a013SBryan Dreweryand 575a0e6a013SBryan Drewery.Cm distributeworld 576a0e6a013SBryan Drewerytargets. 577ca6a54ceSBryan Drewery.It Va LOCAL_LIB_DIRS 578ca6a54ceSBryan DreweryIf set, this variable supplies a list of additional directories relative to 579ca6a54ceSBryan Drewerythe root of the source tree to build as part of the 580ca6a54ceSBryan Drewery.Cm libraries 581ca6a54ceSBryan Drewerytarget. 582e93e5bb0SIan LeporeThe directories are built in parallel with each other, 583e93e5bb0SIan Leporeand with the base system libraries. 584e93e5bb0SIan LeporeInsert a 585e93e5bb0SIan Lepore.Va .WAIT 586e93e5bb0SIan Leporedirective at the beginning of the 587e93e5bb0SIan Lepore.Va LOCAL_DIRS 588e93e5bb0SIan Leporelist to ensure all base system libraries are built first. 589e93e5bb0SIan Lepore.Va .WAIT 590e93e5bb0SIan Leporemay also be used as needed elsewhere within the list. 591ca6a54ceSBryan Drewery.It Va LOCAL_MTREE 592ca6a54ceSBryan DreweryIf set, this variable supplies a list of additional mtrees relative to the 593ca6a54ceSBryan Dreweryroot of the source tree to use as part of the 594ca6a54ceSBryan Drewery.Cm hierarchy 595ca6a54ceSBryan Drewerytarget. 59680cedb80SBryan Drewery.It Va LOCAL_LEGACY_DIRS 59780cedb80SBryan DreweryIf set, this variable supplies a list of additional directories relative to 59880cedb80SBryan Drewerythe root of the source tree to build as part of the 59980cedb80SBryan Drewery.Cm legacy 60080cedb80SBryan Drewerytarget. 60180cedb80SBryan Drewery.It Va LOCAL_BSTOOL_DIRS 60280cedb80SBryan DreweryIf set, this variable supplies a list of additional directories relative to 60380cedb80SBryan Drewerythe root of the source tree to build as part of the 60480cedb80SBryan Drewery.Cm bootstrap-tools 60580cedb80SBryan Drewerytarget. 606ca6a54ceSBryan Drewery.It Va LOCAL_TOOL_DIRS 607ca6a54ceSBryan DreweryIf set, this variable supplies a list of additional directories relative to 608ca6a54ceSBryan Drewerythe root of the source tree to build as part of the 609ca6a54ceSBryan Drewery.Cm build-tools 610ca6a54ceSBryan Drewerytarget. 6114143850bSBryan Drewery.It Va LOCAL_XTOOL_DIRS 6124143850bSBryan DreweryIf set, this variable supplies a list of additional directories relative to 6134143850bSBryan Drewerythe root of the source tree to build as part of the 6144143850bSBryan Drewery.Cm cross-tools 6154143850bSBryan Drewerytarget. 616170c2788SGlen Barber.It Va PORTS_MODULES 617170c2788SGlen BarberA list of ports with kernel modules that should be built and installed 618170c2788SGlen Barberas part of the 619170c2788SGlen Barber.Cm buildkernel 620170c2788SGlen Barberand 621170c2788SGlen Barber.Cm installkernel 622170c2788SGlen Barberprocess. 623170c2788SGlen Barber.Bd -literal -offset indent 6247fbc0c98SMitchell Hornemake PORTS_MODULES=emulators/virtualbox-ose-kmod kernel 625170c2788SGlen Barber.Ed 626e7a13643SMark Johnston.It Va LOCAL_MODULES 627e7a13643SMark JohnstonA list of external kernel modules that should be built and installed 628e7a13643SMark Johnstonas part of the 629e7a13643SMark Johnston.Cm buildkernel 630e7a13643SMark Johnstonand 631e7a13643SMark Johnston.Cm installkernel 632e7a13643SMark Johnstonprocess. 633805c3af8SMark JohnstonDefaults to the list of sub-directories of 634805c3af8SMark Johnston.Va LOCAL_MODULES_DIR . 635e7a13643SMark Johnston.It Va LOCAL_MODULES_DIR 636e7a13643SMark JohnstonThe directory in which to search for the kernel modules specified by 637e7a13643SMark Johnston.Va LOCAL_MODULES . 638e7a13643SMark JohnstonEach kernel module should consist of a directory containing a makefile. 639e7a13643SMark JohnstonDefaults to 640e7a13643SMark Johnston.Pa ${LOCALBASE}/sys/modules . 641e6ca6901SGordon Bergling.It Va SRCCONF 642e6ca6901SGordon BerglingSpecify a file to override the default 643e6ca6901SGordon Bergling.Pa /etc/src.conf . 644e6ca6901SGordon BerglingThe src.conf file controls the components to build. 645e6ca6901SGordon BerglingSee 646e6ca6901SGordon Bergling.Xr src.conf 5 64742e7be20SEnji Cooper.It Va STRIPBIN 6483547290fSEnji CooperCommand to use at install time when stripping binaries. 6493547290fSEnji CooperBe sure to add any additional tools required to run 65042e7be20SEnji Cooper.Va STRIPBIN 6513547290fSEnji Cooperto the 6523547290fSEnji Cooper.Va LOCAL_ITOOLS 6533547290fSEnji Cooper.Xr make 1 6543547290fSEnji Coopervariable before running the 6553547290fSEnji Cooper.Cm distributeworld 6563547290fSEnji Cooperor 6573547290fSEnji Cooper.Cm installworld 6583547290fSEnji Coopertargets. 6593547290fSEnji CooperSee 6603547290fSEnji Cooper.Xr install 1 6613547290fSEnji Cooperfor more details. 6627b710ab2SJoseph Koshy.It Va SUBDIR_OVERRIDE 6637b710ab2SJoseph KoshyOverride the default list of sub-directories and only build the 6647b710ab2SJoseph Koshysub-directory named in this variable. 6657f1636b7SBryan DreweryIf combined with 6667f1636b7SBryan Drewery.Cm buildworld 6677f1636b7SBryan Drewerythen all libraries and includes, and some of the build tools will still build 6687f1636b7SBryan Dreweryas well. 669c889d480SBryan DrewerySpecifying 670c889d480SBryan Drewery.Cm -DNO_LIBS , 671c889d480SBryan Dreweryand 672c889d480SBryan Drewery.Cm -DWORLDFAST 673c889d480SBryan Drewerywill only build the specified directory as was done historically. 6747f1636b7SBryan DreweryWhen combined with 6757f1636b7SBryan Drewery.Cm buildworld 676ffc4f93eSBenedict Reuschlingit is necessary to override 6777f1636b7SBryan Drewery.Va LOCAL_LIB_DIRS 6787f1636b7SBryan Drewerywith any custom directories containing libraries. 6797f1636b7SBryan DreweryThis allows building a subset of the system in the same way as 6807f1636b7SBryan Drewery.Cm buildworld 6817f1636b7SBryan Drewerydoes using its sysroot handling. 6827f1636b7SBryan DreweryThis variable can also be useful when debugging failed builds. 6837b710ab2SJoseph Koshy.Bd -literal -offset indent 6847b710ab2SJoseph Koshymake some-target SUBDIR_OVERRIDE=foo/bar 6857b710ab2SJoseph Koshy.Ed 686def657b8SWarner Losh.It Va SYSDIR 687def657b8SWarner LoshSpecify the location of the kernel source to override the default 688def657b8SWarner Losh.Pa /usr/src/sys . 689def657b8SWarner LoshThe kernel source is located in the 690def657b8SWarner Losh.Pa sys 691def657b8SWarner Loshsubdirectory of the source tree checked out from the 692def657b8SWarner Losh.Pa src.git 693def657b8SWarner Loshrepository. 6946f9ac6feSMurray Stokely.It Va TARGET 695b3a43ea3SMurray StokelyThe target hardware platform. 696365a17c0SMurray StokelyThis is analogous to the 6971caae057SRuslan Ermilov.Dq Nm uname Fl m 698b3a43ea3SMurray Stokelyoutput. 699b3a43ea3SMurray StokelyThis is necessary to cross-build some target architectures. 7002f6a7e42SEnji CooperFor example, cross-building for ARM64 machines requires 7012f6a7e42SEnji Cooper.Va TARGET_ARCH Ns = Ns Li aarch64 702b3a43ea3SMurray Stokelyand 7032f6a7e42SEnji Cooper.Va TARGET Ns = Ns Li arm64 . 7047b710ab2SJoseph KoshyIf not set, 7057b710ab2SJoseph Koshy.Va TARGET 706f4721165SEdward Tomasz Napieraladefaults to the current hardware platform, unless 707f4721165SEdward Tomasz Napierala.Va TARGET_ARCH 708f4721165SEdward Tomasz Napieralais also set, in which case it defaults to the appropriate 709f4721165SEdward Tomasz Napieralavalue for that architecture. 7107b710ab2SJoseph Koshy.It Va TARGET_ARCH 7117b710ab2SJoseph KoshyThe target machine processor architecture. 7127b710ab2SJoseph KoshyThis is analogous to the 7137b710ab2SJoseph Koshy.Dq Nm uname Fl p 7147b710ab2SJoseph Koshyoutput. 7157b710ab2SJoseph KoshySet this to cross-build for a different architecture. 7167b710ab2SJoseph KoshyIf not set, 7177b710ab2SJoseph Koshy.Va TARGET_ARCH 718531b260aSWarner Loshdefaults to the current machine architecture, unless 719531b260aSWarner Losh.Va TARGET 720531b260aSWarner Loshis also set, in which case it defaults to the appropriate 721531b260aSWarner Loshvalue for that platform. 722c22c7f86SWarner LoshTypically, one only needs to set 723c22c7f86SWarner Losh.Va TARGET . 7247b710ab2SJoseph Koshy.El 7257b710ab2SJoseph Koshy.Pp 7267b710ab2SJoseph KoshyBuilds under directory 727fd23b461SGiorgos Keramidas.Pa /usr/src 7287d6af40dSGlen Barberare also influenced by defining one or more of the following symbols, 729fd23b461SGiorgos Keramidasusing the 730fd23b461SGiorgos Keramidas.Fl D 731fd23b461SGiorgos Keramidasoption of 732fd23b461SGiorgos Keramidas.Xr make 1 : 73321ef3591SJohn Baldwin.Bl -tag -width ".Va LOADER_DEFAULT_INTERP" 73401012c64SWarner Losh.It Va LOADER_DEFAULT_INTERP 73501012c64SWarner LoshDefines what interpreter the default loader program will have. 73601012c64SWarner LoshValid values include 73701012c64SWarner Losh.Dq 4th , 73801012c64SWarner Losh.Dq lua , 73901012c64SWarner Loshand 74001012c64SWarner Losh.Dq simp . 74101012c64SWarner LoshThis creates the default link for 74201012c64SWarner Losh.Pa /boot/loader 74301012c64SWarner Loshto the loader with that interpreter. 74401012c64SWarner LoshIt also determines what interpreter is compiled into 74501012c64SWarner Losh.Pa userboot . 746fd23b461SGiorgos Keramidas.It Va NO_CLEANDIR 747fd23b461SGiorgos KeramidasIf set, the build targets that clean parts of the object tree use the 748fd23b461SGiorgos Keramidasequivalent of 749fd23b461SGiorgos Keramidas.Dq make clean 750fd23b461SGiorgos Keramidasinstead of 751fd23b461SGiorgos Keramidas.Dq make cleandir . 752fd23b461SGiorgos Keramidas.It Va NO_CLEAN 753fd23b461SGiorgos KeramidasIf set, no object tree files are cleaned at all. 754473fda75SBryan DreweryThis is the default when 755473fda75SBryan Drewery.Va WITH_META_MODE 756473fda75SBryan Dreweryis used with 757473fda75SBryan Drewery.Xr filemon 4 758473fda75SBryan Dreweryloaded. 759473fda75SBryan DrewerySee 760473fda75SBryan Drewery.Xr src.conf 5 761473fda75SBryan Dreweryfor more details. 762fd23b461SGiorgos KeramidasSetting 763fd23b461SGiorgos Keramidas.Va NO_CLEAN 764fd23b461SGiorgos Keramidasimplies 765fd23b461SGiorgos Keramidas.Va NO_KERNELCLEAN , 766fd23b461SGiorgos Keramidasso when 767fd23b461SGiorgos Keramidas.Va NO_CLEAN 768fd23b461SGiorgos Keramidasis set no kernel objects are cleaned either. 769fd23b461SGiorgos Keramidas.It Va NO_CTF 770fd23b461SGiorgos KeramidasIf set, the build process does not run the DTrace CTF conversion tools 771fd23b461SGiorgos Keramidason built objects. 772fd23b461SGiorgos Keramidas.It Va NO_SHARE 773fd23b461SGiorgos KeramidasIf set, the build does not descend into the 774fd23b461SGiorgos Keramidas.Pa /usr/src/share 775d90f12e3SWarren Blocksubdirectory (i.e., manual pages, locale data files, timezone data files and 776fd23b461SGiorgos Keramidasother 777fd23b461SGiorgos Keramidas.Pa /usr/src/share 778fd23b461SGiorgos Keramidasfiles will not be rebuild from their sources). 779fd23b461SGiorgos Keramidas.It Va NO_KERNELCLEAN 780fd23b461SGiorgos KeramidasIf set, the build process does not run 781fd23b461SGiorgos Keramidas.Dq make clean 782fd23b461SGiorgos Keramidasas part of the 783fd23b461SGiorgos Keramidas.Cm buildkernel 784fd23b461SGiorgos Keramidastarget. 785fd23b461SGiorgos Keramidas.It Va NO_KERNELCONFIG 786fd23b461SGiorgos KeramidasIf set, the build process does not run 787fd23b461SGiorgos Keramidas.Xr config 8 788fd23b461SGiorgos Keramidasas part of the 789fd23b461SGiorgos Keramidas.Cm buildkernel 790fd23b461SGiorgos Keramidastarget. 7916d50d5e4SWarner Losh.It Va NO_KERNELOBJ 7926d50d5e4SWarner LoshIf set, the build process does not run 7936d50d5e4SWarner Losh.Dq make obj 7946d50d5e4SWarner Loshas part of the 7956d50d5e4SWarner Losh.Cm buildkernel 7966d50d5e4SWarner Loshtarget. 797c596c287SBryan Drewery.It Va NO_LIBS 798c596c287SBryan DreweryIf set, the libraries phase will be skipped. 7992abeba9dSBryan Drewery.It Va NO_OBJWALK 8006d75a7a8SBryan DreweryIf set, no object directories will be created. 8016d75a7a8SBryan DreweryThis should only be used if object directories were created in a 8026d75a7a8SBryan Dreweryprevious build and no new directories are connected. 80321ef3591SJohn Baldwin.It Va UNIVERSE_TOOLCHAIN 80421ef3591SJohn BaldwinRequests use of the toolchain built as part of the 80521ef3591SJohn Baldwin.Cm universe 80621ef3591SJohn Baldwintarget as an external toolchain. 80716892c77SBryan Drewery.It Va WORLDFAST 80816892c77SBryan DreweryIf set, the build target 80916892c77SBryan Drewery.Cm buildworld 81016892c77SBryan Drewerydefaults to setting 81116892c77SBryan Drewery.Va NO_CLEAN , 8122abeba9dSBryan Drewery.Va NO_OBJWALK , 81316892c77SBryan Dreweryand will skip most bootstrap phases. 81416892c77SBryan DreweryIt will only bootstrap libraries and build all of userland. 81516892c77SBryan DreweryThis option should be used only when it is known that none of the bootstrap 81616892c77SBryan Dreweryneeds changed and that no new directories have been connected to the build. 817fd23b461SGiorgos Keramidas.El 818fd23b461SGiorgos Keramidas.Pp 819fd23b461SGiorgos KeramidasBuilds under directory 8207b710ab2SJoseph Koshy.Pa /usr/doc 8217b710ab2SJoseph Koshyare influenced by the following 8227b710ab2SJoseph Koshy.Xr make 1 8237b710ab2SJoseph Koshyvariables: 8247b710ab2SJoseph Koshy.Bl -tag -width ".Va DOC_LANG" 8257b710ab2SJoseph Koshy.It Va DOC_LANG 8267b710ab2SJoseph KoshyIf set, restricts the documentation build to the language subdirectories 8277b710ab2SJoseph Koshyspecified as its content. 8287b710ab2SJoseph KoshyThe default action is to build documentation for all languages. 829b82e53e2SMurray Stokely.El 8304e889921SJohn Baldwin.Pp 8314e889921SJohn BaldwinBuilds using the 8324e889921SJohn Baldwin.Cm universe 833e1b9162fSWarner Loshand related targets are influenced by the following 8344e889921SJohn Baldwin.Xr make 1 8354e889921SJohn Baldwinvariables: 83621ef3591SJohn Baldwin.Bl -tag -width ".Va USE_GCC_TOOLCHAINS" 8374e889921SJohn Baldwin.It Va JFLAG 8384e889921SJohn BaldwinPass the value of this variable to each 8394e889921SJohn Baldwin.Xr make 1 8404e889921SJohn Baldwininvocation used to build worlds and kernels. 8414e889921SJohn BaldwinThis can be used to enable multiple jobs within a single architecture's build 8424e889921SJohn Baldwinwhile still building each architecture serially. 8434e889921SJohn Baldwin.It Va MAKE_JUST_KERNELS 8444e889921SJohn BaldwinOnly build kernels for each supported architecture. 8454e889921SJohn Baldwin.It Va MAKE_JUST_WORLDS 8464e889921SJohn BaldwinOnly build worlds for each supported architecture. 847a7783b5aSWarner Losh.It Va WITHOUT_WORLDS 848a7783b5aSWarner LoshOnly build kernels for each supported architecture. 849a7783b5aSWarner Losh.It Va WITHOUT_KERNELS 850a7783b5aSWarner LoshOnly build worlds for each supported architecture. 8514e889921SJohn Baldwin.It Va UNIVERSE_TARGET 8524e889921SJohn BaldwinExecute the specified 8534e889921SJohn Baldwin.Xr make 1 8544e889921SJohn Baldwintarget for each supported architecture instead of the default action of 8554e889921SJohn Baldwinbuilding a world and one or more kernels. 856a7783b5aSWarner LoshThis variable implies 857a7783b5aSWarner Losh.Va WITHOUT_KERNELS . 85821ef3591SJohn Baldwin.It Va USE_GCC_TOOLCHAINS 85921ef3591SJohn BaldwinUse external GCC toolchains to build the requested targets. 86021ef3591SJohn BaldwinIf the required toolchain package for a supported architecture is not installed, 86121ef3591SJohn Baldwinthe build for that architecture is skipped. 862e1b9162fSWarner Losh.It Va TARGETS 863e1b9162fSWarner LoshOnly build the listed targets instead of each supported architecture. 864e1b9162fSWarner Losh.It Va EXTRA_TARGETS 865e1b9162fSWarner LoshIn addition to the supported architectures, build the semi-supported 866e1b9162fSWarner Losharchitectures. 867e1b9162fSWarner LoshA semi-supported architecture has build support in the 868e1b9162fSWarner Losh.Fx 869e1b9162fSWarner Loshtree, but receives significantly less testing and is generally for 870e1b9162fSWarner Loshfringe uses that do not have a wide appeal. 8714e889921SJohn Baldwin.El 872786aa69aSBen Smithurst.Sh FILES 8730c0eb9beSRuslan Ermilov.Bl -tag -width ".Pa /usr/share/examples/etc/make.conf" -compact 874786aa69aSBen Smithurst.It Pa /usr/doc/Makefile 875786aa69aSBen Smithurst.It Pa /usr/doc/share/mk/doc.project.mk 876786aa69aSBen Smithurst.It Pa /usr/ports/Mk/bsd.port.mk 877786aa69aSBen Smithurst.It Pa /usr/ports/Mk/bsd.sites.mk 8781caae057SRuslan Ermilov.It Pa /usr/share/examples/etc/make.conf 8790c0eb9beSRuslan Ermilov.It Pa /usr/src/Makefile 8800c0eb9beSRuslan Ermilov.It Pa /usr/src/Makefile.inc1 8813136363fSRuslan Ermilov.El 8823faf5fc9SBen Smithurst.Sh EXAMPLES 883be6a4760SRuslan ErmilovFor an 8843faf5fc9SBen Smithurst.Dq approved 8857b710ab2SJoseph Koshymethod of updating your system from the latest sources, please see the 886be6a4760SRuslan Ermilov.Sx COMMON ITEMS 887be6a4760SRuslan Ermilovsection in 888be6a4760SRuslan Ermilov.Pa src/UPDATING . 889b82e53e2SMurray Stokely.Pp 890b82e53e2SMurray StokelyThe following sequence of commands can be used to cross-build the 891f4721165SEdward Tomasz Napieralasystem for the armv6 architecture on an amd64 host: 892b82e53e2SMurray Stokely.Bd -literal -offset indent 893b82e53e2SMurray Stokelycd /usr/src 894f4721165SEdward Tomasz Napieralamake TARGET_ARCH=armv6 buildworld buildkernel 895ecc0f5f6SEdward Tomasz Napieralamake TARGET_ARCH=armv6 DESTDIR=/clients/arm installworld installkernel 896b82e53e2SMurray Stokely.Ed 897786aa69aSBen Smithurst.Sh SEE ALSO 8987c20a493SBen Smithurst.Xr cc 1 , 899786aa69aSBen Smithurst.Xr install 1 , 900786aa69aSBen Smithurst.Xr make 1 , 901786aa69aSBen Smithurst.Xr make.conf 5 , 902157376baSJoseph Koshy.Xr src.conf 5 , 903f4721165SEdward Tomasz Napierala.Xr arch 7 , 904e444a4c6SFernando Apesteguía.Xr pkg 7 , 905a81996b6SBen Smithurst.Xr ports 7 , 906a54bda91SMurray Stokely.Xr release 7 , 90753837b18SEnji Cooper.Xr tests 7 , 90861001d75STom Rhodes.Xr config 8 , 909664eefe2SMateusz Piotrowski.Xr etcupdate 8 , 910a81996b6SBen Smithurst.Xr reboot 8 , 91153837b18SEnji Cooper.Xr shutdown 8 912*8327796cSAlexander Ziaee.Sh HISTORY 913*8327796cSAlexander ZiaeeThe 914*8327796cSAlexander Ziaee.Nm 915*8327796cSAlexander Ziaeemanpage first appeared in 916*8327796cSAlexander Ziaee.Fx 4.3 . 917786aa69aSBen Smithurst.Sh AUTHORS 918a63d6c94SBaptiste Daroussin.An Mike W. Meyer Aq Mt mwm@mired.org 919