xref: /freebsd/share/man/man7/build.7 (revision 78ad54210fe02edbec3bfe18db3a33088b7c06ff)
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.\"
27c8ef0ed5SRuslan Ermilov.Dd August 3, 2005
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
34786aa69aSBen SmithurstThe source for the
35d003b779SRuslan Ermilov.Fx
36786aa69aSBen Smithurstsystem and 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 .
42786aa69aSBen Smithurst.Pa /usr/src
43786aa69aSBen Smithurstcontains the
44786aa69aSBen Smithurst.Dq "base system"
45786aa69aSBen Smithurstsources, which is loosely defined as the things required to rebuild
46786aa69aSBen Smithurstthe system to a useful state.
47786aa69aSBen Smithurst.Pa /usr/doc
48786aa69aSBen Smithurstcontains the source for the system documentation, excluding the manual
49786aa69aSBen Smithurstpages.
50786aa69aSBen Smithurst.Pa /usr/ports
51786aa69aSBen Smithurstis a tree that provides a consistent interface for building and
52786aa69aSBen Smithurstinstalling third party applications.
53786aa69aSBen Smithurst.Pp
54786aa69aSBen SmithurstThe
55786aa69aSBen Smithurst.Xr make 1
56786aa69aSBen Smithurstcommand is used in each of these directories to build and install the
571caae057SRuslan Ermilovthings in that directory.
581caae057SRuslan ErmilovIssuing the
591caae057SRuslan Ermilov.Xr make 1
601caae057SRuslan Ermilovcommand in any directory or
61786aa69aSBen Smithurstsubdirectory of those directories has the same effect as issuing the
621caae057SRuslan Ermilovsame command in all subdirectories of that directory.
631caae057SRuslan ErmilovWith no target specified, the things in that directory are just built.
641caae057SRuslan ErmilovThe following
65786aa69aSBen Smithurstlist provides the names and actions for other targets:
661caae057SRuslan Ermilov.Bl -tag -width indent-two
671caae057SRuslan Ermilov.It Cm clean
68786aa69aSBen SmithurstRemoves any files created during the build process.
691caae057SRuslan Ermilov.It Cm install
70786aa69aSBen SmithurstInstalls the results of the build for this directory.
711caae057SRuslan Ermilov.It Cm update
72786aa69aSBen SmithurstGets updated sources as configured in
7308b91343SYaroslav Tykhiy.Xr make.conf 5 .
74786aa69aSBen Smithurst.El
75786aa69aSBen Smithurst.Pp
76786aa69aSBen SmithurstThe other
77786aa69aSBen Smithurst.Pa /usr/src
78786aa69aSBen Smithurstmake targets are:
791caae057SRuslan Ermilov.Bl -tag -width indent-two
801caae057SRuslan Ermilov.It Cm buildworld
81786aa69aSBen SmithurstRebuild everything but the kernel, configure files in
82786aa69aSBen Smithurst.Pa /etc ,
83786aa69aSBen Smithurstand release.
841caae057SRuslan Ermilov.It Cm installworld
85786aa69aSBen SmithurstInstall everything built by
861caae057SRuslan Ermilov.Cm buildworld .
87722d16b7SDavid E. O'Brien.It Cm kernel-toolchain
88722d16b7SDavid E. O'BrienRebuild the tools needed for kernel compilation.
899ac8d2e8SRuslan ErmilovUse this if you did not do a buildworld first.
901caae057SRuslan Ermilov.It Cm buildkernel
911caae057SRuslan ErmilovRebuild the kernel and the kernel modules.
921caae057SRuslan Ermilov.It Cm installkernel
931caae057SRuslan ErmilovInstall the kernel and the kernel modules.
9461001d75STom Rhodes.It Cm reinstallkernel .
951caae057SRuslan ErmilovReinstall the kernel and the kernel modules.
96389e98a7STom Rhodes.It Cm kernel
97389e98a7STom RhodesEquivalent to
98389e98a7STom Rhodes.Cm buildkernel
99389e98a7STom Rhodesfollowed by
100389e98a7STom Rhodes.Cm installkernel
101e2a36081SAlexander Leidinger.It Cm delete-old
102e2a36081SAlexander LeidingerDelete obsolete base system files and directories interactively.
10378ad5421SRuslan ErmilovWhen
10478ad5421SRuslan Ermilov.Li -DBATCH_DELETE_OLD_FILES
10578ad5421SRuslan Ermilovis specified at the command line,
106af3e19a6SAlexander Leidingerthe delete operation will be non-interactive.
107c8ef0ed5SRuslan ErmilovThe variables
108c8ef0ed5SRuslan Ermilov.Va DESTDIR , TARGET_ARCH
109c8ef0ed5SRuslan Ermilovand
110c8ef0ed5SRuslan Ermilov.Va TARGET
111c8ef0ed5SRuslan Ermilovshould be set as with
112c8ef0ed5SRuslan Ermilov.Dq Li "make installworld" .
113e2a36081SAlexander Leidinger.It Cm delete-old-libs
114e2a36081SAlexander LeidingerDelete obsolete base system libraries interactively.
115e2a36081SAlexander LeidingerThis should only be used if no 3rd party software uses the libraries anymore.
11678ad5421SRuslan ErmilovWhen
11778ad5421SRuslan Ermilov.Li -DBATCH_DELETE_OLD_FILES
11878ad5421SRuslan Ermilovis specified at the command line,
119af3e19a6SAlexander Leidingerthe delete operation will be non-interactive.
120c8ef0ed5SRuslan ErmilovThe variables
121c8ef0ed5SRuslan Ermilov.Va DESTDIR , TARGET_ARCH
122c8ef0ed5SRuslan Ermilovand
123c8ef0ed5SRuslan Ermilov.Va TARGET
124c8ef0ed5SRuslan Ermilovshould be set as with
125c8ef0ed5SRuslan Ermilov.Dq Li "make installworld" .
126786aa69aSBen Smithurst.El
127786aa69aSBen Smithurst.Pp
128786aa69aSBen SmithurstFor more information about the ports build process, see
129786aa69aSBen Smithurst.Xr ports 7 .
130b82e53e2SMurray Stokely.Sh ENVIRONMENT
1316f9ac6feSMurray Stokely.Bl -tag -width ".Va TARGET_ARCH"
1326f9ac6feSMurray Stokely.It Va TARGET_ARCH
133b3a43ea3SMurray StokelyThe target machine processor architecture.
134365a17c0SMurray StokelyThis is analogous to the
1351caae057SRuslan Ermilov.Dq Nm uname Fl p
136b3a43ea3SMurray Stokelyoutput.
137b82e53e2SMurray StokelySet this to cross-build for a different architecture.
1386f9ac6feSMurray Stokely.It Va TARGET
139b3a43ea3SMurray StokelyThe target hardware platform.
140365a17c0SMurray StokelyThis is analogous to the
1411caae057SRuslan Ermilov.Dq Nm uname Fl m
142b3a43ea3SMurray Stokelyoutput.
143b3a43ea3SMurray StokelyThis is necessary to cross-build some target architectures.
144b3a43ea3SMurray StokelyFor example, cross-building for PC98 machines requires
1451caae057SRuslan Ermilov.Va TARGET_ARCH Ns = Ns Li i386
146b3a43ea3SMurray Stokelyand
1471caae057SRuslan Ermilov.Va TARGET Ns = Ns Li pc98 .
1486f9ac6feSMurray Stokely.It Va NO_WERROR
149b82e53e2SMurray StokelyIf defined, warnings will not cause the build to halt, even if the
150b82e53e2SMurray Stokelymakefile says otherwise.
1516f9ac6feSMurray Stokely.It Va DESTDIR
152b3a43ea3SMurray StokelyThe directory hierarchy where the resulting binaries will be
153b3a43ea3SMurray Stokelyinstalled.
154b82e53e2SMurray Stokely.El
155786aa69aSBen Smithurst.Sh FILES
1560c0eb9beSRuslan Ermilov.Bl -tag -width ".Pa /usr/share/examples/etc/make.conf" -compact
157786aa69aSBen Smithurst.It Pa /usr/doc/Makefile
158786aa69aSBen Smithurst.It Pa /usr/doc/share/mk/doc.project.mk
159786aa69aSBen Smithurst.It Pa /usr/ports/Mk/bsd.port.mk
160786aa69aSBen Smithurst.It Pa /usr/ports/Mk/bsd.sites.mk
1611caae057SRuslan Ermilov.It Pa /usr/share/examples/etc/make.conf
1620c0eb9beSRuslan Ermilov.It Pa /usr/src/Makefile
1630c0eb9beSRuslan Ermilov.It Pa /usr/src/Makefile.inc1
1643136363fSRuslan Ermilov.El
1653faf5fc9SBen Smithurst.Sh EXAMPLES
166be6a4760SRuslan ErmilovFor an
1673faf5fc9SBen Smithurst.Dq approved
168be6a4760SRuslan Ermilovmethod of updating your system from the latest sources,
169be6a4760SRuslan Ermilovplease see the
170be6a4760SRuslan Ermilov.Sx COMMON ITEMS
171be6a4760SRuslan Ermilovsection in
172be6a4760SRuslan Ermilov.Pa src/UPDATING .
173b82e53e2SMurray Stokely.Pp
174b82e53e2SMurray StokelyThe following sequence of commands can be used to cross-build the
175b82e53e2SMurray Stokelysystem for the Alpha architecture on an i386 host:
176b82e53e2SMurray Stokely.Bd -literal -offset indent
177b82e53e2SMurray Stokelycd /usr/src
178b3a43ea3SMurray Stokelymake TARGET_ARCH=alpha buildworld
179b3a43ea3SMurray Stokelymake TARGET_ARCH=alpha DESTDIR=/clients/axp installworld
180b82e53e2SMurray Stokely.Ed
181786aa69aSBen Smithurst.Sh SEE ALSO
1827c20a493SBen Smithurst.Xr cc 1 ,
183786aa69aSBen Smithurst.Xr install 1 ,
184786aa69aSBen Smithurst.Xr make 1 ,
185786aa69aSBen Smithurst.Xr make.conf 5 ,
186a81996b6SBen Smithurst.Xr ports 7 ,
187a54bda91SMurray Stokely.Xr release 7 ,
18861001d75STom Rhodes.Xr config 8 ,
18947f77d8cSBen Smithurst.Xr mergemaster 8 ,
190a81996b6SBen Smithurst.Xr reboot 8 ,
191a81996b6SBen Smithurst.Xr shutdown 8
192786aa69aSBen Smithurst.Sh AUTHORS
193786aa69aSBen Smithurst.An Mike W. Meyer Aq mwm@mired.org .
194