BUILD(7) MidnightBSD Miscellaneous Information Manual BUILD(7)

NAME

build — information on how to build the system

DESCRIPTION

The source for the FreeBSD system and applications are contained in three different directories, normally /usr/src, /usr/doc, and /usr/mports. /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/mports 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:

clean

Removes any files created during the build process.

install

Installs the results of the build for this directory.

update

Gets updated sources as configured in make.conf(5).

The other /usr/src make targets are:

buildworld

Rebuild everything but the kernel, configure files in /etc, and release.

installworld

Install everything built by buildworld.

buildkernel

Rebuild the kernel and the kernel modules.

installkernel

Install the kernel and the kernel modules.

reinstallkernel.

Reinstall the kernel and the kernel modules.

kernel

Equivalent to buildkernel followed by installkernel

Convenience targets for cleaning up the install destination directory denoted by variable DESTDIR include:

check-old

Print a list of old files and directores in the system.

delete-old

Delete obsolete base system files and directories interactively. When -DBATCH_DELETE_OLD_FILES is specified at the command line, the delete operation will be non-interactive. The variables DESTDIR, TARGET_ARCH and TARGET should be set as with ‘‘make installworld’’.

delete-old-libs

Delete obsolete base system libraries interactively. This target should only be used if no 3rd party software uses these libraries. When -DBATCH_DELETE_OLD_FILES is specified at the command line, the delete operation will be non-interactive. The variables DESTDIR, TARGET_ARCH and TARGET should be set as with ‘‘make installworld’’.

For more information about the mports build process, see ports(7).

ENVIRONMENT
TARGET_ARCH

The target machine processor architecture. This is analogous to the ‘‘uname −p’’ output. Set this to cross-build for a different architecture.

TARGET

The target hardware platform. This is analogous to the ‘‘uname −m’’ output. This is necessary to cross-build some target architectures.

NO_WERROR

If defined, warnings will not cause the build to halt, even if the makefile says otherwise.

DESTDIR

The directory hierarchy where the resulting binaries will be installed.

FILES
/usr/doc/Makefile
/usr/doc/share/mk/doc.project.mk
/usr/mports/Mk/bsd.port.mk
/usr/mports/Mk/bsd.sites.mk
/usr/share/examples/etc/make.conf
/usr/src/Makefile
/usr/src/Makefile.inc1
EXAMPLES

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 Sparc64 architecture on an i386 host:

cd /usr/src
make TARGET_ARCH=sparc64 buildworld
make TARGET_ARCH=sparc64 DESTDIR=/clients/axp installworld

SEE ALSO

cc(1), install(1), make(1), make.conf(5), ports(7), release(7), config(8), mergemaster(8), reboot(8), shutdown(8)

AUTHORS

Mike W. Meyer 〈mwm@mired.org〉.

MidnightBSD 0.3 April 28, 2008 MidnightBSD 0.3