2000-11-22 14:04:26 +00:00
|
|
|
.\" Copyright (c) 2000
|
|
|
|
.\" Mike W. Meyer
|
|
|
|
.\"
|
|
|
|
.\" Redistribution and use in source and binary forms, with or without
|
|
|
|
.\" modification, are permitted provided that the following conditions
|
|
|
|
.\" are met:
|
|
|
|
.\" 1. Redistributions of source code must retain the above copyright
|
|
|
|
.\" notice, this list of conditions and the following disclaimer.
|
|
|
|
.\" 2. Redistributions in binary form must reproduce the above copyright
|
|
|
|
.\" notice, this list of conditions and the following disclaimer in the
|
|
|
|
.\" documentation and/or other materials provided with the distribution.
|
|
|
|
.\"
|
|
|
|
.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND
|
|
|
|
.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
|
|
.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
|
|
|
.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE
|
|
|
|
.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
|
|
.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
|
|
|
.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
|
|
|
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
|
|
|
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
|
|
|
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
|
|
|
.\" SUCH DAMAGE.
|
|
|
|
.\"
|
|
|
|
.\" $FreeBSD$
|
|
|
|
.\"
|
2002-03-20 14:33:37 +00:00
|
|
|
.Dd March 15, 2002
|
2000-11-22 14:04:26 +00:00
|
|
|
.Dt BUILD 7
|
2001-07-10 15:31:11 +00:00
|
|
|
.Os
|
2000-11-22 14:04:26 +00:00
|
|
|
.Sh NAME
|
|
|
|
.Nm build
|
2001-04-18 15:54:10 +00:00
|
|
|
.Nd information on how to build the system
|
2000-11-22 14:04:26 +00:00
|
|
|
.Sh DESCRIPTION
|
|
|
|
The source for the
|
2000-12-14 12:40:48 +00:00
|
|
|
.Fx
|
2000-11-22 14:04:26 +00:00
|
|
|
system and applications are contained in three different directories,
|
|
|
|
normally
|
|
|
|
.Pa /usr/src ,
|
|
|
|
.Pa /usr/doc ,
|
|
|
|
and
|
|
|
|
.Pa /usr/ports .
|
|
|
|
.Pa /usr/src
|
|
|
|
contains the
|
|
|
|
.Dq "base system"
|
|
|
|
sources, which is loosely defined as the things required to rebuild
|
|
|
|
the system to a useful state.
|
|
|
|
.Pa /usr/doc
|
|
|
|
contains the source for the system documentation, excluding the manual
|
|
|
|
pages.
|
|
|
|
.Pa /usr/ports
|
|
|
|
is a tree that provides a consistent interface for building and
|
|
|
|
installing third party applications.
|
|
|
|
.Pp
|
|
|
|
The
|
|
|
|
.Xr make 1
|
|
|
|
command is used in each of these directories to build and install the
|
2002-03-20 14:33:37 +00:00
|
|
|
things in that directory.
|
|
|
|
Issuing the
|
|
|
|
.Xr make 1
|
|
|
|
command in any directory or
|
2000-11-22 14:04:26 +00:00
|
|
|
subdirectory of those directories has the same effect as issuing the
|
2002-03-20 14:33:37 +00:00
|
|
|
same command in all subdirectories of that directory.
|
|
|
|
With no target specified, the things in that directory are just built.
|
|
|
|
The following
|
2000-11-22 14:04:26 +00:00
|
|
|
list provides the names and actions for other targets:
|
2002-03-20 14:33:37 +00:00
|
|
|
.Bl -tag -width indent-two
|
|
|
|
.It Cm clean
|
2000-11-22 14:04:26 +00:00
|
|
|
Removes any files created during the build process.
|
2002-03-20 14:33:37 +00:00
|
|
|
.It Cm install
|
2000-11-22 14:04:26 +00:00
|
|
|
Installs the results of the build for this directory.
|
2002-03-20 14:33:37 +00:00
|
|
|
.It Cm update
|
2000-11-22 14:04:26 +00:00
|
|
|
Gets updated sources as configured in
|
|
|
|
.Pa /etc/make.conf .
|
|
|
|
.El
|
|
|
|
.Pp
|
|
|
|
The other
|
|
|
|
.Pa /usr/src
|
|
|
|
make targets are:
|
2002-03-20 14:33:37 +00:00
|
|
|
.Bl -tag -width indent-two
|
|
|
|
.It Cm buildworld
|
2000-11-22 14:04:26 +00:00
|
|
|
Rebuild everything but the kernel, configure files in
|
|
|
|
.Pa /etc ,
|
|
|
|
and release.
|
2002-03-20 14:33:37 +00:00
|
|
|
.It Cm installworld
|
2000-11-22 14:04:26 +00:00
|
|
|
Install everything built by
|
2002-03-20 14:33:37 +00:00
|
|
|
.Cm buildworld .
|
|
|
|
.It Cm world
|
|
|
|
.Cm buildworld
|
|
|
|
+
|
|
|
|
.Cm installworld .
|
|
|
|
.It Cm buildkernel
|
|
|
|
Rebuild the kernel and the kernel modules.
|
|
|
|
.It Cm installkernel
|
|
|
|
Install the kernel and the kernel modules.
|
|
|
|
.It Cm reinstallkernel
|
|
|
|
Reinstall the kernel and the kernel modules.
|
|
|
|
.It Cm upgrade
|
|
|
|
Upgrade
|
|
|
|
.Xr a.out 5
|
|
|
|
(2.2.x/3.0) system to the new
|
|
|
|
.Xr elf 5
|
|
|
|
way.
|
|
|
|
.It Cm most
|
2000-11-22 14:04:26 +00:00
|
|
|
Build user commands, no libraries or include files.
|
2002-03-20 14:33:37 +00:00
|
|
|
.It Cm installmost
|
2000-11-22 14:04:26 +00:00
|
|
|
Install user commands, no libraries or include files.
|
2002-03-20 14:33:37 +00:00
|
|
|
.It Cm aout-to-elf
|
|
|
|
Upgrade a system from
|
|
|
|
.Xr a.out 5
|
|
|
|
to
|
|
|
|
.Xr elf 5
|
|
|
|
format.
|
|
|
|
.It Cm aout-to-elf-build
|
|
|
|
Build everything required to upgrade a system from
|
|
|
|
.Xr a.out 5
|
|
|
|
to
|
|
|
|
.Xr elf 5
|
|
|
|
format.
|
|
|
|
.It Cm aout-to-elf-install
|
|
|
|
Install everything built by
|
|
|
|
.Cm aout-to-elf-build .
|
|
|
|
.It Cm move-aout-libs
|
|
|
|
Move the
|
|
|
|
.Xr a.out 5
|
|
|
|
libraries into an
|
|
|
|
.Pa aout
|
|
|
|
subdirectory of each
|
|
|
|
.Xr elf 5
|
|
|
|
library subdirectory.
|
2000-11-22 14:04:26 +00:00
|
|
|
.El
|
|
|
|
.Pp
|
|
|
|
For more information about the ports build process, see
|
|
|
|
.Xr ports 7 .
|
2002-03-14 09:38:24 +00:00
|
|
|
.Sh ENVIRONMENT
|
2002-03-15 23:34:17 +00:00
|
|
|
.Bl -tag -width ".Va TARGET_ARCH"
|
|
|
|
.It Va TARGET_ARCH
|
2002-03-15 23:29:24 +00:00
|
|
|
The target machine processor architecture.
|
2002-03-17 15:01:28 +00:00
|
|
|
This is analogous to the
|
2002-03-20 14:33:37 +00:00
|
|
|
.Dq Nm uname Fl p
|
2002-03-15 23:29:24 +00:00
|
|
|
output.
|
2002-03-14 09:38:24 +00:00
|
|
|
Set this to cross-build for a different architecture.
|
2002-03-15 23:34:17 +00:00
|
|
|
.It Va TARGET
|
2002-03-15 23:29:24 +00:00
|
|
|
The target hardware platform.
|
2002-03-17 15:01:28 +00:00
|
|
|
This is analogous to the
|
2002-03-20 14:33:37 +00:00
|
|
|
.Dq Nm uname Fl m
|
2002-03-15 23:29:24 +00:00
|
|
|
output.
|
|
|
|
This is necessary to cross-build some target architectures.
|
|
|
|
For example, cross-building for PC98 machines requires
|
2002-03-20 14:33:37 +00:00
|
|
|
.Va TARGET_ARCH Ns = Ns Li i386
|
2002-03-15 23:29:24 +00:00
|
|
|
and
|
2002-03-20 14:33:37 +00:00
|
|
|
.Va TARGET Ns = Ns Li pc98 .
|
2002-03-15 23:34:17 +00:00
|
|
|
.It Va NO_WERROR
|
2002-03-14 09:38:24 +00:00
|
|
|
If defined, warnings will not cause the build to halt, even if the
|
|
|
|
makefile says otherwise.
|
2002-03-15 23:34:17 +00:00
|
|
|
.It Va DESTDIR
|
2002-03-15 23:29:24 +00:00
|
|
|
The directory hierarchy where the resulting binaries will be
|
|
|
|
installed.
|
2002-03-14 09:38:24 +00:00
|
|
|
.El
|
2000-11-22 14:04:26 +00:00
|
|
|
.Sh FILES
|
2001-09-04 10:08:19 +00:00
|
|
|
.Bl -tag -width ".Pa /usr/share/examples/etc/make.conf" -compact
|
2000-11-22 14:04:26 +00:00
|
|
|
.It Pa /etc/make.conf
|
|
|
|
.It Pa /usr/doc/Makefile
|
|
|
|
.It Pa /usr/doc/share/mk/doc.project.mk
|
|
|
|
.It Pa /usr/ports/Mk/bsd.port.mk
|
|
|
|
.It Pa /usr/ports/Mk/bsd.sites.mk
|
2002-03-20 14:33:37 +00:00
|
|
|
.It Pa /usr/share/examples/etc/make.conf
|
2001-09-04 10:08:19 +00:00
|
|
|
.It Pa /usr/src/Makefile
|
|
|
|
.It Pa /usr/src/Makefile.inc1
|
2000-12-29 09:18:45 +00:00
|
|
|
.El
|
2000-11-23 14:00:26 +00:00
|
|
|
.Sh EXAMPLES
|
|
|
|
The
|
|
|
|
.Dq approved
|
|
|
|
method of updating your system from the latest sources is:
|
|
|
|
.Bd -literal -offset indent
|
|
|
|
make buildworld
|
2001-05-17 23:23:25 +00:00
|
|
|
make buildkernel KERNCONF=FOO
|
|
|
|
make installkernel KERNCONF=FOO
|
2000-11-23 14:00:26 +00:00
|
|
|
make installworld
|
2000-11-24 10:22:08 +00:00
|
|
|
mergemaster
|
2000-11-23 14:00:26 +00:00
|
|
|
.Ed
|
|
|
|
.Pp
|
2002-03-20 14:33:37 +00:00
|
|
|
.Dq Li FOO
|
2000-11-23 14:00:26 +00:00
|
|
|
must be replaced with the name of the kernel configuration file from which
|
|
|
|
the kernel should be built.
|
|
|
|
Alternatively, the
|
2001-05-17 23:23:25 +00:00
|
|
|
.Va KERNCONF
|
2000-11-23 14:00:26 +00:00
|
|
|
variable in
|
|
|
|
.Pa /etc/make.conf
|
|
|
|
can be set to the name of the kernel to build;
|
|
|
|
in this case the
|
2002-03-20 14:33:37 +00:00
|
|
|
.Va KERNCONF Ns = Ns Li FOO
|
2000-11-23 14:00:26 +00:00
|
|
|
part of the
|
2002-03-20 14:33:37 +00:00
|
|
|
.Cm buildkernel
|
2000-11-23 14:00:26 +00:00
|
|
|
and
|
2002-03-20 14:33:37 +00:00
|
|
|
.Cm installkernel
|
2000-11-23 14:00:26 +00:00
|
|
|
commands can be omitted.
|
|
|
|
.Pp
|
|
|
|
After running these commands a system reboot is required,
|
|
|
|
otherwise many programs which have been rebuilt
|
|
|
|
(such as
|
2002-03-20 14:33:37 +00:00
|
|
|
.Xr ps 1 ,
|
|
|
|
.Xr top 1 ,
|
|
|
|
etc.\&)
|
2000-11-23 14:19:50 +00:00
|
|
|
may not work with the old kernel which is still running.
|
2002-03-14 09:38:24 +00:00
|
|
|
.Pp
|
|
|
|
The following sequence of commands can be used to cross-build the
|
|
|
|
system for the Alpha architecture on an i386 host:
|
|
|
|
.Bd -literal -offset indent
|
|
|
|
cd /usr/src
|
2002-03-15 23:29:24 +00:00
|
|
|
make TARGET_ARCH=alpha buildworld
|
|
|
|
make TARGET_ARCH=alpha DESTDIR=/clients/axp installworld
|
2002-03-14 09:38:24 +00:00
|
|
|
.Ed
|
2000-11-22 14:04:26 +00:00
|
|
|
.Sh SEE ALSO
|
2000-11-23 14:44:45 +00:00
|
|
|
.Xr cc 1 ,
|
2000-11-22 14:04:26 +00:00
|
|
|
.Xr install 1 ,
|
|
|
|
.Xr make 1 ,
|
|
|
|
.Xr make.conf 5 ,
|
2000-11-23 14:19:50 +00:00
|
|
|
.Xr ports 7 ,
|
2002-03-13 06:59:39 +00:00
|
|
|
.Xr release 7 ,
|
2000-11-24 10:22:08 +00:00
|
|
|
.Xr mergemaster 8 ,
|
2000-11-23 14:19:50 +00:00
|
|
|
.Xr reboot 8 ,
|
|
|
|
.Xr shutdown 8
|
2000-11-22 14:04:26 +00:00
|
|
|
.Sh AUTHORS
|
|
|
|
.An Mike W. Meyer Aq mwm@mired.org .
|