xref: /freebsd/share/man/man7/build.7 (revision a0e6a0131a6f0eaf69eef7769105f87d9043ab84)
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.\"
27*a0e6a013SBryan Drewery.Dd June 17, 2014
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 .
4250a994c9SWarren BlockThese directories may be initially empty or non-existent until updated with
43d732418bSWarren Block.Xr csup 1 ,
44d732418bSWarren Block.Xr svn 1 ,
4550a994c9SWarren Blockor
46d732418bSWarren Block.Xr portsnap 8 .
477b710ab2SJoseph KoshyDirectory
48786aa69aSBen Smithurst.Pa /usr/src
49786aa69aSBen Smithurstcontains the
50786aa69aSBen Smithurst.Dq "base system"
51786aa69aSBen Smithurstsources, which is loosely defined as the things required to rebuild
52786aa69aSBen Smithurstthe system to a useful state.
537b710ab2SJoseph KoshyDirectory
54786aa69aSBen Smithurst.Pa /usr/doc
55786aa69aSBen Smithurstcontains the source for the system documentation, excluding the manual
56786aa69aSBen Smithurstpages.
577b710ab2SJoseph KoshyDirectory
58786aa69aSBen Smithurst.Pa /usr/ports
597b710ab2SJoseph Koshycontains a tree that provides a consistent interface for building and
60786aa69aSBen Smithurstinstalling third party applications.
617b710ab2SJoseph KoshyFor more information about the ports build process, see
627b710ab2SJoseph Koshy.Xr ports 7 .
63786aa69aSBen Smithurst.Pp
64786aa69aSBen SmithurstThe
65786aa69aSBen Smithurst.Xr make 1
66786aa69aSBen Smithurstcommand is used in each of these directories to build and install the
671caae057SRuslan Ermilovthings in that directory.
681caae057SRuslan ErmilovIssuing the
691caae057SRuslan Ermilov.Xr make 1
701caae057SRuslan Ermilovcommand in any directory or
71786aa69aSBen Smithurstsubdirectory of those directories has the same effect as issuing the
721caae057SRuslan Ermilovsame command in all subdirectories of that directory.
731caae057SRuslan ErmilovWith no target specified, the things in that directory are just built.
747b710ab2SJoseph Koshy.Pp
757b710ab2SJoseph KoshyA source tree is allowed to be read-only.
767b710ab2SJoseph KoshyAs described in
777b710ab2SJoseph Koshy.Xr make 1 ,
787b710ab2SJoseph Koshyobjects are usually built in a separate object directory hierarchy
797b710ab2SJoseph Koshyspecified by the environment variable
807b710ab2SJoseph Koshy.Va MAKEOBJDIRPREFIX ,
817b710ab2SJoseph Koshyor under
827b710ab2SJoseph Koshy.Pa /usr/obj
837b710ab2SJoseph Koshyif variable
847b710ab2SJoseph Koshy.Va MAKEOBJDIRPREFIX
857b710ab2SJoseph Koshyis not set.
867b710ab2SJoseph KoshyFor a given source directory, its canonical object directory
877b710ab2SJoseph Koshywould be
887b710ab2SJoseph Koshy.Pa ${MAKEOBJDIRPREFIX}${.CURDIR}
897b710ab2SJoseph Koshyif
907b710ab2SJoseph Koshy.Xr make 1
917b710ab2SJoseph Koshyvariable
927b710ab2SJoseph Koshy.Va MAKEOBJDIRPREFIX
937b710ab2SJoseph Koshyis set, or
947b710ab2SJoseph Koshy.Pa /usr/obj${.CURDIR}
957b710ab2SJoseph Koshyif this variable is not set.
967b710ab2SJoseph KoshyCross-builds set the object directory as described in the
977b710ab2SJoseph Koshydocumentation for the
987b710ab2SJoseph Koshy.Cm buildworld
997b710ab2SJoseph Koshytarget below.
1007b710ab2SJoseph Koshy.Pp
1017b710ab2SJoseph KoshyThe build may be controlled by defining
1027b710ab2SJoseph Koshy.Xr make 1
1037b710ab2SJoseph Koshyvariables described in the
1047b710ab2SJoseph Koshy.Sx ENVIRONMENT
1057b710ab2SJoseph Koshysection below, and by the variables documented in
1067b710ab2SJoseph Koshy.Xr make.conf 5 .
1077b710ab2SJoseph Koshy.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"
1111caae057SRuslan Ermilov.It Cm clean
1127b710ab2SJoseph KoshyRemove any files created during the build process.
1137b710ab2SJoseph Koshy.It Cm cleandepend
1147b710ab2SJoseph KoshyRemove the file
1157b710ab2SJoseph Koshy.Pa ${.OBJDIR}/${DEPENDFILE}
1167b710ab2SJoseph Koshygenerated by a prior
1177b710ab2SJoseph Koshy.Dq Li "make depend"
1187b710ab2SJoseph Koshystep.
1197b710ab2SJoseph Koshy.It Cm cleandir
1207b710ab2SJoseph KoshyRemove the canonical object directory if it exists, or perform
1217b710ab2SJoseph Koshyactions equivalent to
1227b710ab2SJoseph Koshy.Dq Li "make clean cleandepend"
1237b710ab2SJoseph Koshyif it does not.
1247b710ab2SJoseph KoshyThis target will also remove an
1257b710ab2SJoseph Koshy.Pa obj
1267b710ab2SJoseph Koshylink in
1277b710ab2SJoseph Koshy.Pa ${.CURDIR}
1287b710ab2SJoseph Koshyif that exists.
1297b710ab2SJoseph Koshy.Pp
1307b710ab2SJoseph KoshyIt is advisable to run
1317b710ab2SJoseph Koshy.Dq Li "make cleandir"
1327b710ab2SJoseph Koshytwice: the first invocation will remove the canonical object directory
1337b710ab2SJoseph Koshyand the second one will clean up
1347b710ab2SJoseph Koshy.Pa ${.CURDIR} .
1357b710ab2SJoseph Koshy.It Cm depend
1367b710ab2SJoseph KoshyGenerate a list of build dependencies in file
1377b710ab2SJoseph Koshy.Pa ${.OBJDIR}/${DEPENDFILE} .
1381caae057SRuslan Ermilov.It Cm install
1397b710ab2SJoseph KoshyInstall the results of the build to the appropriate location in the
1407b710ab2SJoseph Koshyinstallation directory hierarchy specified in variable
1417b710ab2SJoseph Koshy.Va DESTDIR .
1427b710ab2SJoseph Koshy.It Cm obj
1437b710ab2SJoseph KoshyCreate the canonical object directory associated with the current
1447b710ab2SJoseph Koshydirectory.
1457b710ab2SJoseph Koshy.It Cm objlink
1467b710ab2SJoseph KoshyCreate a symbolic link to the canonical object directory in
1477b710ab2SJoseph Koshy.Pa ${.CURDIR} .
1487b710ab2SJoseph Koshy.It Cm tags
1497b710ab2SJoseph KoshyGenerate a tags file using the program specified in the
1507b710ab2SJoseph Koshy.Xr make 1
1517b710ab2SJoseph Koshyvariable
1527b710ab2SJoseph Koshy.Va CTAGS .
1537b710ab2SJoseph KoshyThe build system supports
1547b710ab2SJoseph Koshy.Xr ctags 1
1557b710ab2SJoseph Koshyand
1567b710ab2SJoseph Koshy.Nm "GNU Global" .
1577b710ab2SJoseph Koshy.El
1587b710ab2SJoseph Koshy.Pp
1597b710ab2SJoseph KoshyThe other supported targets under directory
1607b710ab2SJoseph Koshy.Pa /usr/src
1617b710ab2SJoseph Koshyare:
1627b710ab2SJoseph Koshy.Bl -tag -width ".Cm distributeworld"
1637b710ab2SJoseph Koshy.It Cm buildenv
1647b710ab2SJoseph KoshySpawn an interactive shell with environment variables set up for
1657b710ab2SJoseph Koshycross-building the system.
1667b710ab2SJoseph KoshyThe target architecture needs to be specified with
1677b710ab2SJoseph Koshy.Xr make 1
1687b710ab2SJoseph Koshyvariables
1697b710ab2SJoseph Koshy.Va TARGET_ARCH
1707b710ab2SJoseph Koshyand
1717b710ab2SJoseph Koshy.Va TARGET .
1727b710ab2SJoseph Koshy.Pp
1737b710ab2SJoseph KoshyThis target is only useful after a complete cross-toolchain including
1747b710ab2SJoseph Koshythe compiler, linker, assembler, headers and libraries has been
1757b710ab2SJoseph Koshybuilt; see the
1767b710ab2SJoseph Koshy.Cm toolchain
1777b710ab2SJoseph Koshytarget below.
1787b710ab2SJoseph Koshy.It Cm buildworld
1797b710ab2SJoseph KoshyBuild everything but the kernel, configure files in
1807b710ab2SJoseph Koshy.Pa etc ,
1817b710ab2SJoseph Koshyand
1827b710ab2SJoseph Koshy.Pa release .
1837b710ab2SJoseph KoshyThe actual build location prefix used is
1847b710ab2SJoseph Koshy.Pa ${MAKEOBJDIRPREFIX}${.CURDIR}
1857b710ab2SJoseph Koshyfor native builds, and
1867b710ab2SJoseph Koshy.Pa ${MAKEOBJDIRPREFIX}/${TARGET}${.CURDIR}
1877b710ab2SJoseph Koshyfor cross builds and native builds with variable
1887b710ab2SJoseph Koshy.Va CROSS_BUILD_TESTING
1897b710ab2SJoseph Koshyset.
1907b710ab2SJoseph Koshy.It Cm cleanworld
1917b710ab2SJoseph KoshyAttempt to clean up targets built by a preceding
1927b710ab2SJoseph Koshy.Cm buildworld
1937b710ab2SJoseph Koshystep.
1947b710ab2SJoseph Koshy.It Cm distributeworld
1957b710ab2SJoseph KoshyDistribute everything compiled by a preceding
1967b710ab2SJoseph Koshy.Cm buildworld
1977b710ab2SJoseph Koshystep.
1987b710ab2SJoseph KoshyFiles are placed in the directory hierarchy specified by
1997b710ab2SJoseph Koshy.Xr make 1
2007b710ab2SJoseph Koshyvariable
2017b710ab2SJoseph Koshy.Va DISTDIR .
2027b710ab2SJoseph KoshyThis target is used while building a release; see
2037b710ab2SJoseph Koshy.Xr release 7 .
204e8423d00SNathan Whitehorn.It Cm packageworld
205e8423d00SNathan WhitehornArchive the results of
206e8423d00SNathan Whitehorn.Cm distributeworld ,
207e8423d00SNathan Whitehornplacing the results in
208e8423d00SNathan Whitehorn.Va DISTDIR .
209e8423d00SNathan WhitehornThis target is used while building a release; see
210e8423d00SNathan Whitehorn.Xr release 7 .
2117b710ab2SJoseph Koshy.It Cm installworld
2127b710ab2SJoseph KoshyInstall everything built by a preceding
2137b710ab2SJoseph Koshy.Cm buildworld
2147b710ab2SJoseph Koshystep into the directory hierarchy pointed to by
2157b710ab2SJoseph Koshy.Xr make 1
2167b710ab2SJoseph Koshyvariable
2177b710ab2SJoseph Koshy.Va DESTDIR .
218a3aed80dSRuslan Ermilov.Pp
21904876cf3SRuslan ErmilovIf installing onto an NFS file system and running
2208ed6451eSRuslan Ermilov.Xr make 1
2218ed6451eSRuslan Ermilovwith the
22204876cf3SRuslan Ermilov.Fl j
22304876cf3SRuslan Ermilovoption, make sure that
224a3aed80dSRuslan Ermilov.Xr rpc.lockd 8
225a3aed80dSRuslan Ermilovis running on both client and server.
226a3aed80dSRuslan ErmilovSee
227a3aed80dSRuslan Ermilov.Xr rc.conf 5
228a3aed80dSRuslan Ermilovon how to make it start at boot time.
2297b710ab2SJoseph Koshy.It Cm toolchain
2307b710ab2SJoseph KoshyCreate the build toolchain needed to build the rest of the system.
2317b710ab2SJoseph KoshyFor cross-architecture builds, this step creates a cross-toolchain.
2327b710ab2SJoseph Koshy.It Cm universe
2334e889921SJohn BaldwinFor each architecture,
2344e889921SJohn Baldwinexecute a
2357b710ab2SJoseph Koshy.Cm buildworld
2364e889921SJohn Baldwinfollowed by a
2377b710ab2SJoseph Koshy.Cm buildkernel
2384e889921SJohn Baldwinfor all kernels for that architecture,
2394e889921SJohn Baldwinincluding
2404e889921SJohn Baldwin.Pa LINT .
2417b710ab2SJoseph KoshyThis command takes a long time.
2421caae057SRuslan Ermilov.It Cm update
2437b710ab2SJoseph KoshyGet updated sources as configured in
24408b91343SYaroslav Tykhiy.Xr make.conf 5 .
245f1d16bd8SBjoern A. Zeeb.It Cm targets
246f1d16bd8SBjoern A. ZeebPrint a list of supported
247f1d16bd8SBjoern A. Zeeb.Va TARGET
248f1d16bd8SBjoern A. Zeeb/
249f1d16bd8SBjoern A. Zeeb.Va TARGET_ARCH
250f1d16bd8SBjoern A. Zeebpairs for world and kernel targets.
251eee8163bSBjoern A. Zeeb.It Cm tinderbox
252eee8163bSBjoern A. ZeebExecute the same targets as
253eee8163bSBjoern A. Zeeb.Cm universe .
254eee8163bSBjoern A. ZeebIn addition print a summary of all failed targets at the end and
255eee8163bSBjoern A. Zeebexit with an error if there were any.
2564e889921SJohn Baldwin.It Cm toolchains
2574e889921SJohn BaldwinCreate a build toolchain for each architecture supported by the build system.
258786aa69aSBen Smithurst.El
259786aa69aSBen Smithurst.Pp
2607b710ab2SJoseph KoshyKernel specific build targets in
261786aa69aSBen Smithurst.Pa /usr/src
2627b710ab2SJoseph Koshyare:
263e8423d00SNathan Whitehorn.Bl -tag -width ".Cm distributekernel"
2641caae057SRuslan Ermilov.It Cm buildkernel
2651caae057SRuslan ErmilovRebuild the kernel and the kernel modules.
2661caae057SRuslan Ermilov.It Cm installkernel
2677b710ab2SJoseph KoshyInstall the kernel and the kernel modules to directory
2687b710ab2SJoseph Koshy.Pa ${DESTDIR}/boot/kernel ,
2697b710ab2SJoseph Koshyrenaming any pre-existing directory with this name to
2707b710ab2SJoseph Koshy.Pa kernel.old
2717b710ab2SJoseph Koshyif it contained the currently running kernel.
2727b710ab2SJoseph KoshyThe target directory under
2737b710ab2SJoseph Koshy.Pa ${DESTDIR}
2747b710ab2SJoseph Koshymay be modified using the
2757b710ab2SJoseph Koshy.Va INSTKERNNAME
2767b710ab2SJoseph Koshyand
2777b710ab2SJoseph Koshy.Va KODIR
2787b710ab2SJoseph Koshy.Xr make 1
2797b710ab2SJoseph Koshyvariables.
280e8423d00SNathan Whitehorn.It Cm distributekernel
281e8423d00SNathan WhitehornInstall the kernel to the directory
282e8423d00SNathan Whitehorn.Pa ${DISTDIR}/kernel/boot/kernel .
283e8423d00SNathan WhitehornThis target is used while building a release; see
284e8423d00SNathan Whitehorn.Xr release 7 .
285e8423d00SNathan Whitehorn.It Cm packagekernel
286e8423d00SNathan WhitehornArchive the results of
287e8423d00SNathan Whitehorn.Cm distributekernel ,
288e8423d00SNathan Whitehornplacing the results in
289e8423d00SNathan Whitehorn.Va DISTDIR .
290e8423d00SNathan WhitehornThis target is used while building a release; see
291e8423d00SNathan Whitehorn.Xr release 7 .
292389e98a7STom Rhodes.It Cm kernel
293389e98a7STom RhodesEquivalent to
294389e98a7STom Rhodes.Cm buildkernel
295389e98a7STom Rhodesfollowed by
296389e98a7STom Rhodes.Cm installkernel
2977b710ab2SJoseph Koshy.It Cm kernel-toolchain
2987b710ab2SJoseph KoshyRebuild the tools needed for kernel compilation.
2997b710ab2SJoseph KoshyUse this if you did not do a
3007b710ab2SJoseph Koshy.Cm buildworld
3017b710ab2SJoseph Koshyfirst.
3027b710ab2SJoseph Koshy.It Cm reinstallkernel
3037b710ab2SJoseph KoshyReinstall the kernel and the kernel modules, overwriting the contents
3047b710ab2SJoseph Koshyof the target directory.
3057b710ab2SJoseph KoshyAs with the
3067b710ab2SJoseph Koshy.Cm installkernel
3077b710ab2SJoseph Koshytarget, the target directory can be specified using the
3087b710ab2SJoseph Koshy.Xr make 1
3097b710ab2SJoseph Koshyvariable
3107b710ab2SJoseph Koshy.Va INSTKERNNAME .
3117b710ab2SJoseph Koshy.El
3127b710ab2SJoseph Koshy.Pp
3137b710ab2SJoseph KoshyConvenience targets for cleaning up the install destination directory
3147b710ab2SJoseph Koshydenoted by variable
3157b710ab2SJoseph Koshy.Va DESTDIR
3167b710ab2SJoseph Koshyinclude:
3177b710ab2SJoseph Koshy.Bl -tag -width ".Cm delete-old-libs"
3187b710ab2SJoseph Koshy.It Cm check-old
319abfabbeaSMike PritchardPrint a list of old files and directories in the system.
320e2a36081SAlexander Leidinger.It Cm delete-old
321e2a36081SAlexander LeidingerDelete obsolete base system files and directories interactively.
32278ad5421SRuslan ErmilovWhen
32378ad5421SRuslan Ermilov.Li -DBATCH_DELETE_OLD_FILES
3247b710ab2SJoseph Koshyis specified at the command line, the delete operation will be
3257b710ab2SJoseph Koshynon-interactive.
326c8ef0ed5SRuslan ErmilovThe variables
3277b710ab2SJoseph Koshy.Va DESTDIR ,
3287b710ab2SJoseph Koshy.Va TARGET_ARCH
329c8ef0ed5SRuslan Ermilovand
330c8ef0ed5SRuslan Ermilov.Va TARGET
331c8ef0ed5SRuslan Ermilovshould be set as with
332c8ef0ed5SRuslan Ermilov.Dq Li "make installworld" .
333e2a36081SAlexander Leidinger.It Cm delete-old-libs
334e2a36081SAlexander LeidingerDelete obsolete base system libraries interactively.
3357b710ab2SJoseph KoshyThis target should only be used if no 3rd party software uses these
3367b710ab2SJoseph Koshylibraries.
33778ad5421SRuslan ErmilovWhen
33878ad5421SRuslan Ermilov.Li -DBATCH_DELETE_OLD_FILES
3397b710ab2SJoseph Koshyis specified at the command line, the delete operation will be
3407b710ab2SJoseph Koshynon-interactive.
341c8ef0ed5SRuslan ErmilovThe variables
3427b710ab2SJoseph Koshy.Va DESTDIR ,
3437b710ab2SJoseph Koshy.Va TARGET_ARCH
344c8ef0ed5SRuslan Ermilovand
345c8ef0ed5SRuslan Ermilov.Va TARGET
346c8ef0ed5SRuslan Ermilovshould be set as with
347c8ef0ed5SRuslan Ermilov.Dq Li "make installworld" .
348786aa69aSBen Smithurst.El
349b82e53e2SMurray Stokely.Sh ENVIRONMENT
3507b710ab2SJoseph KoshyVariables that influence all builds include:
3517b710ab2SJoseph Koshy.Bl -tag -width ".Va MAKEOBJDIRPREFIX"
352fea87c03SGiorgos Keramidas.It Va DEBUG_FLAGS
353fea87c03SGiorgos KeramidasDefines a set of debugging flags that will be used to build all userland
354fea87c03SGiorgos Keramidasbinaries under
355fea87c03SGiorgos Keramidas.Pa /usr/src .
356fea87c03SGiorgos KeramidasWhen
357fea87c03SGiorgos Keramidas.Va DEBUG_FLAGS
358fea87c03SGiorgos Keramidasis defined, the
359fea87c03SGiorgos Keramidas.Cm install
360fea87c03SGiorgos Keramidasand
361fea87c03SGiorgos Keramidas.Cm installworld
362fea87c03SGiorgos Keramidastargets install binaries from the current
363fea87c03SGiorgos Keramidas.Va MAKEOBJDIRPREFIX
364fea87c03SGiorgos Keramidaswithout stripping,
365fea87c03SGiorgos Keramidasso that debugging information is retained in the installed binaries.
3667b710ab2SJoseph Koshy.It Va DESTDIR
3677b710ab2SJoseph KoshyThe directory hierarchy prefix where built objects will be installed.
3687b710ab2SJoseph KoshyIf not set,
3697b710ab2SJoseph Koshy.Va DESTDIR
3707b710ab2SJoseph Koshydefaults to the empty string.
3717b710ab2SJoseph Koshy.It Va MAKEOBJDIRPREFIX
3727b710ab2SJoseph KoshyDefines the prefix for directory names in the tree of built objects.
3737b710ab2SJoseph KoshyDefaults to
3747b710ab2SJoseph Koshy.Pa /usr/obj
3757b710ab2SJoseph Koshyif not defined.
3767b710ab2SJoseph KoshyThis variable should only be set in the environment and not via
3777b710ab2SJoseph Koshy.Pa /etc/make.conf
3787b710ab2SJoseph Koshyor the command line.
3797b710ab2SJoseph Koshy.It Va NO_WERROR
3807b710ab2SJoseph KoshyIf defined, compiler warnings will not cause the build to halt,
3817b710ab2SJoseph Koshyeven if the makefile says otherwise.
38221edb039SAlexander Leidinger.It Va WITH_CTF
38321edb039SAlexander LeidingerIf defined, the build process will run the DTrace CTF conversion
38421edb039SAlexander Leidingertools on built objects.
3857b710ab2SJoseph Koshy.El
3867b710ab2SJoseph Koshy.Pp
3877b710ab2SJoseph KoshyAdditionally, builds in
3887b710ab2SJoseph Koshy.Pa /usr/src
3897b710ab2SJoseph Koshyare influenced by the following
3907b710ab2SJoseph Koshy.Xr make 1
3917b710ab2SJoseph Koshyvariables:
3927b710ab2SJoseph Koshy.Bl -tag -width ".Va SUBDIR_OVERRIDE"
393e6cdeeddSWarner Losh.It Va KERNCONF
394e6cdeeddSWarner LoshOverrides which kernel to build and install for the various kernel
395e6cdeeddSWarner Loshmake targets.
396e6cdeeddSWarner LoshIt defaults to
397e6cdeeddSWarner Losh.Cm GENERIC .
398e6cdeeddSWarner Losh.It Va KERNFAST
399e6cdeeddSWarner LoshIf set, the build target
400e6cdeeddSWarner Losh.Cm buildkernel
401e6cdeeddSWarner Loshdefaults to setting
402e6cdeeddSWarner Losh.Va NO_KERNELCLEAN ,
4036d50d5e4SWarner Losh.Va NO_KERNELCONFIG ,
4046d50d5e4SWarner Losh.Va NO_KERNELDEPEND
405e6cdeeddSWarner Loshand
4066d50d5e4SWarner Losh.Va NO_KERNELOBJ .
407e6cdeeddSWarner LoshWhen set to a value other than
408e6cdeeddSWarner Losh.Cm 1
409e6cdeeddSWarner Loshthen
410e6cdeeddSWarner Losh.Va KERNCONF
411e6cdeeddSWarner Loshis set to the value of
412e6cdeeddSWarner Losh.Va KERNFAST .
4137b710ab2SJoseph Koshy.It Va LOCAL_DIRS
414ca6a54ceSBryan DreweryIf set, this variable supplies a list of additional directories relative to
415ca6a54ceSBryan Drewerythe root of the source tree to build as part of the
416ca6a54ceSBryan Drewery.Cm everything
417ca6a54ceSBryan Drewerytarget.
418*a0e6a013SBryan Drewery.It Va LOCAL_ITOOLS
419*a0e6a013SBryan DreweryIf set, this variable supplies a list of additional tools that are used by the
420*a0e6a013SBryan Drewery.Cm installworld
421*a0e6a013SBryan Dreweryand
422*a0e6a013SBryan Drewery.Cm distributeworld
423*a0e6a013SBryan Drewerytargets.
424ca6a54ceSBryan Drewery.It Va LOCAL_LIB_DIRS
425ca6a54ceSBryan DreweryIf set, this variable supplies a list of additional directories relative to
426ca6a54ceSBryan Drewerythe root of the source tree to build as part of the
427ca6a54ceSBryan Drewery.Cm libraries
428ca6a54ceSBryan Drewerytarget.
429ca6a54ceSBryan Drewery.It Va LOCAL_MTREE
430ca6a54ceSBryan DreweryIf set, this variable supplies a list of additional mtrees relative to the
431ca6a54ceSBryan Dreweryroot of the source tree to use as part of the
432ca6a54ceSBryan Drewery.Cm hierarchy
433ca6a54ceSBryan Drewerytarget.
434ca6a54ceSBryan Drewery.It Va LOCAL_TOOL_DIRS
435ca6a54ceSBryan DreweryIf set, this variable supplies a list of additional directories relative to
436ca6a54ceSBryan Drewerythe root of the source tree to build as part of the
437ca6a54ceSBryan Drewery.Cm build-tools
438ca6a54ceSBryan Drewerytarget.
439170c2788SGlen Barber.It Va PORTS_MODULES
440170c2788SGlen BarberA list of ports with kernel modules that should be built and installed
441170c2788SGlen Barberas part of the
442170c2788SGlen Barber.Cm buildkernel
443170c2788SGlen Barberand
444170c2788SGlen Barber.Cm installkernel
445170c2788SGlen Barberprocess.
446170c2788SGlen Barber.Bd -literal -offset indent
447170c2788SGlen Barbermake PORTS_MODULES=emulators/kqemu-kmod kernel
448170c2788SGlen Barber.Ed
4497b710ab2SJoseph Koshy.It Va SUBDIR_OVERRIDE
4507b710ab2SJoseph KoshyOverride the default list of sub-directories and only build the
4517b710ab2SJoseph Koshysub-directory named in this variable.
4527b710ab2SJoseph KoshyThis variable is useful when debugging failed builds.
4537b710ab2SJoseph Koshy.Bd -literal -offset indent
4547b710ab2SJoseph Koshymake some-target SUBDIR_OVERRIDE=foo/bar
4557b710ab2SJoseph Koshy.Ed
4566f9ac6feSMurray Stokely.It Va TARGET
457b3a43ea3SMurray StokelyThe target hardware platform.
458365a17c0SMurray StokelyThis is analogous to the
4591caae057SRuslan Ermilov.Dq Nm uname Fl m
460b3a43ea3SMurray Stokelyoutput.
461b3a43ea3SMurray StokelyThis is necessary to cross-build some target architectures.
462b3a43ea3SMurray StokelyFor example, cross-building for PC98 machines requires
4631caae057SRuslan Ermilov.Va TARGET_ARCH Ns = Ns Li i386
464b3a43ea3SMurray Stokelyand
4651caae057SRuslan Ermilov.Va TARGET Ns = Ns Li pc98 .
4667b710ab2SJoseph KoshyIf not set,
4677b710ab2SJoseph Koshy.Va TARGET
4687b710ab2SJoseph Koshydefaults to the current hardware platform.
4697b710ab2SJoseph Koshy.It Va TARGET_ARCH
4707b710ab2SJoseph KoshyThe target machine processor architecture.
4717b710ab2SJoseph KoshyThis is analogous to the
4727b710ab2SJoseph Koshy.Dq Nm uname Fl p
4737b710ab2SJoseph Koshyoutput.
4747b710ab2SJoseph KoshySet this to cross-build for a different architecture.
4757b710ab2SJoseph KoshyIf not set,
4767b710ab2SJoseph Koshy.Va TARGET_ARCH
477531b260aSWarner Loshdefaults to the current machine architecture, unless
478531b260aSWarner Losh.Va TARGET
479531b260aSWarner Loshis also set, in which case it defaults to the appropriate
480531b260aSWarner Loshvalue for that platform.
481c22c7f86SWarner LoshTypically, one only needs to set
482c22c7f86SWarner Losh.Va TARGET .
4837b710ab2SJoseph Koshy.El
4847b710ab2SJoseph Koshy.Pp
4857b710ab2SJoseph KoshyBuilds under directory
486fd23b461SGiorgos Keramidas.Pa /usr/src
4877d6af40dSGlen Barberare also influenced by defining one or more of the following symbols,
488fd23b461SGiorgos Keramidasusing the
489fd23b461SGiorgos Keramidas.Fl D
490fd23b461SGiorgos Keramidasoption of
491fd23b461SGiorgos Keramidas.Xr make 1 :
492fd23b461SGiorgos Keramidas.Bl -tag -width ".Va -DNO_KERNELDEPEND"
493fd23b461SGiorgos Keramidas.It Va NO_CLEANDIR
494fd23b461SGiorgos KeramidasIf set, the build targets that clean parts of the object tree use the
495fd23b461SGiorgos Keramidasequivalent of
496fd23b461SGiorgos Keramidas.Dq make clean
497fd23b461SGiorgos Keramidasinstead of
498fd23b461SGiorgos Keramidas.Dq make cleandir .
499fd23b461SGiorgos Keramidas.It Va NO_CLEAN
500fd23b461SGiorgos KeramidasIf set, no object tree files are cleaned at all.
501fd23b461SGiorgos KeramidasSetting
502fd23b461SGiorgos Keramidas.Va NO_CLEAN
503fd23b461SGiorgos Keramidasimplies
504fd23b461SGiorgos Keramidas.Va NO_KERNELCLEAN ,
505fd23b461SGiorgos Keramidasso when
506fd23b461SGiorgos Keramidas.Va NO_CLEAN
507fd23b461SGiorgos Keramidasis set no kernel objects are cleaned either.
508fd23b461SGiorgos Keramidas.It Va NO_CTF
509fd23b461SGiorgos KeramidasIf set, the build process does not run the DTrace CTF conversion tools
510fd23b461SGiorgos Keramidason built objects.
511fd23b461SGiorgos Keramidas.It Va NO_SHARE
512fd23b461SGiorgos KeramidasIf set, the build does not descend into the
513fd23b461SGiorgos Keramidas.Pa /usr/src/share
51450a994c9SWarren Blocksubdirectory (i.e., manpages, locale data files, timezone data files and
515fd23b461SGiorgos Keramidasother
516fd23b461SGiorgos Keramidas.Pa /usr/src/share
517fd23b461SGiorgos Keramidasfiles will not be rebuild from their sources).
518fd23b461SGiorgos Keramidas.It Va NO_KERNELCLEAN
519fd23b461SGiorgos KeramidasIf set, the build process does not run
520fd23b461SGiorgos Keramidas.Dq make clean
521fd23b461SGiorgos Keramidasas part of the
522fd23b461SGiorgos Keramidas.Cm buildkernel
523fd23b461SGiorgos Keramidastarget.
524fd23b461SGiorgos Keramidas.It Va NO_KERNELCONFIG
525fd23b461SGiorgos KeramidasIf set, the build process does not run
526fd23b461SGiorgos Keramidas.Xr config 8
527fd23b461SGiorgos Keramidasas part of the
528fd23b461SGiorgos Keramidas.Cm buildkernel
529fd23b461SGiorgos Keramidastarget.
530fd23b461SGiorgos Keramidas.It Va NO_KERNELDEPEND
531fd23b461SGiorgos KeramidasIf set, the build process does not run
532fd23b461SGiorgos Keramidas.Dq make depend
533fd23b461SGiorgos Keramidasas part of the
534fd23b461SGiorgos Keramidas.Cm buildkernel
535fd23b461SGiorgos Keramidastarget.
5366d50d5e4SWarner Losh.It Va NO_KERNELOBJ
5376d50d5e4SWarner LoshIf set, the build process does not run
5386d50d5e4SWarner Losh.Dq make obj
5396d50d5e4SWarner Loshas part of the
5406d50d5e4SWarner Losh.Cm buildkernel
5416d50d5e4SWarner Loshtarget.
542fd23b461SGiorgos Keramidas.It Va NO_DOCUPDATE
543fd23b461SGiorgos KeramidasIf set, the update process does not update the source of the
544fd23b461SGiorgos Keramidas.Fx
545fd23b461SGiorgos Keramidasdocumentation as part of the
546fd23b461SGiorgos Keramidas.Dq make update
547fd23b461SGiorgos Keramidastarget.
548fd23b461SGiorgos Keramidas.It Va NO_PORTSUPDATE
549fd23b461SGiorgos KeramidasIf set, the update process does not update the Ports tree as part of the
550fd23b461SGiorgos Keramidas.Dq make update
551fd23b461SGiorgos Keramidastarget.
55269c488cdSRuslan Ermilov.It Va NO_WWWUPDATE
55369c488cdSRuslan ErmilovIf set, the update process does not update the www tree as part of the
55469c488cdSRuslan Ermilov.Dq make update
55569c488cdSRuslan Ermilovtarget.
556fd23b461SGiorgos Keramidas.El
557fd23b461SGiorgos Keramidas.Pp
558fd23b461SGiorgos KeramidasBuilds under directory
5597b710ab2SJoseph Koshy.Pa /usr/doc
5607b710ab2SJoseph Koshyare influenced by the following
5617b710ab2SJoseph Koshy.Xr make 1
5627b710ab2SJoseph Koshyvariables:
5637b710ab2SJoseph Koshy.Bl -tag -width ".Va DOC_LANG"
5647b710ab2SJoseph Koshy.It Va DOC_LANG
5657b710ab2SJoseph KoshyIf set, restricts the documentation build to the language subdirectories
5667b710ab2SJoseph Koshyspecified as its content.
5677b710ab2SJoseph KoshyThe default action is to build documentation for all languages.
568b82e53e2SMurray Stokely.El
5694e889921SJohn Baldwin.Pp
5704e889921SJohn BaldwinBuilds using the
5714e889921SJohn Baldwin.Cm universe
5724e889921SJohn Baldwintarget are influenced by the following
5734e889921SJohn Baldwin.Xr make 1
5744e889921SJohn Baldwinvariables:
5754e889921SJohn Baldwin.Bl -tag -width ".Va MAKE_JUST_KERNELS"
5764e889921SJohn Baldwin.It Va JFLAG
5774e889921SJohn BaldwinPass the value of this variable to each
5784e889921SJohn Baldwin.Xr make 1
5794e889921SJohn Baldwininvocation used to build worlds and kernels.
5804e889921SJohn BaldwinThis can be used to enable multiple jobs within a single architecture's build
5814e889921SJohn Baldwinwhile still building each architecture serially.
5824e889921SJohn Baldwin.It Va MAKE_JUST_KERNELS
5834e889921SJohn BaldwinOnly build kernels for each supported architecture.
5844e889921SJohn Baldwin.It Va MAKE_JUST_WORLDS
5854e889921SJohn BaldwinOnly build worlds for each supported architecture.
5864e889921SJohn Baldwin.It Va UNIVERSE_TARGET
5874e889921SJohn BaldwinExecute the specified
5884e889921SJohn Baldwin.Xr make 1
5894e889921SJohn Baldwintarget for each supported architecture instead of the default action of
5904e889921SJohn Baldwinbuilding a world and one or more kernels.
5914e889921SJohn Baldwin.El
592786aa69aSBen Smithurst.Sh FILES
5930c0eb9beSRuslan Ermilov.Bl -tag -width ".Pa /usr/share/examples/etc/make.conf" -compact
594786aa69aSBen Smithurst.It Pa /usr/doc/Makefile
595786aa69aSBen Smithurst.It Pa /usr/doc/share/mk/doc.project.mk
596786aa69aSBen Smithurst.It Pa /usr/ports/Mk/bsd.port.mk
597786aa69aSBen Smithurst.It Pa /usr/ports/Mk/bsd.sites.mk
5981caae057SRuslan Ermilov.It Pa /usr/share/examples/etc/make.conf
5990c0eb9beSRuslan Ermilov.It Pa /usr/src/Makefile
6000c0eb9beSRuslan Ermilov.It Pa /usr/src/Makefile.inc1
6013136363fSRuslan Ermilov.El
6023faf5fc9SBen Smithurst.Sh EXAMPLES
603be6a4760SRuslan ErmilovFor an
6043faf5fc9SBen Smithurst.Dq approved
6057b710ab2SJoseph Koshymethod of updating your system from the latest sources, please see the
606be6a4760SRuslan Ermilov.Sx COMMON ITEMS
607be6a4760SRuslan Ermilovsection in
608be6a4760SRuslan Ermilov.Pa src/UPDATING .
609b82e53e2SMurray Stokely.Pp
610b82e53e2SMurray StokelyThe following sequence of commands can be used to cross-build the
61162d06538SMaxim Konovalovsystem for the sparc64 architecture on an i386 host:
612b82e53e2SMurray Stokely.Bd -literal -offset indent
613b82e53e2SMurray Stokelycd /usr/src
614531b260aSWarner Loshmake TARGET=sparc64 buildworld
615531b260aSWarner Loshmake TARGET=sparc64 DESTDIR=/clients/sparc64 installworld
616b82e53e2SMurray Stokely.Ed
617786aa69aSBen Smithurst.Sh SEE ALSO
6187c20a493SBen Smithurst.Xr cc 1 ,
61950a994c9SWarren Block.Xr csup 1 ,
620786aa69aSBen Smithurst.Xr install 1 ,
621786aa69aSBen Smithurst.Xr make 1 ,
62250a994c9SWarren Block.Xr svn 1 ,
623786aa69aSBen Smithurst.Xr make.conf 5 ,
624157376baSJoseph Koshy.Xr src.conf 5 ,
625a81996b6SBen Smithurst.Xr ports 7 ,
626a54bda91SMurray Stokely.Xr release 7 ,
62761001d75STom Rhodes.Xr config 8 ,
62847f77d8cSBen Smithurst.Xr mergemaster 8 ,
629d732418bSWarren Block.Xr portsnap 8 ,
630a81996b6SBen Smithurst.Xr reboot 8 ,
631a81996b6SBen Smithurst.Xr shutdown 8
632786aa69aSBen Smithurst.Sh AUTHORS
633786aa69aSBen Smithurst.An Mike W. Meyer Aq mwm@mired.org .
634