1786aa69aSBen Smithurst.\" Copyright (c) 2000 2786aa69aSBen Smithurst.\" Mike W. Meyer 3786aa69aSBen Smithurst.\" 4786aa69aSBen Smithurst.\" Redistribution and use in source and binary forms, with or without 5786aa69aSBen Smithurst.\" modification, are permitted provided that the following conditions 6786aa69aSBen Smithurst.\" are met: 7786aa69aSBen Smithurst.\" 1. Redistributions of source code must retain the above copyright 8786aa69aSBen Smithurst.\" notice, this list of conditions and the following disclaimer. 9786aa69aSBen Smithurst.\" 2. Redistributions in binary form must reproduce the above copyright 10786aa69aSBen Smithurst.\" notice, this list of conditions and the following disclaimer in the 11786aa69aSBen Smithurst.\" documentation and/or other materials provided with the distribution. 12786aa69aSBen Smithurst.\" 13786aa69aSBen Smithurst.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND 14786aa69aSBen Smithurst.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 15786aa69aSBen Smithurst.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 16786aa69aSBen Smithurst.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE 17786aa69aSBen Smithurst.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 18786aa69aSBen Smithurst.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 19786aa69aSBen Smithurst.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 20786aa69aSBen Smithurst.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 21786aa69aSBen Smithurst.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 22786aa69aSBen Smithurst.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 23786aa69aSBen Smithurst.\" SUCH DAMAGE. 24786aa69aSBen Smithurst.\" 25786aa69aSBen Smithurst.\" $FreeBSD$ 26786aa69aSBen Smithurst.\" 27e7a13643SMark Johnston.Dd August 10, 2021 28786aa69aSBen Smithurst.Dt BUILD 7 293d45e180SRuslan Ermilov.Os 30786aa69aSBen Smithurst.Sh NAME 31786aa69aSBen Smithurst.Nm build 32e6ca6901SGordon Bergling.Nd General instructions on how to build the system 33786aa69aSBen Smithurst.Sh DESCRIPTION 347b710ab2SJoseph KoshyThe sources for the 35d003b779SRuslan Ermilov.Fx 367b710ab2SJoseph Koshysystem and its applications are contained in three different directories, 37786aa69aSBen Smithurstnormally 38786aa69aSBen Smithurst.Pa /usr/src , 39786aa69aSBen Smithurst.Pa /usr/doc , 40786aa69aSBen Smithurstand 41786aa69aSBen Smithurst.Pa /usr/ports . 4250a994c9SWarren BlockThese directories may be initially empty or non-existent until updated with 43e444a4c6SFernando ApesteguíaGit 44e444a4c6SFernando Apesteguía.Po installed from packages with 45e444a4c6SFernando Apesteguía.Xr pkg 7 46e444a4c6SFernando Apesteguíaor from 47e444a4c6SFernando Apesteguía.Xr ports 7 Pc . 487b710ab2SJoseph KoshyDirectory 49786aa69aSBen Smithurst.Pa /usr/src 50786aa69aSBen Smithurstcontains the 51786aa69aSBen Smithurst.Dq "base system" 52786aa69aSBen Smithurstsources, which is loosely defined as the things required to rebuild 53786aa69aSBen Smithurstthe system to a useful state. 547b710ab2SJoseph KoshyDirectory 55786aa69aSBen Smithurst.Pa /usr/doc 56786aa69aSBen Smithurstcontains the source for the system documentation, excluding the manual 57786aa69aSBen Smithurstpages. 587b710ab2SJoseph KoshyDirectory 59786aa69aSBen Smithurst.Pa /usr/ports 607b710ab2SJoseph Koshycontains a tree that provides a consistent interface for building and 61786aa69aSBen Smithurstinstalling third party applications. 627b710ab2SJoseph KoshyFor more information about the ports build process, see 637b710ab2SJoseph Koshy.Xr ports 7 . 64786aa69aSBen Smithurst.Pp 65786aa69aSBen SmithurstThe 66786aa69aSBen Smithurst.Xr make 1 67786aa69aSBen Smithurstcommand is used in each of these directories to build and install the 681caae057SRuslan Ermilovthings in that directory. 691caae057SRuslan ErmilovIssuing the 701caae057SRuslan Ermilov.Xr make 1 71e6ca6901SGordon Berglingcommand in any directory issues the 72e6ca6901SGordon Bergling.Xr make 1 73e6ca6901SGordon Berglingcommand recursively in all subdirectories. 74e6ca6901SGordon BerglingWith no target specified, the items in the directories are built 75e6ca6901SGordon Berglingand no further action is taken. 767b710ab2SJoseph Koshy.Pp 777b710ab2SJoseph KoshyA source tree is allowed to be read-only. 787b710ab2SJoseph KoshyAs described in 797b710ab2SJoseph Koshy.Xr make 1 , 807b710ab2SJoseph Koshyobjects are usually built in a separate object directory hierarchy 817b710ab2SJoseph Koshyspecified by the environment variable 827b710ab2SJoseph Koshy.Va MAKEOBJDIRPREFIX , 837b710ab2SJoseph Koshyor under 847b710ab2SJoseph Koshy.Pa /usr/obj 857b710ab2SJoseph Koshyif variable 867b710ab2SJoseph Koshy.Va MAKEOBJDIRPREFIX 877b710ab2SJoseph Koshyis not set. 88dfa09989SBryan DreweryThe canonical object directory is described in the documentation for the 897b710ab2SJoseph Koshy.Cm buildworld 907b710ab2SJoseph Koshytarget below. 917b710ab2SJoseph Koshy.Pp 927b710ab2SJoseph KoshyThe build may be controlled by defining 937b710ab2SJoseph Koshy.Xr make 1 947b710ab2SJoseph Koshyvariables described in the 957b710ab2SJoseph Koshy.Sx ENVIRONMENT 967b710ab2SJoseph Koshysection below, and by the variables documented in 977b710ab2SJoseph Koshy.Xr make.conf 5 . 987b710ab2SJoseph Koshy.Pp 99e6ca6901SGordon BerglingThe default components included in the build are specified in the file 100e6ca6901SGordon Bergling.Pa /etc/src.conf 101e6ca6901SGordon Berglingin the source tree. 102e6ca6901SGordon BerglingTo override the default file, include the SRCCONF option in the make steps, 103e6ca6901SGordon Berglingpointing to a custom src.conf file. 104e6ca6901SGordon BerglingFor more information see 105e6ca6901SGordon Bergling.Xr src.conf 5 . 106e6ca6901SGordon Bergling.Pp 1077b710ab2SJoseph KoshyThe following list provides the names and actions for the targets 1087b710ab2SJoseph Koshysupported by the build system: 1097b710ab2SJoseph Koshy.Bl -tag -width ".Cm cleandepend" 110aae63957SBryan Drewery.It Cm analyze 111aae63957SBryan DreweryRun Clang static analyzer against all objects and present output on stdout. 11271b7fa12SEnji Cooper.It Cm check 11371b7fa12SEnji CooperRun tests for a given subdirectory. 11471b7fa12SEnji CooperThe default directory used is 11571b7fa12SEnji Cooper.Pa ${.OBJDIR} , 11671b7fa12SEnji Cooperbut the check directory can be changed with 11771b7fa12SEnji Cooper.Pa ${CHECKDIR} . 11871b7fa12SEnji Cooper.It Cm checkworld 11971b7fa12SEnji CooperRun the 12071b7fa12SEnji Cooper.Fx 12171b7fa12SEnji Coopertest suite on installed world. 1221caae057SRuslan Ermilov.It Cm clean 1237b710ab2SJoseph KoshyRemove any files created during the build process. 1247b710ab2SJoseph Koshy.It Cm cleandepend 125497e8091SBryan DreweryRemove the 126497e8091SBryan Drewery.Pa ${.OBJDIR}/${DEPENDFILE}* 127497e8091SBryan Dreweryfiles generated by prior 128497e8091SBryan Drewery.Dq Li "make" 129497e8091SBryan Dreweryand 1307b710ab2SJoseph Koshy.Dq Li "make depend" 131497e8091SBryan Drewerysteps. 1327b710ab2SJoseph Koshy.It Cm cleandir 1337b710ab2SJoseph KoshyRemove the canonical object directory if it exists, or perform 1347b710ab2SJoseph Koshyactions equivalent to 1357b710ab2SJoseph Koshy.Dq Li "make clean cleandepend" 1367b710ab2SJoseph Koshyif it does not. 1377b710ab2SJoseph KoshyThis target will also remove an 1387b710ab2SJoseph Koshy.Pa obj 1397b710ab2SJoseph Koshylink in 1407b710ab2SJoseph Koshy.Pa ${.CURDIR} 1417b710ab2SJoseph Koshyif that exists. 1427b710ab2SJoseph Koshy.Pp 1437b710ab2SJoseph KoshyIt is advisable to run 1447b710ab2SJoseph Koshy.Dq Li "make cleandir" 1457b710ab2SJoseph Koshytwice: the first invocation will remove the canonical object directory 1467b710ab2SJoseph Koshyand the second one will clean up 1477b710ab2SJoseph Koshy.Pa ${.CURDIR} . 1487b710ab2SJoseph Koshy.It Cm depend 1497b710ab2SJoseph KoshyGenerate a list of build dependencies in file 1507b710ab2SJoseph Koshy.Pa ${.OBJDIR}/${DEPENDFILE} . 151497e8091SBryan DreweryPer-object dependencies are generated at build time and stored in 152497e8091SBryan Drewery.Pa ${.OBJDIR}/${DEPENDFILE}.${OBJ} . 1531caae057SRuslan Ermilov.It Cm install 1547b710ab2SJoseph KoshyInstall the results of the build to the appropriate location in the 1557b710ab2SJoseph Koshyinstallation directory hierarchy specified in variable 1567b710ab2SJoseph Koshy.Va DESTDIR . 1577b710ab2SJoseph Koshy.It Cm obj 1587b710ab2SJoseph KoshyCreate the canonical object directory associated with the current 1597b710ab2SJoseph Koshydirectory. 1607b710ab2SJoseph Koshy.It Cm objlink 1617b710ab2SJoseph KoshyCreate a symbolic link to the canonical object directory in 1627b710ab2SJoseph Koshy.Pa ${.CURDIR} . 1637b710ab2SJoseph Koshy.It Cm tags 1647b710ab2SJoseph KoshyGenerate a tags file using the program specified in the 1657b710ab2SJoseph Koshy.Xr make 1 1667b710ab2SJoseph Koshyvariable 1677b710ab2SJoseph Koshy.Va CTAGS . 1687b710ab2SJoseph KoshyThe build system supports 1697b710ab2SJoseph Koshy.Xr ctags 1 1707b710ab2SJoseph Koshyand 1717b710ab2SJoseph Koshy.Nm "GNU Global" . 1727b710ab2SJoseph Koshy.El 1737b710ab2SJoseph Koshy.Pp 1747b710ab2SJoseph KoshyThe other supported targets under directory 1757b710ab2SJoseph Koshy.Pa /usr/src 1767b710ab2SJoseph Koshyare: 1777b710ab2SJoseph Koshy.Bl -tag -width ".Cm distributeworld" 1787b710ab2SJoseph Koshy.It Cm buildenv 1797b710ab2SJoseph KoshySpawn an interactive shell with environment variables set up for 1804a238795SEd Mastebuilding the system or individual components. 1814a238795SEd MasteFor cross-building the target architecture needs to be specified with 1827b710ab2SJoseph Koshy.Xr make 1 1837b710ab2SJoseph Koshyvariables 1847b710ab2SJoseph Koshy.Va TARGET_ARCH 1857b710ab2SJoseph Koshyand 1867b710ab2SJoseph Koshy.Va TARGET . 1877b710ab2SJoseph Koshy.Pp 1884a238795SEd MasteThis target is only useful after a complete toolchain (including 1894a238795SEd Mastethe compiler, linker, assembler, headers and libraries) has been 1907b710ab2SJoseph Koshybuilt; see the 1917b710ab2SJoseph Koshy.Cm toolchain 1927b710ab2SJoseph Koshytarget below. 1937b710ab2SJoseph Koshy.It Cm buildworld 1947b710ab2SJoseph KoshyBuild everything but the kernel, configure files in 1957b710ab2SJoseph Koshy.Pa etc , 1967b710ab2SJoseph Koshyand 1977b710ab2SJoseph Koshy.Pa release . 198d90f12e3SWarren BlockThe object directory can be changed from the default 199d90f12e3SWarren Block.Pa /usr/obj 200d90f12e3SWarren Blockby setting the 201d90f12e3SWarren Block.Pa MAKEOBJDIRPREFIX 202d90f12e3SWarren Block.Xr make 1 203d90f12e3SWarren Blockvariable. 204dfa09989SBryan DreweryThe actual build location prefix used 205dfa09989SBryan Drewerydepends on the 206dfa09989SBryan Drewery.Va WITH_UNIFIED_OBJDIR 207dfa09989SBryan Dreweryoption from 208dfa09989SBryan Drewery.Xr src.conf 5 . 209dfa09989SBryan DreweryIf enabled it is 210dfa09989SBryan Drewery.Pa ${MAKEOBJDIRPREFIX}${.CURDIR}/${TARGET}.${TARGET_ARCH} 211dfa09989SBryan Dreweryfor all builds. 212dfa09989SBryan DreweryIf disabled it is 2137b710ab2SJoseph Koshy.Pa ${MAKEOBJDIRPREFIX}${.CURDIR} 2147b710ab2SJoseph Koshyfor native builds, and 215dfa09989SBryan Drewery.Pa ${MAKEOBJDIRPREFIX}/${TARGET}.${TARGET_ARCH}${.CURDIR} 2167b710ab2SJoseph Koshyfor cross builds and native builds with variable 2177b710ab2SJoseph Koshy.Va CROSS_BUILD_TESTING 2187b710ab2SJoseph Koshyset. 219*3e65b7d9SWarner Losh.It Cm cleankernel 220*3e65b7d9SWarner LoshAttempts to clean up targets built by a preceding 221*3e65b7d9SWarner Losh.Cm buildkernel , 222*3e65b7d9SWarner Loshor similar step, built from the same source directory and 223*3e65b7d9SWarner Losh.Va KERNCONF . 2247b710ab2SJoseph Koshy.It Cm cleanworld 2257b710ab2SJoseph KoshyAttempt to clean up targets built by a preceding 226c10062b9SBryan Drewery.Cm buildworld , 227*3e65b7d9SWarner Loshor similar step, built from this source directory. 228c10062b9SBryan Drewery.It Cm cleanuniverse 229c10062b9SBryan DreweryWhen 230c10062b9SBryan Drewery.Va WITH_UNIFIED_OBJDIR 231c10062b9SBryan Dreweryis enabled, attempt to clean up targets built by a preceding 232c10062b9SBryan Drewery.Cm buildworld , 233c10062b9SBryan Drewery.Cm universe , 234c10062b9SBryan Dreweryor similar step, for any architecture built from this source directory. 2357b710ab2SJoseph Koshy.It Cm distributeworld 2367b710ab2SJoseph KoshyDistribute everything compiled by a preceding 2377b710ab2SJoseph Koshy.Cm buildworld 2387b710ab2SJoseph Koshystep. 2397b710ab2SJoseph KoshyFiles are placed in the directory hierarchy specified by 2407b710ab2SJoseph Koshy.Xr make 1 2417b710ab2SJoseph Koshyvariable 2427b710ab2SJoseph Koshy.Va DISTDIR . 2437b710ab2SJoseph KoshyThis target is used while building a release; see 2447b710ab2SJoseph Koshy.Xr release 7 . 2457441e255SBryan Drewery.It Cm native-xtools 2467441e255SBryan DreweryThis target builds a cross-toolchain for the given 2477441e255SBryan Drewery.Sy TARGET 2487441e255SBryan Dreweryand 2497441e255SBryan Drewery.Sy TARGET_ARCH , 2507441e255SBryan Dreweryas well as a select list of static userland tools for the host system. 2517441e255SBryan DreweryThis is intended to be used in a jail where QEMU is used to improve 2527441e255SBryan Dreweryperformance by avoiding emulating binaries that do not need to be emulated. 2537441e255SBryan Drewery.Sy TARGET 2547441e255SBryan Dreweryand 2557441e255SBryan Drewery.Sy TARGET_ARCH 2567441e255SBryan Dreweryshould be defined. 2575bd47cc5SBryan Drewery.It Cm native-xtools-install 2585bd47cc5SBryan DreweryInstalls the results to 2595bd47cc5SBryan Drewery.Pa ${DESTDIR}/${NXTP} 2605bd47cc5SBryan Drewerywhere 2615bd47cc5SBryan Drewery.Va NXTP 2625bd47cc5SBryan Drewerydefaults to 2635bd47cc5SBryan Drewery.Pa nxb-bin . 2645bd47cc5SBryan Drewery.Sy TARGET 2655bd47cc5SBryan Dreweryand 2665bd47cc5SBryan Drewery.Sy TARGET_ARCH 2675bd47cc5SBryan Drewerymust be defined. 268e8423d00SNathan Whitehorn.It Cm packageworld 269e8423d00SNathan WhitehornArchive the results of 270e8423d00SNathan Whitehorn.Cm distributeworld , 271e8423d00SNathan Whitehornplacing the results in 272e8423d00SNathan Whitehorn.Va DISTDIR . 273e8423d00SNathan WhitehornThis target is used while building a release; see 274e8423d00SNathan Whitehorn.Xr release 7 . 2757b710ab2SJoseph Koshy.It Cm installworld 2767b710ab2SJoseph KoshyInstall everything built by a preceding 2777b710ab2SJoseph Koshy.Cm buildworld 2787b710ab2SJoseph Koshystep into the directory hierarchy pointed to by 2797b710ab2SJoseph Koshy.Xr make 1 2807b710ab2SJoseph Koshyvariable 2817b710ab2SJoseph Koshy.Va DESTDIR . 282a3aed80dSRuslan Ermilov.Pp 28304876cf3SRuslan ErmilovIf installing onto an NFS file system and running 2848ed6451eSRuslan Ermilov.Xr make 1 2858ed6451eSRuslan Ermilovwith the 28604876cf3SRuslan Ermilov.Fl j 28704876cf3SRuslan Ermilovoption, make sure that 288a3aed80dSRuslan Ermilov.Xr rpc.lockd 8 289a3aed80dSRuslan Ermilovis running on both client and server. 290a3aed80dSRuslan ErmilovSee 291a3aed80dSRuslan Ermilov.Xr rc.conf 5 292a3aed80dSRuslan Ermilovon how to make it start at boot time. 2937b710ab2SJoseph Koshy.It Cm toolchain 2947b710ab2SJoseph KoshyCreate the build toolchain needed to build the rest of the system. 2957b710ab2SJoseph KoshyFor cross-architecture builds, this step creates a cross-toolchain. 2967b710ab2SJoseph Koshy.It Cm universe 2974e889921SJohn BaldwinFor each architecture, 2984e889921SJohn Baldwinexecute a 2997b710ab2SJoseph Koshy.Cm buildworld 3004e889921SJohn Baldwinfollowed by a 3017b710ab2SJoseph Koshy.Cm buildkernel 3024e889921SJohn Baldwinfor all kernels for that architecture, 3034e889921SJohn Baldwinincluding 3044e889921SJohn Baldwin.Pa LINT . 3057b710ab2SJoseph KoshyThis command takes a long time. 306e1b9162fSWarner Losh.It Cm kernels 307e1b9162fSWarner LoshLike 308e1b9162fSWarner Losh.Cm universe 309e1b9162fSWarner Loshwith 310e1b9162fSWarner Losh.Va WITHOUT_WORLDS 311e1b9162fSWarner Loshdefined so only the kernels for each architecture are built. 312e1b9162fSWarner Losh.It Cm worlds 313e1b9162fSWarner LoshLike 314e1b9162fSWarner Losh.Cm universe 315e1b9162fSWarner Loshwith 316e1b9162fSWarner Losh.Va WITHOUT_KERNELS 317e1b9162fSWarner Loshdefined so only the worlds for each architecture are built. 318f1d16bd8SBjoern A. Zeeb.It Cm targets 319f1d16bd8SBjoern A. ZeebPrint a list of supported 320f1d16bd8SBjoern A. Zeeb.Va TARGET 321f1d16bd8SBjoern A. Zeeb/ 322f1d16bd8SBjoern A. Zeeb.Va TARGET_ARCH 323f1d16bd8SBjoern A. Zeebpairs for world and kernel targets. 324eee8163bSBjoern A. Zeeb.It Cm tinderbox 325eee8163bSBjoern A. ZeebExecute the same targets as 326eee8163bSBjoern A. Zeeb.Cm universe . 327eee8163bSBjoern A. ZeebIn addition print a summary of all failed targets at the end and 328eee8163bSBjoern A. Zeebexit with an error if there were any. 3294e889921SJohn Baldwin.It Cm toolchains 3304e889921SJohn BaldwinCreate a build toolchain for each architecture supported by the build system. 331b135fb6eSBryan Drewery.It Cm xdev 332b135fb6eSBryan DreweryBuilds and installs a cross-toolchain and sysroot for the given 333b135fb6eSBryan Drewery.Sy TARGET 334b135fb6eSBryan Dreweryand 335b135fb6eSBryan Drewery.Sy TARGET_ARCH . 336b135fb6eSBryan DreweryThe sysroot contains target library and headers. 337b135fb6eSBryan DreweryThe target is an alias for 338b135fb6eSBryan Drewery.Cm xdev-build 339b135fb6eSBryan Dreweryand 340b135fb6eSBryan Drewery.Cm xdev-install . 341b135fb6eSBryan DreweryThe location of the files installed can be controlled with 342b135fb6eSBryan Drewery.Va DESTDIR . 343b135fb6eSBryan DreweryThe target location in 344b135fb6eSBryan Drewery.Va DESTDIR 345b135fb6eSBryan Dreweryis 346b135fb6eSBryan Drewery.Pa ${DESTDIR}/${XDTP} 347b135fb6eSBryan Drewerywhere 348b135fb6eSBryan Drewery.Va XDTP 349b135fb6eSBryan Drewerydefaults to 350b135fb6eSBryan Drewery.Pa /usr/${XDDIR} 351b135fb6eSBryan Dreweryand 352b135fb6eSBryan Drewery.Va XDDIR 353b135fb6eSBryan Drewerydefaults to 354b135fb6eSBryan Drewery.Pa ${TARGET_ARCH}-freebsd . 355b135fb6eSBryan Drewery.It Cm xdev-build 356b135fb6eSBryan DreweryBuilds for the 357b135fb6eSBryan Drewery.Cm xdev 358b135fb6eSBryan Drewerytarget. 359b135fb6eSBryan Drewery.It Cm xdev-install 360b135fb6eSBryan DreweryInstalls the files for the 361b135fb6eSBryan Drewery.Cm xdev 362b135fb6eSBryan Drewerytarget. 363b135fb6eSBryan Drewery.It Cm xdev-links 364b135fb6eSBryan DreweryInstalls autoconf-style symlinks to 365b135fb6eSBryan Drewery.Pa ${DESTDIR}/usr/bin 366b135fb6eSBryan Drewerypointing into the xdev toolchain in 367b135fb6eSBryan Drewery.Pa ${DESTDIR}/${XDTP} . 368786aa69aSBen Smithurst.El 369786aa69aSBen Smithurst.Pp 3707b710ab2SJoseph KoshyKernel specific build targets in 371786aa69aSBen Smithurst.Pa /usr/src 3727b710ab2SJoseph Koshyare: 373e8423d00SNathan Whitehorn.Bl -tag -width ".Cm distributekernel" 3741caae057SRuslan Ermilov.It Cm buildkernel 3751caae057SRuslan ErmilovRebuild the kernel and the kernel modules. 376d90f12e3SWarren BlockThe object directory can be changed from the default 377d90f12e3SWarren Block.Pa /usr/obj 378d90f12e3SWarren Blockby setting the 379d90f12e3SWarren Block.Pa MAKEOBJDIRPREFIX 380d90f12e3SWarren Block.Xr make 1 381d90f12e3SWarren Blockvariable. 3821caae057SRuslan Ermilov.It Cm installkernel 3837b710ab2SJoseph KoshyInstall the kernel and the kernel modules to directory 3847b710ab2SJoseph Koshy.Pa ${DESTDIR}/boot/kernel , 3857b710ab2SJoseph Koshyrenaming any pre-existing directory with this name to 3867b710ab2SJoseph Koshy.Pa kernel.old 3877b710ab2SJoseph Koshyif it contained the currently running kernel. 3887b710ab2SJoseph KoshyThe target directory under 3897b710ab2SJoseph Koshy.Pa ${DESTDIR} 3907b710ab2SJoseph Koshymay be modified using the 3917b710ab2SJoseph Koshy.Va INSTKERNNAME 3927b710ab2SJoseph Koshyand 3937b710ab2SJoseph Koshy.Va KODIR 3947b710ab2SJoseph Koshy.Xr make 1 3957b710ab2SJoseph Koshyvariables. 396e8423d00SNathan Whitehorn.It Cm distributekernel 397e8423d00SNathan WhitehornInstall the kernel to the directory 398e8423d00SNathan Whitehorn.Pa ${DISTDIR}/kernel/boot/kernel . 399e8423d00SNathan WhitehornThis target is used while building a release; see 400e8423d00SNathan Whitehorn.Xr release 7 . 401e8423d00SNathan Whitehorn.It Cm packagekernel 402e8423d00SNathan WhitehornArchive the results of 403e8423d00SNathan Whitehorn.Cm distributekernel , 404e8423d00SNathan Whitehornplacing the results in 405e8423d00SNathan Whitehorn.Va DISTDIR . 406e8423d00SNathan WhitehornThis target is used while building a release; see 407e8423d00SNathan Whitehorn.Xr release 7 . 408389e98a7STom Rhodes.It Cm kernel 409389e98a7STom RhodesEquivalent to 410389e98a7STom Rhodes.Cm buildkernel 411389e98a7STom Rhodesfollowed by 412389e98a7STom Rhodes.Cm installkernel 4137b710ab2SJoseph Koshy.It Cm kernel-toolchain 4147b710ab2SJoseph KoshyRebuild the tools needed for kernel compilation. 4157b710ab2SJoseph KoshyUse this if you did not do a 4167b710ab2SJoseph Koshy.Cm buildworld 4177b710ab2SJoseph Koshyfirst. 4187b710ab2SJoseph Koshy.It Cm reinstallkernel 4197b710ab2SJoseph KoshyReinstall the kernel and the kernel modules, overwriting the contents 4207b710ab2SJoseph Koshyof the target directory. 4217b710ab2SJoseph KoshyAs with the 4227b710ab2SJoseph Koshy.Cm installkernel 4237b710ab2SJoseph Koshytarget, the target directory can be specified using the 4247b710ab2SJoseph Koshy.Xr make 1 4257b710ab2SJoseph Koshyvariable 4267b710ab2SJoseph Koshy.Va INSTKERNNAME . 4277b710ab2SJoseph Koshy.El 4287b710ab2SJoseph Koshy.Pp 4297b710ab2SJoseph KoshyConvenience targets for cleaning up the install destination directory 4307b710ab2SJoseph Koshydenoted by variable 4317b710ab2SJoseph Koshy.Va DESTDIR 4327b710ab2SJoseph Koshyinclude: 4337b710ab2SJoseph Koshy.Bl -tag -width ".Cm delete-old-libs" 4347b710ab2SJoseph Koshy.It Cm check-old 435abfabbeaSMike PritchardPrint a list of old files and directories in the system. 436e2a36081SAlexander Leidinger.It Cm delete-old 437e2a36081SAlexander LeidingerDelete obsolete base system files and directories interactively. 43878ad5421SRuslan ErmilovWhen 43978ad5421SRuslan Ermilov.Li -DBATCH_DELETE_OLD_FILES 4407b710ab2SJoseph Koshyis specified at the command line, the delete operation will be 4417b710ab2SJoseph Koshynon-interactive. 442c8ef0ed5SRuslan ErmilovThe variables 4437b710ab2SJoseph Koshy.Va DESTDIR , 4447b710ab2SJoseph Koshy.Va TARGET_ARCH 445c8ef0ed5SRuslan Ermilovand 446c8ef0ed5SRuslan Ermilov.Va TARGET 447c8ef0ed5SRuslan Ermilovshould be set as with 448c8ef0ed5SRuslan Ermilov.Dq Li "make installworld" . 449e2a36081SAlexander Leidinger.It Cm delete-old-libs 450e2a36081SAlexander LeidingerDelete obsolete base system libraries interactively. 451d90f12e3SWarren BlockThis target should only be used if no third party software uses these 4527b710ab2SJoseph Koshylibraries. 45378ad5421SRuslan ErmilovWhen 45478ad5421SRuslan Ermilov.Li -DBATCH_DELETE_OLD_FILES 4557b710ab2SJoseph Koshyis specified at the command line, the delete operation will be 4567b710ab2SJoseph Koshynon-interactive. 457c8ef0ed5SRuslan ErmilovThe variables 4587b710ab2SJoseph Koshy.Va DESTDIR , 4597b710ab2SJoseph Koshy.Va TARGET_ARCH 460c8ef0ed5SRuslan Ermilovand 461c8ef0ed5SRuslan Ermilov.Va TARGET 462c8ef0ed5SRuslan Ermilovshould be set as with 463c8ef0ed5SRuslan Ermilov.Dq Li "make installworld" . 464786aa69aSBen Smithurst.El 465b82e53e2SMurray Stokely.Sh ENVIRONMENT 4667b710ab2SJoseph KoshyVariables that influence all builds include: 4677b710ab2SJoseph Koshy.Bl -tag -width ".Va MAKEOBJDIRPREFIX" 468fea87c03SGiorgos Keramidas.It Va DEBUG_FLAGS 469fea87c03SGiorgos KeramidasDefines a set of debugging flags that will be used to build all userland 470fea87c03SGiorgos Keramidasbinaries under 471fea87c03SGiorgos Keramidas.Pa /usr/src . 472fea87c03SGiorgos KeramidasWhen 473fea87c03SGiorgos Keramidas.Va DEBUG_FLAGS 474fea87c03SGiorgos Keramidasis defined, the 475fea87c03SGiorgos Keramidas.Cm install 476fea87c03SGiorgos Keramidasand 477fea87c03SGiorgos Keramidas.Cm installworld 478fea87c03SGiorgos Keramidastargets install binaries from the current 479fea87c03SGiorgos Keramidas.Va MAKEOBJDIRPREFIX 480fea87c03SGiorgos Keramidaswithout stripping, 481fea87c03SGiorgos Keramidasso that debugging information is retained in the installed binaries. 4827b710ab2SJoseph Koshy.It Va DESTDIR 4837b710ab2SJoseph KoshyThe directory hierarchy prefix where built objects will be installed. 4847b710ab2SJoseph KoshyIf not set, 4857b710ab2SJoseph Koshy.Va DESTDIR 4867b710ab2SJoseph Koshydefaults to the empty string. 4877b710ab2SJoseph Koshy.It Va MAKEOBJDIRPREFIX 4887b710ab2SJoseph KoshyDefines the prefix for directory names in the tree of built objects. 4897b710ab2SJoseph KoshyDefaults to 4907b710ab2SJoseph Koshy.Pa /usr/obj 4917b710ab2SJoseph Koshyif not defined. 492dfa09989SBryan DreweryThis variable should only be set in the environment or 493dfa09989SBryan Drewery.Pa /etc/src-env.conf 494dfa09989SBryan Dreweryand not via 4957b710ab2SJoseph Koshy.Pa /etc/make.conf 496dfa09989SBryan Dreweryor 497dfa09989SBryan Drewery.Pa /etc/src.conf 4987b710ab2SJoseph Koshyor the command line. 4997fa2f2a6SAlex Richardson.It Va WITHOUT_WERROR 5007b710ab2SJoseph KoshyIf defined, compiler warnings will not cause the build to halt, 5017b710ab2SJoseph Koshyeven if the makefile says otherwise. 50221edb039SAlexander Leidinger.It Va WITH_CTF 50321edb039SAlexander LeidingerIf defined, the build process will run the DTrace CTF conversion 50421edb039SAlexander Leidingertools on built objects. 5057b710ab2SJoseph Koshy.El 5067b710ab2SJoseph Koshy.Pp 5077b710ab2SJoseph KoshyAdditionally, builds in 5087b710ab2SJoseph Koshy.Pa /usr/src 5097b710ab2SJoseph Koshyare influenced by the following 5107b710ab2SJoseph Koshy.Xr make 1 5117b710ab2SJoseph Koshyvariables: 5127b710ab2SJoseph Koshy.Bl -tag -width ".Va SUBDIR_OVERRIDE" 513e6cdeeddSWarner Losh.It Va KERNCONF 514e6cdeeddSWarner LoshOverrides which kernel to build and install for the various kernel 515e6cdeeddSWarner Loshmake targets. 516e6cdeeddSWarner LoshIt defaults to 517e6cdeeddSWarner Losh.Cm GENERIC . 5184b2cc4d1SKyle Evans.It Va KERNCONFDIR 5194b2cc4d1SKyle EvansOverrides the directory in which 5204b2cc4d1SKyle Evans.Va KERNCONF 5214b2cc4d1SKyle Evansand any files included by 5224b2cc4d1SKyle Evans.Va KERNCONF 5234b2cc4d1SKyle Evansshould be found. 5244b2cc4d1SKyle EvansDefaults to 5254b2cc4d1SKyle Evans.Pa sys/${ARCH}/conf . 526e6cdeeddSWarner Losh.It Va KERNFAST 527e6cdeeddSWarner LoshIf set, the build target 528e6cdeeddSWarner Losh.Cm buildkernel 529e6cdeeddSWarner Loshdefaults to setting 530e6cdeeddSWarner Losh.Va NO_KERNELCLEAN , 5316d50d5e4SWarner Losh.Va NO_KERNELCONFIG , 532e6cdeeddSWarner Loshand 5336d50d5e4SWarner Losh.Va NO_KERNELOBJ . 534e6cdeeddSWarner LoshWhen set to a value other than 535e6cdeeddSWarner Losh.Cm 1 536e6cdeeddSWarner Loshthen 537e6cdeeddSWarner Losh.Va KERNCONF 538e6cdeeddSWarner Loshis set to the value of 539e6cdeeddSWarner Losh.Va KERNFAST . 5407b710ab2SJoseph Koshy.It Va LOCAL_DIRS 541ca6a54ceSBryan DreweryIf set, this variable supplies a list of additional directories relative to 542ca6a54ceSBryan Drewerythe root of the source tree to build as part of the 543ca6a54ceSBryan Drewery.Cm everything 544ca6a54ceSBryan Drewerytarget. 545e93e5bb0SIan LeporeThe directories are built in parallel with each other, 546e93e5bb0SIan Leporeand with the base system directories. 547e93e5bb0SIan LeporeInsert a 548e93e5bb0SIan Lepore.Va .WAIT 549e93e5bb0SIan Leporedirective at the beginning of the 550e93e5bb0SIan Lepore.Va LOCAL_DIRS 551e93e5bb0SIan Leporelist to ensure all base system directories are built first. 552e93e5bb0SIan Lepore.Va .WAIT 553e93e5bb0SIan Leporemay also be used as needed elsewhere within the list. 554a0e6a013SBryan Drewery.It Va LOCAL_ITOOLS 555a0e6a013SBryan DreweryIf set, this variable supplies a list of additional tools that are used by the 556a0e6a013SBryan Drewery.Cm installworld 557a0e6a013SBryan Dreweryand 558a0e6a013SBryan Drewery.Cm distributeworld 559a0e6a013SBryan Drewerytargets. 560ca6a54ceSBryan Drewery.It Va LOCAL_LIB_DIRS 561ca6a54ceSBryan DreweryIf set, this variable supplies a list of additional directories relative to 562ca6a54ceSBryan Drewerythe root of the source tree to build as part of the 563ca6a54ceSBryan Drewery.Cm libraries 564ca6a54ceSBryan Drewerytarget. 565e93e5bb0SIan LeporeThe directories are built in parallel with each other, 566e93e5bb0SIan Leporeand with the base system libraries. 567e93e5bb0SIan LeporeInsert a 568e93e5bb0SIan Lepore.Va .WAIT 569e93e5bb0SIan Leporedirective at the beginning of the 570e93e5bb0SIan Lepore.Va LOCAL_DIRS 571e93e5bb0SIan Leporelist to ensure all base system libraries are built first. 572e93e5bb0SIan Lepore.Va .WAIT 573e93e5bb0SIan Leporemay also be used as needed elsewhere within the list. 574ca6a54ceSBryan Drewery.It Va LOCAL_MTREE 575ca6a54ceSBryan DreweryIf set, this variable supplies a list of additional mtrees relative to the 576ca6a54ceSBryan Dreweryroot of the source tree to use as part of the 577ca6a54ceSBryan Drewery.Cm hierarchy 578ca6a54ceSBryan Drewerytarget. 57980cedb80SBryan Drewery.It Va LOCAL_LEGACY_DIRS 58080cedb80SBryan DreweryIf set, this variable supplies a list of additional directories relative to 58180cedb80SBryan Drewerythe root of the source tree to build as part of the 58280cedb80SBryan Drewery.Cm legacy 58380cedb80SBryan Drewerytarget. 58480cedb80SBryan Drewery.It Va LOCAL_BSTOOL_DIRS 58580cedb80SBryan DreweryIf set, this variable supplies a list of additional directories relative to 58680cedb80SBryan Drewerythe root of the source tree to build as part of the 58780cedb80SBryan Drewery.Cm bootstrap-tools 58880cedb80SBryan Drewerytarget. 589ca6a54ceSBryan Drewery.It Va LOCAL_TOOL_DIRS 590ca6a54ceSBryan DreweryIf set, this variable supplies a list of additional directories relative to 591ca6a54ceSBryan Drewerythe root of the source tree to build as part of the 592ca6a54ceSBryan Drewery.Cm build-tools 593ca6a54ceSBryan Drewerytarget. 5944143850bSBryan Drewery.It Va LOCAL_XTOOL_DIRS 5954143850bSBryan DreweryIf set, this variable supplies a list of additional directories relative to 5964143850bSBryan Drewerythe root of the source tree to build as part of the 5974143850bSBryan Drewery.Cm cross-tools 5984143850bSBryan Drewerytarget. 599170c2788SGlen Barber.It Va PORTS_MODULES 600170c2788SGlen BarberA list of ports with kernel modules that should be built and installed 601170c2788SGlen Barberas part of the 602170c2788SGlen Barber.Cm buildkernel 603170c2788SGlen Barberand 604170c2788SGlen Barber.Cm installkernel 605170c2788SGlen Barberprocess. 606170c2788SGlen Barber.Bd -literal -offset indent 6077fbc0c98SMitchell Hornemake PORTS_MODULES=emulators/virtualbox-ose-kmod kernel 608170c2788SGlen Barber.Ed 609e7a13643SMark Johnston.It Va LOCAL_MODULES 610e7a13643SMark JohnstonA list of external kernel modules that should be built and installed 611e7a13643SMark Johnstonas part of the 612e7a13643SMark Johnston.Cm buildkernel 613e7a13643SMark Johnstonand 614e7a13643SMark Johnston.Cm installkernel 615e7a13643SMark Johnstonprocess. 616805c3af8SMark JohnstonDefaults to the list of sub-directories of 617805c3af8SMark Johnston.Va LOCAL_MODULES_DIR . 618e7a13643SMark Johnston.It Va LOCAL_MODULES_DIR 619e7a13643SMark JohnstonThe directory in which to search for the kernel modules specified by 620e7a13643SMark Johnston.Va LOCAL_MODULES . 621e7a13643SMark JohnstonEach kernel module should consist of a directory containing a makefile. 622e7a13643SMark JohnstonDefaults to 623e7a13643SMark Johnston.Pa ${LOCALBASE}/sys/modules . 624e6ca6901SGordon Bergling.It Va SRCCONF 625e6ca6901SGordon BerglingSpecify a file to override the default 626e6ca6901SGordon Bergling.Pa /etc/src.conf . 627e6ca6901SGordon BerglingThe src.conf file controls the components to build. 628e6ca6901SGordon BerglingSee 629e6ca6901SGordon Bergling.Xr src.conf 5 63042e7be20SEnji Cooper.It Va STRIPBIN 6313547290fSEnji CooperCommand to use at install time when stripping binaries. 6323547290fSEnji CooperBe sure to add any additional tools required to run 63342e7be20SEnji Cooper.Va STRIPBIN 6343547290fSEnji Cooperto the 6353547290fSEnji Cooper.Va LOCAL_ITOOLS 6363547290fSEnji Cooper.Xr make 1 6373547290fSEnji Coopervariable before running the 6383547290fSEnji Cooper.Cm distributeworld 6393547290fSEnji Cooperor 6403547290fSEnji Cooper.Cm installworld 6413547290fSEnji Coopertargets. 6423547290fSEnji CooperSee 6433547290fSEnji Cooper.Xr install 1 6443547290fSEnji Cooperfor more details. 6457b710ab2SJoseph Koshy.It Va SUBDIR_OVERRIDE 6467b710ab2SJoseph KoshyOverride the default list of sub-directories and only build the 6477b710ab2SJoseph Koshysub-directory named in this variable. 6487f1636b7SBryan DreweryIf combined with 6497f1636b7SBryan Drewery.Cm buildworld 6507f1636b7SBryan Drewerythen all libraries and includes, and some of the build tools will still build 6517f1636b7SBryan Dreweryas well. 652c889d480SBryan DrewerySpecifying 653c889d480SBryan Drewery.Cm -DNO_LIBS , 654c889d480SBryan Dreweryand 655c889d480SBryan Drewery.Cm -DWORLDFAST 656c889d480SBryan Drewerywill only build the specified directory as was done historically. 6577f1636b7SBryan DreweryWhen combined with 6587f1636b7SBryan Drewery.Cm buildworld 6597f1636b7SBryan Dreweryit is necesarry to override 6607f1636b7SBryan Drewery.Va LOCAL_LIB_DIRS 6617f1636b7SBryan Drewerywith any custom directories containing libraries. 6627f1636b7SBryan DreweryThis allows building a subset of the system in the same way as 6637f1636b7SBryan Drewery.Cm buildworld 6647f1636b7SBryan Drewerydoes using its sysroot handling. 6657f1636b7SBryan DreweryThis variable can also be useful when debugging failed builds. 6667b710ab2SJoseph Koshy.Bd -literal -offset indent 6677b710ab2SJoseph Koshymake some-target SUBDIR_OVERRIDE=foo/bar 6687b710ab2SJoseph Koshy.Ed 669def657b8SWarner Losh.It Va SYSDIR 670def657b8SWarner LoshSpecify the location of the kernel source to override the default 671def657b8SWarner Losh.Pa /usr/src/sys . 672def657b8SWarner LoshThe kernel source is located in the 673def657b8SWarner Losh.Pa sys 674def657b8SWarner Loshsubdirectory of the source tree checked out from the 675def657b8SWarner Losh.Pa src.git 676def657b8SWarner Loshrepository. 6776f9ac6feSMurray Stokely.It Va TARGET 678b3a43ea3SMurray StokelyThe target hardware platform. 679365a17c0SMurray StokelyThis is analogous to the 6801caae057SRuslan Ermilov.Dq Nm uname Fl m 681b3a43ea3SMurray Stokelyoutput. 682b3a43ea3SMurray StokelyThis is necessary to cross-build some target architectures. 6832f6a7e42SEnji CooperFor example, cross-building for ARM64 machines requires 6842f6a7e42SEnji Cooper.Va TARGET_ARCH Ns = Ns Li aarch64 685b3a43ea3SMurray Stokelyand 6862f6a7e42SEnji Cooper.Va TARGET Ns = Ns Li arm64 . 6877b710ab2SJoseph KoshyIf not set, 6887b710ab2SJoseph Koshy.Va TARGET 689f4721165SEdward Tomasz Napieraladefaults to the current hardware platform, unless 690f4721165SEdward Tomasz Napierala.Va TARGET_ARCH 691f4721165SEdward Tomasz Napieralais also set, in which case it defaults to the appropriate 692f4721165SEdward Tomasz Napieralavalue for that architecture. 6937b710ab2SJoseph Koshy.It Va TARGET_ARCH 6947b710ab2SJoseph KoshyThe target machine processor architecture. 6957b710ab2SJoseph KoshyThis is analogous to the 6967b710ab2SJoseph Koshy.Dq Nm uname Fl p 6977b710ab2SJoseph Koshyoutput. 6987b710ab2SJoseph KoshySet this to cross-build for a different architecture. 6997b710ab2SJoseph KoshyIf not set, 7007b710ab2SJoseph Koshy.Va TARGET_ARCH 701531b260aSWarner Loshdefaults to the current machine architecture, unless 702531b260aSWarner Losh.Va TARGET 703531b260aSWarner Loshis also set, in which case it defaults to the appropriate 704531b260aSWarner Loshvalue for that platform. 705c22c7f86SWarner LoshTypically, one only needs to set 706c22c7f86SWarner Losh.Va TARGET . 7077b710ab2SJoseph Koshy.El 7087b710ab2SJoseph Koshy.Pp 7097b710ab2SJoseph KoshyBuilds under directory 710fd23b461SGiorgos Keramidas.Pa /usr/src 7117d6af40dSGlen Barberare also influenced by defining one or more of the following symbols, 712fd23b461SGiorgos Keramidasusing the 713fd23b461SGiorgos Keramidas.Fl D 714fd23b461SGiorgos Keramidasoption of 715fd23b461SGiorgos Keramidas.Xr make 1 : 716497e8091SBryan Drewery.Bl -tag -width ".Va -DNO_KERNELCONFIG" 71701012c64SWarner Losh.It Va LOADER_DEFAULT_INTERP 71801012c64SWarner LoshDefines what interpreter the default loader program will have. 71901012c64SWarner LoshValid values include 72001012c64SWarner Losh.Dq 4th , 72101012c64SWarner Losh.Dq lua , 72201012c64SWarner Loshand 72301012c64SWarner Losh.Dq simp . 72401012c64SWarner LoshThis creates the default link for 72501012c64SWarner Losh.Pa /boot/loader 72601012c64SWarner Loshto the loader with that interpreter. 72701012c64SWarner LoshIt also determines what interpreter is compiled into 72801012c64SWarner Losh.Pa userboot . 729fd23b461SGiorgos Keramidas.It Va NO_CLEANDIR 730fd23b461SGiorgos KeramidasIf set, the build targets that clean parts of the object tree use the 731fd23b461SGiorgos Keramidasequivalent of 732fd23b461SGiorgos Keramidas.Dq make clean 733fd23b461SGiorgos Keramidasinstead of 734fd23b461SGiorgos Keramidas.Dq make cleandir . 735fd23b461SGiorgos Keramidas.It Va NO_CLEAN 736fd23b461SGiorgos KeramidasIf set, no object tree files are cleaned at all. 737473fda75SBryan DreweryThis is the default when 738473fda75SBryan Drewery.Va WITH_META_MODE 739473fda75SBryan Dreweryis used with 740473fda75SBryan Drewery.Xr filemon 4 741473fda75SBryan Dreweryloaded. 742473fda75SBryan DrewerySee 743473fda75SBryan Drewery.Xr src.conf 5 744473fda75SBryan Dreweryfor more details. 745fd23b461SGiorgos KeramidasSetting 746fd23b461SGiorgos Keramidas.Va NO_CLEAN 747fd23b461SGiorgos Keramidasimplies 748fd23b461SGiorgos Keramidas.Va NO_KERNELCLEAN , 749fd23b461SGiorgos Keramidasso when 750fd23b461SGiorgos Keramidas.Va NO_CLEAN 751fd23b461SGiorgos Keramidasis set no kernel objects are cleaned either. 752fd23b461SGiorgos Keramidas.It Va NO_CTF 753fd23b461SGiorgos KeramidasIf set, the build process does not run the DTrace CTF conversion tools 754fd23b461SGiorgos Keramidason built objects. 755fd23b461SGiorgos Keramidas.It Va NO_SHARE 756fd23b461SGiorgos KeramidasIf set, the build does not descend into the 757fd23b461SGiorgos Keramidas.Pa /usr/src/share 758d90f12e3SWarren Blocksubdirectory (i.e., manual pages, locale data files, timezone data files and 759fd23b461SGiorgos Keramidasother 760fd23b461SGiorgos Keramidas.Pa /usr/src/share 761fd23b461SGiorgos Keramidasfiles will not be rebuild from their sources). 762fd23b461SGiorgos Keramidas.It Va NO_KERNELCLEAN 763fd23b461SGiorgos KeramidasIf set, the build process does not run 764fd23b461SGiorgos Keramidas.Dq make clean 765fd23b461SGiorgos Keramidasas part of the 766fd23b461SGiorgos Keramidas.Cm buildkernel 767fd23b461SGiorgos Keramidastarget. 768fd23b461SGiorgos Keramidas.It Va NO_KERNELCONFIG 769fd23b461SGiorgos KeramidasIf set, the build process does not run 770fd23b461SGiorgos Keramidas.Xr config 8 771fd23b461SGiorgos Keramidasas part of the 772fd23b461SGiorgos Keramidas.Cm buildkernel 773fd23b461SGiorgos Keramidastarget. 7746d50d5e4SWarner Losh.It Va NO_KERNELOBJ 7756d50d5e4SWarner LoshIf set, the build process does not run 7766d50d5e4SWarner Losh.Dq make obj 7776d50d5e4SWarner Loshas part of the 7786d50d5e4SWarner Losh.Cm buildkernel 7796d50d5e4SWarner Loshtarget. 780c596c287SBryan Drewery.It Va NO_LIBS 781c596c287SBryan DreweryIf set, the libraries phase will be skipped. 7822abeba9dSBryan Drewery.It Va NO_OBJWALK 7836d75a7a8SBryan DreweryIf set, no object directories will be created. 7846d75a7a8SBryan DreweryThis should only be used if object directories were created in a 7856d75a7a8SBryan Dreweryprevious build and no new directories are connected. 78616892c77SBryan Drewery.It Va WORLDFAST 78716892c77SBryan DreweryIf set, the build target 78816892c77SBryan Drewery.Cm buildworld 78916892c77SBryan Drewerydefaults to setting 79016892c77SBryan Drewery.Va NO_CLEAN , 7912abeba9dSBryan Drewery.Va NO_OBJWALK , 79216892c77SBryan Dreweryand will skip most bootstrap phases. 79316892c77SBryan DreweryIt will only bootstrap libraries and build all of userland. 79416892c77SBryan DreweryThis option should be used only when it is known that none of the bootstrap 79516892c77SBryan Dreweryneeds changed and that no new directories have been connected to the build. 796fd23b461SGiorgos Keramidas.El 797fd23b461SGiorgos Keramidas.Pp 798fd23b461SGiorgos KeramidasBuilds under directory 7997b710ab2SJoseph Koshy.Pa /usr/doc 8007b710ab2SJoseph Koshyare influenced by the following 8017b710ab2SJoseph Koshy.Xr make 1 8027b710ab2SJoseph Koshyvariables: 8037b710ab2SJoseph Koshy.Bl -tag -width ".Va DOC_LANG" 8047b710ab2SJoseph Koshy.It Va DOC_LANG 8057b710ab2SJoseph KoshyIf set, restricts the documentation build to the language subdirectories 8067b710ab2SJoseph Koshyspecified as its content. 8077b710ab2SJoseph KoshyThe default action is to build documentation for all languages. 808b82e53e2SMurray Stokely.El 8094e889921SJohn Baldwin.Pp 8104e889921SJohn BaldwinBuilds using the 8114e889921SJohn Baldwin.Cm universe 812e1b9162fSWarner Loshand related targets are influenced by the following 8134e889921SJohn Baldwin.Xr make 1 8144e889921SJohn Baldwinvariables: 8154e889921SJohn Baldwin.Bl -tag -width ".Va MAKE_JUST_KERNELS" 8164e889921SJohn Baldwin.It Va JFLAG 8174e889921SJohn BaldwinPass the value of this variable to each 8184e889921SJohn Baldwin.Xr make 1 8194e889921SJohn Baldwininvocation used to build worlds and kernels. 8204e889921SJohn BaldwinThis can be used to enable multiple jobs within a single architecture's build 8214e889921SJohn Baldwinwhile still building each architecture serially. 8224e889921SJohn Baldwin.It Va MAKE_JUST_KERNELS 8234e889921SJohn BaldwinOnly build kernels for each supported architecture. 8244e889921SJohn Baldwin.It Va MAKE_JUST_WORLDS 8254e889921SJohn BaldwinOnly build worlds for each supported architecture. 826a7783b5aSWarner Losh.It Va WITHOUT_WORLDS 827a7783b5aSWarner LoshOnly build kernels for each supported architecture. 828a7783b5aSWarner Losh.It Va WITHOUT_KERNELS 829a7783b5aSWarner LoshOnly build worlds for each supported architecture. 8304e889921SJohn Baldwin.It Va UNIVERSE_TARGET 8314e889921SJohn BaldwinExecute the specified 8324e889921SJohn Baldwin.Xr make 1 8334e889921SJohn Baldwintarget for each supported architecture instead of the default action of 8344e889921SJohn Baldwinbuilding a world and one or more kernels. 835a7783b5aSWarner LoshThis variable implies 836a7783b5aSWarner Losh.Va WITHOUT_KERNELS . 837e1b9162fSWarner Losh.It Va TARGETS 838e1b9162fSWarner LoshOnly build the listed targets instead of each supported architecture. 839e1b9162fSWarner Losh.It Va EXTRA_TARGETS 840e1b9162fSWarner LoshIn addition to the supported architectures, build the semi-supported 841e1b9162fSWarner Losharchitectures. 842e1b9162fSWarner LoshA semi-supported architecture has build support in the 843e1b9162fSWarner Losh.Fx 844e1b9162fSWarner Loshtree, but receives significantly less testing and is generally for 845e1b9162fSWarner Loshfringe uses that do not have a wide appeal. 8464e889921SJohn Baldwin.El 847786aa69aSBen Smithurst.Sh FILES 8480c0eb9beSRuslan Ermilov.Bl -tag -width ".Pa /usr/share/examples/etc/make.conf" -compact 849786aa69aSBen Smithurst.It Pa /usr/doc/Makefile 850786aa69aSBen Smithurst.It Pa /usr/doc/share/mk/doc.project.mk 851786aa69aSBen Smithurst.It Pa /usr/ports/Mk/bsd.port.mk 852786aa69aSBen Smithurst.It Pa /usr/ports/Mk/bsd.sites.mk 8531caae057SRuslan Ermilov.It Pa /usr/share/examples/etc/make.conf 8540c0eb9beSRuslan Ermilov.It Pa /usr/src/Makefile 8550c0eb9beSRuslan Ermilov.It Pa /usr/src/Makefile.inc1 8563136363fSRuslan Ermilov.El 8573faf5fc9SBen Smithurst.Sh EXAMPLES 858be6a4760SRuslan ErmilovFor an 8593faf5fc9SBen Smithurst.Dq approved 8607b710ab2SJoseph Koshymethod of updating your system from the latest sources, please see the 861be6a4760SRuslan Ermilov.Sx COMMON ITEMS 862be6a4760SRuslan Ermilovsection in 863be6a4760SRuslan Ermilov.Pa src/UPDATING . 864b82e53e2SMurray Stokely.Pp 865b82e53e2SMurray StokelyThe following sequence of commands can be used to cross-build the 866f4721165SEdward Tomasz Napieralasystem for the armv6 architecture on an amd64 host: 867b82e53e2SMurray Stokely.Bd -literal -offset indent 868b82e53e2SMurray Stokelycd /usr/src 869f4721165SEdward Tomasz Napieralamake TARGET_ARCH=armv6 buildworld buildkernel 870ecc0f5f6SEdward Tomasz Napieralamake TARGET_ARCH=armv6 DESTDIR=/clients/arm installworld installkernel 871b82e53e2SMurray Stokely.Ed 87259e11f39SBenedict Reuschling.Sh HISTORY 87359e11f39SBenedict ReuschlingThe 87459e11f39SBenedict Reuschling.Nm 87559e11f39SBenedict Reuschlingmanpage first appeared in 87659e11f39SBenedict Reuschling.Fx 4.3 . 877786aa69aSBen Smithurst.Sh SEE ALSO 8787c20a493SBen Smithurst.Xr cc 1 , 879786aa69aSBen Smithurst.Xr install 1 , 880786aa69aSBen Smithurst.Xr make 1 , 881786aa69aSBen Smithurst.Xr make.conf 5 , 882157376baSJoseph Koshy.Xr src.conf 5 , 883f4721165SEdward Tomasz Napierala.Xr arch 7 , 884e444a4c6SFernando Apesteguía.Xr pkg 7 , 885a81996b6SBen Smithurst.Xr ports 7 , 886a54bda91SMurray Stokely.Xr release 7 , 88753837b18SEnji Cooper.Xr tests 7 , 88861001d75STom Rhodes.Xr config 8 , 889664eefe2SMateusz Piotrowski.Xr etcupdate 8 , 89047f77d8cSBen Smithurst.Xr mergemaster 8 , 891a81996b6SBen Smithurst.Xr reboot 8 , 89253837b18SEnji Cooper.Xr shutdown 8 893786aa69aSBen Smithurst.Sh AUTHORS 894a63d6c94SBaptiste Daroussin.An Mike W. Meyer Aq Mt mwm@mired.org 895