build — information on how to build the system
The source for the FreeBSD system and applications are contained in three different directories, normally /usr/src, /usr/doc, and /usr/ports. /usr/src contains the ’’base system’’ sources, which is loosely defined as the things required to rebuild the system to a useful state. /usr/doc contains the source for the system documentation, excluding the manual pages. /usr/ports is a tree that provides a consistent interface for building and installing third party applications.
The make(1) command is used in each of these directories to build and install the things in that directory. Issuing the 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:
Removes any files created during the build process.
Installs the results of the build for this directory.
Gets updated sources as configured in /etc/make.conf.
The other /usr/src make targets are:
Rebuild everything but the kernel, configure files in /etc, and release.
Install everything built by buildworld.
Rebuild the kernel and the kernel modules.
Install the kernel and the kernel modules.
Reinstall the kernel and the kernel modules.
For more information about the ports build process, see ports(7).
The target machine processor architecture. This is analogous to the ’’uname −p’’ output. Set this to cross-build for a different architecture.
The target hardware platform. This is analogous to the ’’uname −m’’ output. This is necessary to cross-build some target architectures. For example, cross-building for PC98 machines requires TARGET_ARCH=i386 and TARGET=pc98.
If defined, warnings will not cause the build to halt, even if the makefile says otherwise.
The directory hierarchy where the resulting binaries will be installed.
For an ’’approved’’ method of updating your system from the latest sources, please see the COMMON ITEMS section in src/UPDATING.
The following sequence of commands can be used to cross-build the system for the Alpha architecture on an i386 host:
make TARGET_ARCH=alpha buildworld
make TARGET_ARCH=alpha DESTDIR=/clients/axp installworld
Mike W. Meyer <mwm [AT] mired.org>.
BSD August 13, 2004 BSD