xref: /freebsd/share/man/man7/build.7 (revision 6990ffd8a95caaba6858ad44ff1b3157d1efba8f)
1.\" Copyright (c) 2000
2.\"	Mike W. Meyer
3.\"
4.\" Redistribution and use in source and binary forms, with or without
5.\" modification, are permitted provided that the following conditions
6.\" are met:
7.\" 1. Redistributions of source code must retain the above copyright
8.\"    notice, this list of conditions and the following disclaimer.
9.\" 2. Redistributions in binary form must reproduce the above copyright
10.\"    notice, this list of conditions and the following disclaimer in the
11.\"    documentation and/or other materials provided with the distribution.
12.\"
13.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND
14.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
16.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE
17.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
18.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
19.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
20.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
21.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
22.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
23.\" SUCH DAMAGE.
24.\"
25.\" $FreeBSD$
26.\"
27.Dd November 4, 2000
28.Dt BUILD 7
29.Os
30.Sh NAME
31.Nm build
32.Nd information on how to build the system
33.Sh DESCRIPTION
34The source for the
35.Fx
36system and applications are contained in three different directories,
37normally
38.Pa /usr/src ,
39.Pa /usr/doc ,
40and
41.Pa /usr/ports .
42.Pa /usr/src
43contains the
44.Dq "base system"
45sources, which is loosely defined as the things required to rebuild
46the system to a useful state.
47.Pa /usr/doc
48contains the source for the system documentation, excluding the manual
49pages.
50.Pa /usr/ports
51is a tree that provides a consistent interface for building and
52installing third party applications.
53.Pp
54The
55.Xr make 1
56command is used in each of these directories to build and install the
57things in that directory. Issuing the make command in any directory or
58subdirectory of those directories has the same effect as issuing the
59same command in all subdirectories of that directory. With no target
60specified, the things in that directory are just built. The following
61list provides the names and actions for other targets:
62.Bl -tag -width Ar
63.It Ar clean
64Removes any files created during the build process.
65.It Ar install
66Installs the results of the build for this directory.
67.It Ar update
68Gets updated sources as configured in
69.Pa /etc/make.conf .
70.El
71.Pp
72The other
73.Pa /usr/src
74make targets are:
75.Bl -tag -width Ar
76.It Ar buildworld
77Rebuild everything but the kernel, configure files in
78.Pa /etc ,
79and release.
80.It Ar installworld
81Install everything built by
82.Dq buildworld .
83.It Ar world
84buildworld + installworld.
85.It Ar buildkernel
86Rebuild the kernel and the kernel-modules.
87.It Ar installkernel
88Install the kernel and the kernel-modules.
89.It Ar reinstallkernel
90Reinstall the kernel and the kernel-modules.
91.It Ar upgrade
92Upgrade a.out (2.2.x/3.0) system to the new ELF way
93.It Ar most
94Build user commands, no libraries or include files.
95.It Ar installmost
96Install user commands, no libraries or include files.
97.It Ar aout-to-elf
98Upgrade an system from a.out to elf format.
99.It Ar aout-to-elf-build
100Build everything required to upgrade a system from a.out to elf format.
101.It Ar aout-to-elf-install
102Install everything built by aout-to-elf-build.
103.It Ar move-aout-libs
104Move the a.out libraries into an aout sub-directory of each elf
105library sub-directory.
106.El
107.Pp
108For more information about the ports build process, see
109.Xr ports 7 .
110.Sh FILES
111.Bl -tag -width ".Pa /usr/share/examples/etc/make.conf" -compact
112.It Pa /etc/make.conf
113.It Pa /usr/doc/Makefile
114.It Pa /usr/doc/share/mk/doc.project.mk
115.It Pa /usr/ports/Mk/bsd.port.mk
116.It Pa /usr/ports/Mk/bsd.sites.mk
117.It Pa /usr/share/examples/etc//make.conf
118.It Pa /usr/src/Makefile
119.It Pa /usr/src/Makefile.inc1
120.El
121.Sh EXAMPLES
122The
123.Dq approved
124method of updating your system from the latest sources is:
125.Bd -literal -offset indent
126make buildworld
127make buildkernel KERNCONF=FOO
128make installkernel KERNCONF=FOO
129make installworld
130mergemaster
131.Ed
132.Pp
133.Dq FOO
134must be replaced with the name of the kernel configuration file from which
135the kernel should be built.
136Alternatively, the
137.Va KERNCONF
138variable in
139.Pa /etc/make.conf
140can be set to the name of the kernel to build;
141in this case the
142.Dq KERNCONF=FOO
143part of the
144.Dq buildkernel
145and
146.Dq installkernel
147commands can be omitted.
148.Pp
149After running these commands a system reboot is required,
150otherwise many programs which have been rebuilt
151(such as
152.Nm ps ,
153.Nm top ,
154etc)
155may not work with the old kernel which is still running.
156.Sh SEE ALSO
157.Xr cc 1 ,
158.Xr install 1 ,
159.Xr make 1 ,
160.Xr make.conf 5 ,
161.Xr ports 7 ,
162.Xr mergemaster 8 ,
163.Xr reboot 8 ,
164.Xr shutdown 8
165.Sh AUTHORS
166.An Mike W. Meyer Aq mwm@mired.org .
167