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.\" 27c22c7f86SWarner Losh.Dd January 23, 2009 28786aa69aSBen Smithurst.Dt BUILD 7 293d45e180SRuslan Ermilov.Os 30786aa69aSBen Smithurst.Sh NAME 31786aa69aSBen Smithurst.Nm build 32eb083802SRuslan Ermilov.Nd information 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 . 427b710ab2SJoseph KoshyDirectory 43786aa69aSBen Smithurst.Pa /usr/src 44786aa69aSBen Smithurstcontains the 45786aa69aSBen Smithurst.Dq "base system" 46786aa69aSBen Smithurstsources, which is loosely defined as the things required to rebuild 47786aa69aSBen Smithurstthe system to a useful state. 487b710ab2SJoseph KoshyDirectory 49786aa69aSBen Smithurst.Pa /usr/doc 50786aa69aSBen Smithurstcontains the source for the system documentation, excluding the manual 51786aa69aSBen Smithurstpages. 527b710ab2SJoseph KoshyDirectory 53786aa69aSBen Smithurst.Pa /usr/ports 547b710ab2SJoseph Koshycontains a tree that provides a consistent interface for building and 55786aa69aSBen Smithurstinstalling third party applications. 567b710ab2SJoseph KoshyFor more information about the ports build process, see 577b710ab2SJoseph Koshy.Xr ports 7 . 58786aa69aSBen Smithurst.Pp 59786aa69aSBen SmithurstThe 60786aa69aSBen Smithurst.Xr make 1 61786aa69aSBen Smithurstcommand is used in each of these directories to build and install the 621caae057SRuslan Ermilovthings in that directory. 631caae057SRuslan ErmilovIssuing the 641caae057SRuslan Ermilov.Xr make 1 651caae057SRuslan Ermilovcommand in any directory or 66786aa69aSBen Smithurstsubdirectory of those directories has the same effect as issuing the 671caae057SRuslan Ermilovsame command in all subdirectories of that directory. 681caae057SRuslan ErmilovWith no target specified, the things in that directory are just built. 697b710ab2SJoseph Koshy.Pp 707b710ab2SJoseph KoshyA source tree is allowed to be read-only. 717b710ab2SJoseph KoshyAs described in 727b710ab2SJoseph Koshy.Xr make 1 , 737b710ab2SJoseph Koshyobjects are usually built in a separate object directory hierarchy 747b710ab2SJoseph Koshyspecified by the environment variable 757b710ab2SJoseph Koshy.Va MAKEOBJDIRPREFIX , 767b710ab2SJoseph Koshyor under 777b710ab2SJoseph Koshy.Pa /usr/obj 787b710ab2SJoseph Koshyif variable 797b710ab2SJoseph Koshy.Va MAKEOBJDIRPREFIX 807b710ab2SJoseph Koshyis not set. 817b710ab2SJoseph KoshyFor a given source directory, its canonical object directory 827b710ab2SJoseph Koshywould be 837b710ab2SJoseph Koshy.Pa ${MAKEOBJDIRPREFIX}${.CURDIR} 847b710ab2SJoseph Koshyif 857b710ab2SJoseph Koshy.Xr make 1 867b710ab2SJoseph Koshyvariable 877b710ab2SJoseph Koshy.Va MAKEOBJDIRPREFIX 887b710ab2SJoseph Koshyis set, or 897b710ab2SJoseph Koshy.Pa /usr/obj${.CURDIR} 907b710ab2SJoseph Koshyif this variable is not set. 917b710ab2SJoseph KoshyCross-builds set the object directory as described in the 927b710ab2SJoseph Koshydocumentation for the 937b710ab2SJoseph Koshy.Cm buildworld 947b710ab2SJoseph Koshytarget below. 957b710ab2SJoseph Koshy.Pp 967b710ab2SJoseph KoshyThe build may be controlled by defining 977b710ab2SJoseph Koshy.Xr make 1 987b710ab2SJoseph Koshyvariables described in the 997b710ab2SJoseph Koshy.Sx ENVIRONMENT 1007b710ab2SJoseph Koshysection below, and by the variables documented in 1017b710ab2SJoseph Koshy.Xr make.conf 5 . 1027b710ab2SJoseph Koshy.Pp 1037b710ab2SJoseph KoshyThe following list provides the names and actions for the targets 1047b710ab2SJoseph Koshysupported by the build system: 1057b710ab2SJoseph Koshy.Bl -tag -width ".Cm cleandepend" 1061caae057SRuslan Ermilov.It Cm clean 1077b710ab2SJoseph KoshyRemove any files created during the build process. 1087b710ab2SJoseph Koshy.It Cm cleandepend 1097b710ab2SJoseph KoshyRemove the file 1107b710ab2SJoseph Koshy.Pa ${.OBJDIR}/${DEPENDFILE} 1117b710ab2SJoseph Koshygenerated by a prior 1127b710ab2SJoseph Koshy.Dq Li "make depend" 1137b710ab2SJoseph Koshystep. 1147b710ab2SJoseph Koshy.It Cm cleandir 1157b710ab2SJoseph KoshyRemove the canonical object directory if it exists, or perform 1167b710ab2SJoseph Koshyactions equivalent to 1177b710ab2SJoseph Koshy.Dq Li "make clean cleandepend" 1187b710ab2SJoseph Koshyif it does not. 1197b710ab2SJoseph KoshyThis target will also remove an 1207b710ab2SJoseph Koshy.Pa obj 1217b710ab2SJoseph Koshylink in 1227b710ab2SJoseph Koshy.Pa ${.CURDIR} 1237b710ab2SJoseph Koshyif that exists. 1247b710ab2SJoseph Koshy.Pp 1257b710ab2SJoseph KoshyIt is advisable to run 1267b710ab2SJoseph Koshy.Dq Li "make cleandir" 1277b710ab2SJoseph Koshytwice: the first invocation will remove the canonical object directory 1287b710ab2SJoseph Koshyand the second one will clean up 1297b710ab2SJoseph Koshy.Pa ${.CURDIR} . 1307b710ab2SJoseph Koshy.It Cm depend 1317b710ab2SJoseph KoshyGenerate a list of build dependencies in file 1327b710ab2SJoseph Koshy.Pa ${.OBJDIR}/${DEPENDFILE} . 1331caae057SRuslan Ermilov.It Cm install 1347b710ab2SJoseph KoshyInstall the results of the build to the appropriate location in the 1357b710ab2SJoseph Koshyinstallation directory hierarchy specified in variable 1367b710ab2SJoseph Koshy.Va DESTDIR . 1377b710ab2SJoseph Koshy.It Cm obj 1387b710ab2SJoseph KoshyCreate the canonical object directory associated with the current 1397b710ab2SJoseph Koshydirectory. 1407b710ab2SJoseph Koshy.It Cm objlink 1417b710ab2SJoseph KoshyCreate a symbolic link to the canonical object directory in 1427b710ab2SJoseph Koshy.Pa ${.CURDIR} . 1437b710ab2SJoseph Koshy.It Cm tags 1447b710ab2SJoseph KoshyGenerate a tags file using the program specified in the 1457b710ab2SJoseph Koshy.Xr make 1 1467b710ab2SJoseph Koshyvariable 1477b710ab2SJoseph Koshy.Va CTAGS . 1487b710ab2SJoseph KoshyThe build system supports 1497b710ab2SJoseph Koshy.Xr ctags 1 1507b710ab2SJoseph Koshyand 1517b710ab2SJoseph Koshy.Nm "GNU Global" . 1527b710ab2SJoseph Koshy.El 1537b710ab2SJoseph Koshy.Pp 1547b710ab2SJoseph KoshyThe other supported targets under directory 1557b710ab2SJoseph Koshy.Pa /usr/src 1567b710ab2SJoseph Koshyare: 1577b710ab2SJoseph Koshy.Bl -tag -width ".Cm distributeworld" 1587b710ab2SJoseph Koshy.It Cm buildenv 1597b710ab2SJoseph KoshySpawn an interactive shell with environment variables set up for 1607b710ab2SJoseph Koshycross-building the system. 1617b710ab2SJoseph KoshyThe target architecture needs to be specified with 1627b710ab2SJoseph Koshy.Xr make 1 1637b710ab2SJoseph Koshyvariables 1647b710ab2SJoseph Koshy.Va TARGET_ARCH 1657b710ab2SJoseph Koshyand 1667b710ab2SJoseph Koshy.Va TARGET . 1677b710ab2SJoseph Koshy.Pp 1687b710ab2SJoseph KoshyThis target is only useful after a complete cross-toolchain including 1697b710ab2SJoseph Koshythe compiler, linker, assembler, headers and libraries has been 1707b710ab2SJoseph Koshybuilt; see the 1717b710ab2SJoseph Koshy.Cm toolchain 1727b710ab2SJoseph Koshytarget below. 1737b710ab2SJoseph Koshy.It Cm buildworld 1747b710ab2SJoseph KoshyBuild everything but the kernel, configure files in 1757b710ab2SJoseph Koshy.Pa etc , 1767b710ab2SJoseph Koshyand 1777b710ab2SJoseph Koshy.Pa release . 1787b710ab2SJoseph KoshyThe actual build location prefix used is 1797b710ab2SJoseph Koshy.Pa ${MAKEOBJDIRPREFIX}${.CURDIR} 1807b710ab2SJoseph Koshyfor native builds, and 1817b710ab2SJoseph Koshy.Pa ${MAKEOBJDIRPREFIX}/${TARGET}${.CURDIR} 1827b710ab2SJoseph Koshyfor cross builds and native builds with variable 1837b710ab2SJoseph Koshy.Va CROSS_BUILD_TESTING 1847b710ab2SJoseph Koshyset. 1857b710ab2SJoseph Koshy.It Cm cleanworld 1867b710ab2SJoseph KoshyAttempt to clean up targets built by a preceding 1877b710ab2SJoseph Koshy.Cm buildworld 1887b710ab2SJoseph Koshystep. 1897b710ab2SJoseph Koshy.It Cm distributeworld 1907b710ab2SJoseph KoshyDistribute everything compiled by a preceding 1917b710ab2SJoseph Koshy.Cm buildworld 1927b710ab2SJoseph Koshystep. 1937b710ab2SJoseph KoshyFiles are placed in the directory hierarchy specified by 1947b710ab2SJoseph Koshy.Xr make 1 1957b710ab2SJoseph Koshyvariable 1967b710ab2SJoseph Koshy.Va DISTDIR . 1977b710ab2SJoseph KoshyThis target is used while building a release; see 1987b710ab2SJoseph Koshy.Xr release 7 . 1997b710ab2SJoseph Koshy.It Cm installworld 2007b710ab2SJoseph KoshyInstall everything built by a preceding 2017b710ab2SJoseph Koshy.Cm buildworld 2027b710ab2SJoseph Koshystep into the directory hierarchy pointed to by 2037b710ab2SJoseph Koshy.Xr make 1 2047b710ab2SJoseph Koshyvariable 2057b710ab2SJoseph Koshy.Va DESTDIR . 206a3aed80dSRuslan Ermilov.Pp 20704876cf3SRuslan ErmilovIf installing onto an NFS file system and running 2088ed6451eSRuslan Ermilov.Xr make 1 2098ed6451eSRuslan Ermilovwith the 21004876cf3SRuslan Ermilov.Fl j 21104876cf3SRuslan Ermilovoption, make sure that 212a3aed80dSRuslan Ermilov.Xr rpc.lockd 8 213a3aed80dSRuslan Ermilovis running on both client and server. 214a3aed80dSRuslan ErmilovSee 215a3aed80dSRuslan Ermilov.Xr rc.conf 5 216a3aed80dSRuslan Ermilovon how to make it start at boot time. 2177b710ab2SJoseph Koshy.It Cm toolchain 2187b710ab2SJoseph KoshyCreate the build toolchain needed to build the rest of the system. 2197b710ab2SJoseph KoshyFor cross-architecture builds, this step creates a cross-toolchain. 2207b710ab2SJoseph Koshy.It Cm universe 2217b710ab2SJoseph KoshyExecute a 2227b710ab2SJoseph Koshy.Cm buildworld 2237b710ab2SJoseph Koshyand 2247b710ab2SJoseph Koshy.Cm buildkernel 2257b710ab2SJoseph Koshyfor all kernels including 2267b710ab2SJoseph Koshy.Pa LINT , 2277b710ab2SJoseph Koshyfor each architecture supported by the build system. 2287b710ab2SJoseph KoshyThis command takes a long time. 2291caae057SRuslan Ermilov.It Cm update 2307b710ab2SJoseph KoshyGet updated sources as configured in 23108b91343SYaroslav Tykhiy.Xr make.conf 5 . 232786aa69aSBen Smithurst.El 233786aa69aSBen Smithurst.Pp 2347b710ab2SJoseph KoshyKernel specific build targets in 235786aa69aSBen Smithurst.Pa /usr/src 2367b710ab2SJoseph Koshyare: 2377b710ab2SJoseph Koshy.Bl -tag -width ".Cm reinstallkernel" 2381caae057SRuslan Ermilov.It Cm buildkernel 2391caae057SRuslan ErmilovRebuild the kernel and the kernel modules. 2401caae057SRuslan Ermilov.It Cm installkernel 2417b710ab2SJoseph KoshyInstall the kernel and the kernel modules to directory 2427b710ab2SJoseph Koshy.Pa ${DESTDIR}/boot/kernel , 2437b710ab2SJoseph Koshyrenaming any pre-existing directory with this name to 2447b710ab2SJoseph Koshy.Pa kernel.old 2457b710ab2SJoseph Koshyif it contained the currently running kernel. 2467b710ab2SJoseph KoshyThe target directory under 2477b710ab2SJoseph Koshy.Pa ${DESTDIR} 2487b710ab2SJoseph Koshymay be modified using the 2497b710ab2SJoseph Koshy.Va INSTKERNNAME 2507b710ab2SJoseph Koshyand 2517b710ab2SJoseph Koshy.Va KODIR 2527b710ab2SJoseph Koshy.Xr make 1 2537b710ab2SJoseph Koshyvariables. 254389e98a7STom Rhodes.It Cm kernel 255389e98a7STom RhodesEquivalent to 256389e98a7STom Rhodes.Cm buildkernel 257389e98a7STom Rhodesfollowed by 258389e98a7STom Rhodes.Cm installkernel 2597b710ab2SJoseph Koshy.It Cm kernel-toolchain 2607b710ab2SJoseph KoshyRebuild the tools needed for kernel compilation. 2617b710ab2SJoseph KoshyUse this if you did not do a 2627b710ab2SJoseph Koshy.Cm buildworld 2637b710ab2SJoseph Koshyfirst. 2647b710ab2SJoseph Koshy.It Cm reinstallkernel 2657b710ab2SJoseph KoshyReinstall the kernel and the kernel modules, overwriting the contents 2667b710ab2SJoseph Koshyof the target directory. 2677b710ab2SJoseph KoshyAs with the 2687b710ab2SJoseph Koshy.Cm installkernel 2697b710ab2SJoseph Koshytarget, the target directory can be specified using the 2707b710ab2SJoseph Koshy.Xr make 1 2717b710ab2SJoseph Koshyvariable 2727b710ab2SJoseph Koshy.Va INSTKERNNAME . 2737b710ab2SJoseph Koshy.El 2747b710ab2SJoseph Koshy.Pp 2757b710ab2SJoseph KoshyConvenience targets for cleaning up the install destination directory 2767b710ab2SJoseph Koshydenoted by variable 2777b710ab2SJoseph Koshy.Va DESTDIR 2787b710ab2SJoseph Koshyinclude: 2797b710ab2SJoseph Koshy.Bl -tag -width ".Cm delete-old-libs" 2807b710ab2SJoseph Koshy.It Cm check-old 281abfabbeaSMike PritchardPrint a list of old files and directories in the system. 282e2a36081SAlexander Leidinger.It Cm delete-old 283e2a36081SAlexander LeidingerDelete obsolete base system files and directories interactively. 28478ad5421SRuslan ErmilovWhen 28578ad5421SRuslan Ermilov.Li -DBATCH_DELETE_OLD_FILES 2867b710ab2SJoseph Koshyis specified at the command line, the delete operation will be 2877b710ab2SJoseph Koshynon-interactive. 288c8ef0ed5SRuslan ErmilovThe variables 2897b710ab2SJoseph Koshy.Va DESTDIR , 2907b710ab2SJoseph Koshy.Va TARGET_ARCH 291c8ef0ed5SRuslan Ermilovand 292c8ef0ed5SRuslan Ermilov.Va TARGET 293c8ef0ed5SRuslan Ermilovshould be set as with 294c8ef0ed5SRuslan Ermilov.Dq Li "make installworld" . 295e2a36081SAlexander Leidinger.It Cm delete-old-libs 296e2a36081SAlexander LeidingerDelete obsolete base system libraries interactively. 2977b710ab2SJoseph KoshyThis target should only be used if no 3rd party software uses these 2987b710ab2SJoseph Koshylibraries. 29978ad5421SRuslan ErmilovWhen 30078ad5421SRuslan Ermilov.Li -DBATCH_DELETE_OLD_FILES 3017b710ab2SJoseph Koshyis specified at the command line, the delete operation will be 3027b710ab2SJoseph Koshynon-interactive. 303c8ef0ed5SRuslan ErmilovThe variables 3047b710ab2SJoseph Koshy.Va DESTDIR , 3057b710ab2SJoseph Koshy.Va TARGET_ARCH 306c8ef0ed5SRuslan Ermilovand 307c8ef0ed5SRuslan Ermilov.Va TARGET 308c8ef0ed5SRuslan Ermilovshould be set as with 309c8ef0ed5SRuslan Ermilov.Dq Li "make installworld" . 310786aa69aSBen Smithurst.El 311b82e53e2SMurray Stokely.Sh ENVIRONMENT 3127b710ab2SJoseph KoshyVariables that influence all builds include: 3137b710ab2SJoseph Koshy.Bl -tag -width ".Va MAKEOBJDIRPREFIX" 3147b710ab2SJoseph Koshy.It Va DESTDIR 3157b710ab2SJoseph KoshyThe directory hierarchy prefix where built objects will be installed. 3167b710ab2SJoseph KoshyIf not set, 3177b710ab2SJoseph Koshy.Va DESTDIR 3187b710ab2SJoseph Koshydefaults to the empty string. 3197b710ab2SJoseph Koshy.It Va MAKEOBJDIRPREFIX 3207b710ab2SJoseph KoshyDefines the prefix for directory names in the tree of built objects. 3217b710ab2SJoseph KoshyDefaults to 3227b710ab2SJoseph Koshy.Pa /usr/obj 3237b710ab2SJoseph Koshyif not defined. 3247b710ab2SJoseph KoshyThis variable should only be set in the environment and not via 3257b710ab2SJoseph Koshy.Pa /etc/make.conf 3267b710ab2SJoseph Koshyor the command line. 3277b710ab2SJoseph Koshy.It Va NO_WERROR 3287b710ab2SJoseph KoshyIf defined, compiler warnings will not cause the build to halt, 3297b710ab2SJoseph Koshyeven if the makefile says otherwise. 3307b710ab2SJoseph Koshy.El 3317b710ab2SJoseph Koshy.Pp 3327b710ab2SJoseph KoshyAdditionally, builds in 3337b710ab2SJoseph Koshy.Pa /usr/src 3347b710ab2SJoseph Koshyare influenced by the following 3357b710ab2SJoseph Koshy.Xr make 1 3367b710ab2SJoseph Koshyvariables: 3377b710ab2SJoseph Koshy.Bl -tag -width ".Va SUBDIR_OVERRIDE" 3387b710ab2SJoseph Koshy.It Va LOCAL_DIRS 3397b710ab2SJoseph KoshyIf set, this variable supplies a list of additional directories to 3407b710ab2SJoseph Koshybuild, relative to the root of the source tree. 3417b710ab2SJoseph Koshy.It Va SUBDIR_OVERRIDE 3427b710ab2SJoseph KoshyOverride the default list of sub-directories and only build the 3437b710ab2SJoseph Koshysub-directory named in this variable. 3447b710ab2SJoseph KoshyThis variable is useful when debugging failed builds. 3457b710ab2SJoseph Koshy.Bd -literal -offset indent 3467b710ab2SJoseph Koshymake some-target SUBDIR_OVERRIDE=foo/bar 3477b710ab2SJoseph Koshy.Ed 3486f9ac6feSMurray Stokely.It Va TARGET 349b3a43ea3SMurray StokelyThe target hardware platform. 350365a17c0SMurray StokelyThis is analogous to the 3511caae057SRuslan Ermilov.Dq Nm uname Fl m 352b3a43ea3SMurray Stokelyoutput. 353b3a43ea3SMurray StokelyThis is necessary to cross-build some target architectures. 354b3a43ea3SMurray StokelyFor example, cross-building for PC98 machines requires 3551caae057SRuslan Ermilov.Va TARGET_ARCH Ns = Ns Li i386 356b3a43ea3SMurray Stokelyand 3571caae057SRuslan Ermilov.Va TARGET Ns = Ns Li pc98 . 3587b710ab2SJoseph KoshyIf not set, 3597b710ab2SJoseph Koshy.Va TARGET 3607b710ab2SJoseph Koshydefaults to the current hardware platform. 3617b710ab2SJoseph Koshy.It Va TARGET_ARCH 3627b710ab2SJoseph KoshyThe target machine processor architecture. 3637b710ab2SJoseph KoshyThis is analogous to the 3647b710ab2SJoseph Koshy.Dq Nm uname Fl p 3657b710ab2SJoseph Koshyoutput. 3667b710ab2SJoseph KoshySet this to cross-build for a different architecture. 3677b710ab2SJoseph KoshyIf not set, 3687b710ab2SJoseph Koshy.Va TARGET_ARCH 369531b260aSWarner Loshdefaults to the current machine architecture, unless 370531b260aSWarner Losh.Va TARGET 371531b260aSWarner Loshis also set, in which case it defaults to the appropriate 372531b260aSWarner Loshvalue for that platform. 373c22c7f86SWarner LoshTypically, one only needs to set 374c22c7f86SWarner Losh.Va TARGET . 375c22c7f86SWarner Losh.It Va KERNCONF 376c22c7f86SWarner LoshOverrides which kernel to build and install for the various kernel 377c22c7f86SWarner Loshmake targets. 378c22c7f86SWarner LoshIt defaults to 379c22c7f86SWarner Losh.Cm GENERIC . 380c22c7f86SWarner Losh.It Va KERNFAST 381c22c7f86SWarner LoshIf set, the build target 382c22c7f86SWarner Losh.Cm buildkernel 383c22c7f86SWarner Loshdefaults to setting 384c22c7f86SWarner Losh.Va NO_KERNELCLEAN , 385c22c7f86SWarner Losh.Va NO_KERNELCONFIG 386c22c7f86SWarner Loshand 387c22c7f86SWarner Losh.Va NO_KERNELDEPEND . 388c22c7f86SWarner LoshWhen set to a value other than 389c22c7f86SWarner Losh.Cm 1 390c22c7f86SWarner Loshthen 391c22c7f86SWarner Losh.Va KERNCONF 392c22c7f86SWarner Loshis set to the value of 393c22c7f86SWarner Losh.Va KERNFAST . 3947b710ab2SJoseph Koshy.El 3957b710ab2SJoseph Koshy.Pp 3967b710ab2SJoseph KoshyBuilds under directory 397fd23b461SGiorgos Keramidas.Pa /usr/src 398fd23b461SGiorgos Keramidasare also influenced by defining one or more the following symbols, 399fd23b461SGiorgos Keramidasusing the 400fd23b461SGiorgos Keramidas.Fl D 401fd23b461SGiorgos Keramidasoption of 402fd23b461SGiorgos Keramidas.Xr make 1 : 403fd23b461SGiorgos Keramidas.Bl -tag -width ".Va -DNO_KERNELDEPEND" 404fd23b461SGiorgos Keramidas.It Va NO_CLEANDIR 405fd23b461SGiorgos KeramidasIf set, the build targets that clean parts of the object tree use the 406fd23b461SGiorgos Keramidasequivalent of 407fd23b461SGiorgos Keramidas.Dq make clean 408fd23b461SGiorgos Keramidasinstead of 409fd23b461SGiorgos Keramidas.Dq make cleandir . 410fd23b461SGiorgos Keramidas.It Va NO_CLEAN 411fd23b461SGiorgos KeramidasIf set, no object tree files are cleaned at all. 412fd23b461SGiorgos KeramidasSetting 413fd23b461SGiorgos Keramidas.Va NO_CLEAN 414fd23b461SGiorgos Keramidasimplies 415fd23b461SGiorgos Keramidas.Va NO_KERNELCLEAN , 416fd23b461SGiorgos Keramidasso when 417fd23b461SGiorgos Keramidas.Va NO_CLEAN 418fd23b461SGiorgos Keramidasis set no kernel objects are cleaned either. 419fd23b461SGiorgos Keramidas.It Va NO_CTF 420fd23b461SGiorgos KeramidasIf set, the build process does not run the DTrace CTF conversion tools 421fd23b461SGiorgos Keramidason built objects. 422fd23b461SGiorgos Keramidas.It Va NO_SHARE 423fd23b461SGiorgos KeramidasIf set, the build does not descend into the 424fd23b461SGiorgos Keramidas.Pa /usr/src/share 425fd23b461SGiorgos Keramidassubdirectory (i.e. manpages, locale data files, timezone data files and 426fd23b461SGiorgos Keramidasother 427fd23b461SGiorgos Keramidas.Pa /usr/src/share 428fd23b461SGiorgos Keramidasfiles will not be rebuild from their sources). 429fd23b461SGiorgos Keramidas.It Va NO_KERNELCLEAN 430fd23b461SGiorgos KeramidasIf set, the build process does not run 431fd23b461SGiorgos Keramidas.Dq make clean 432fd23b461SGiorgos Keramidasas part of the 433fd23b461SGiorgos Keramidas.Cm buildkernel 434fd23b461SGiorgos Keramidastarget. 435fd23b461SGiorgos Keramidas.It Va NO_KERNELCONFIG 436fd23b461SGiorgos KeramidasIf set, the build process does not run 437fd23b461SGiorgos Keramidas.Xr config 8 438fd23b461SGiorgos Keramidasas part of the 439fd23b461SGiorgos Keramidas.Cm buildkernel 440fd23b461SGiorgos Keramidastarget. 441fd23b461SGiorgos Keramidas.It Va NO_KERNELDEPEND 442fd23b461SGiorgos KeramidasIf set, the build process does not run 443fd23b461SGiorgos Keramidas.Dq make depend 444fd23b461SGiorgos Keramidasas part of the 445fd23b461SGiorgos Keramidas.Cm buildkernel 446fd23b461SGiorgos Keramidastarget. 447fd23b461SGiorgos Keramidas.It Va NO_DOCUPDATE 448fd23b461SGiorgos KeramidasIf set, the update process does not update the source of the 449fd23b461SGiorgos Keramidas.Fx 450fd23b461SGiorgos Keramidasdocumentation as part of the 451fd23b461SGiorgos Keramidas.Dq make update 452fd23b461SGiorgos Keramidastarget. 453fd23b461SGiorgos Keramidas.It Va NO_PORTSUPDATE 454fd23b461SGiorgos KeramidasIf set, the update process does not update the Ports tree as part of the 455fd23b461SGiorgos Keramidas.Dq make update 456fd23b461SGiorgos Keramidastarget. 457fd23b461SGiorgos Keramidas.El 458fd23b461SGiorgos Keramidas.Pp 459fd23b461SGiorgos KeramidasBuilds under directory 4607b710ab2SJoseph Koshy.Pa /usr/doc 4617b710ab2SJoseph Koshyare influenced by the following 4627b710ab2SJoseph Koshy.Xr make 1 4637b710ab2SJoseph Koshyvariables: 4647b710ab2SJoseph Koshy.Bl -tag -width ".Va DOC_LANG" 4657b710ab2SJoseph Koshy.It Va DOC_LANG 4667b710ab2SJoseph KoshyIf set, restricts the documentation build to the language subdirectories 4677b710ab2SJoseph Koshyspecified as its content. 4687b710ab2SJoseph KoshyThe default action is to build documentation for all languages. 469b82e53e2SMurray Stokely.El 470786aa69aSBen Smithurst.Sh FILES 4710c0eb9beSRuslan Ermilov.Bl -tag -width ".Pa /usr/share/examples/etc/make.conf" -compact 472786aa69aSBen Smithurst.It Pa /usr/doc/Makefile 473786aa69aSBen Smithurst.It Pa /usr/doc/share/mk/doc.project.mk 474786aa69aSBen Smithurst.It Pa /usr/ports/Mk/bsd.port.mk 475786aa69aSBen Smithurst.It Pa /usr/ports/Mk/bsd.sites.mk 4761caae057SRuslan Ermilov.It Pa /usr/share/examples/etc/make.conf 4770c0eb9beSRuslan Ermilov.It Pa /usr/src/Makefile 4780c0eb9beSRuslan Ermilov.It Pa /usr/src/Makefile.inc1 4793136363fSRuslan Ermilov.El 4803faf5fc9SBen Smithurst.Sh EXAMPLES 481be6a4760SRuslan ErmilovFor an 4823faf5fc9SBen Smithurst.Dq approved 4837b710ab2SJoseph Koshymethod of updating your system from the latest sources, please see the 484be6a4760SRuslan Ermilov.Sx COMMON ITEMS 485be6a4760SRuslan Ermilovsection in 486be6a4760SRuslan Ermilov.Pa src/UPDATING . 487b82e53e2SMurray Stokely.Pp 488b82e53e2SMurray StokelyThe following sequence of commands can be used to cross-build the 48962d06538SMaxim Konovalovsystem for the sparc64 architecture on an i386 host: 490b82e53e2SMurray Stokely.Bd -literal -offset indent 491b82e53e2SMurray Stokelycd /usr/src 492531b260aSWarner Loshmake TARGET=sparc64 buildworld 493531b260aSWarner Loshmake TARGET=sparc64 DESTDIR=/clients/sparc64 installworld 494b82e53e2SMurray Stokely.Ed 495786aa69aSBen Smithurst.Sh SEE ALSO 4967c20a493SBen Smithurst.Xr cc 1 , 497786aa69aSBen Smithurst.Xr install 1 , 498786aa69aSBen Smithurst.Xr make 1 , 499786aa69aSBen Smithurst.Xr make.conf 5 , 500157376baSJoseph Koshy.Xr src.conf 5 , 501a81996b6SBen Smithurst.Xr ports 7 , 502a54bda91SMurray Stokely.Xr release 7 , 50361001d75STom Rhodes.Xr config 8 , 50447f77d8cSBen Smithurst.Xr mergemaster 8 , 505a81996b6SBen Smithurst.Xr reboot 8 , 506a81996b6SBen Smithurst.Xr shutdown 8 507786aa69aSBen Smithurst.Sh AUTHORS 508786aa69aSBen Smithurst.An Mike W. Meyer Aq mwm@mired.org . 509