build.7 revision 142360
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: head/share/man/man7/build.7 142360 2005-02-24 03:46:36Z trhodes $

.Dd February 23, 2005 .Dt BUILD 7 .Os .Sh NAME .Nm build .Nd information on how to build the system .Sh DESCRIPTION The source for the .Fx system and applications are contained in three different directories, normally

a /usr/src ,

a /usr/doc , and

a /usr/ports .

a /usr/src contains the .Dq "base system" sources, which is loosely defined as the things required to rebuild the system to a useful state.

a /usr/doc contains the source for the system documentation, excluding the manual pages.

a /usr/ports is a tree that provides a consistent interface for building and installing third party applications.

p The .Xr make 1 command is used in each of these directories to build and install the things in that directory. Issuing the .Xr make 1 command in any directory or subdirectory of those directories has the same effect as issuing the same command in all subdirectories of that directory. With no target specified, the things in that directory are just built. The following list provides the names and actions for other targets: l -tag -width indent-two t Cm clean Removes any files created during the build process. t Cm install Installs the results of the build for this directory. t Cm update Gets updated sources as configured in

a /etc/make.conf . .El

p The other

a /usr/src make targets are: l -tag -width indent-two t Cm buildworld Rebuild everything but the kernel, configure files in

a /etc , and release. t Cm installworld Install everything built by .Cm buildworld . t Cm buildkernel Rebuild the kernel and the kernel modules. t Cm installkernel Install the kernel and the kernel modules. t Cm reinstallkernel Reinstall the kernel and the kernel modules. t Cm kernel Equivalent to .Cm buildkernel followed by .Cm installkernel .El

p For more information about the ports build process, see .Xr ports 7 . .Sh ENVIRONMENT l -tag -width ".Va TARGET_ARCH" t Va TARGET_ARCH The target machine processor architecture. This is analogous to the .Dq Nm uname Fl p output. Set this to cross-build for a different architecture. t Va TARGET The target hardware platform. This is analogous to the .Dq Nm uname Fl m output. This is necessary to cross-build some target architectures. For example, cross-building for PC98 machines requires .Va TARGET_ARCH Ns = Ns Li i386 and .Va TARGET Ns = Ns Li pc98 . t Va NO_WERROR If defined, warnings will not cause the build to halt, even if the makefile says otherwise. t Va DESTDIR The directory hierarchy where the resulting binaries will be installed. .El .Sh FILES l -tag -width ".Pa /usr/share/examples/etc/make.conf" -compact t Pa /etc/make.conf t Pa /usr/doc/Makefile t Pa /usr/doc/share/mk/doc.project.mk t Pa /usr/ports/Mk/bsd.port.mk t Pa /usr/ports/Mk/bsd.sites.mk t Pa /usr/share/examples/etc/make.conf t Pa /usr/src/Makefile t Pa /usr/src/Makefile.inc1 .El .Sh EXAMPLES For an .Dq approved method of updating your system from the latest sources, please see the .Sx COMMON ITEMS section in

a src/UPDATING .

p The following sequence of commands can be used to cross-build the system for the Alpha architecture on an i386 host: d -literal -offset indent cd /usr/src make TARGET_ARCH=alpha buildworld make TARGET_ARCH=alpha DESTDIR=/clients/axp installworld .Ed .Sh SEE ALSO .Xr cc 1 , .Xr config 8 , .Xr install 1 , .Xr make 1 , .Xr make.conf 5 , .Xr ports 7 , .Xr release 7 , .Xr mergemaster 8 , .Xr reboot 8 , .Xr shutdown 8 .Sh AUTHORS .An Mike W. Meyer Aq mwm@mired.org .