BUILD(7) BSD Miscellaneous Information Manual BUILD(7)NAMEbuild — information on how to build the system
DESCRIPTION
The source for the DragonFly system and applications is located in
/usr/src. This directory contains the “base system” sources, which is
loosely defined as the things required to rebuild the system to a useful
state. It also contains the source for the system documentation, includ‐
ing manual pages. Refer to development(7) for more information on how to
obtain the DragonFly sources.
Third party applications have to be built using the pkgsrc(7) system.
The file /usr/src/UPDATING gives specifics on how to obtain the tree for
building packages.
The make(1) command is used in /usr/src to build and install the things
in that directory. Issuing the make(1) command in any directory or sub‐
directory of those directories has the same effect as issuing the same
command in all subdirectories of that directory. With no target speci‐
fied, 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.
The other /usr/src make targets are:
buildworld Rebuild everything but the kernel.
quickworld Same as buildworld, but skip bootstrap, build and cross-
build tool steps. This target can be used for incremen‐
tal upgrades once a full build of the world has been
done with buildworld.
realquickworld Same as quickworld, but also skip the depend step.
crossworld Just do the bootstrap, build and cross-build steps.
installworld Install everything built by buildworld.
world buildworld + installworld.
buildkernel Rebuild the kernel and the kernel-modules.
nativekernel Rebuild the kernel and the kernel-modules using native
tools.
quickkernel Same as buildkernel, but skip the depend step and do not
clean out the obj modules. This target can be used for
incremental upgrades once a full build of the kernel has
been done with buildkernel.
installkernel Install the kernel and the kernel-modules.
reinstallkernel Reinstall the kernel and the kernel-modules.
kernel buildkernel + installkernel.
preupgrade Perform certain upgrades that have to be done before
installworld. installworld will complain if they have
not been done.
upgrade Upgrade the files in /etc and also setup the rest of the
system for the version of DragonFly just installed.
most Build user commands, no libraries or include files.
installmost Install user commands, no libraries or include files.
ENVIRONMENT
TARGET_ARCH, TARGET_PLATFORM
The target machine processor architecture and hardware
platform. These have to be set for cross-building.
TARGET_ARCH is analogous to the “uname -p” output. To
build for the 32 bit Intel architecture known as IA-32,
x86 or x86-32, use:
TARGET_ARCH=i386
TARGET_PLATFORM=pc32
For the 64 bit AMD architecture known as AMD64, x86-64
or Intel 64, use:
TARGET_ARCH=x86_64
TARGET_PLATFORM=pc64
DESTDIR An existing directory to be the root of the hierarchy
where the resulting binaries will be installed (the
default is /).
MAKEOBJDIRPREFIX The directory hierarchy where the object files will be
built (the default is /usr/obj).
__MAKE_CONF Used to override the path of make.conf(5) (the default
is /etc/make.conf).
KERNCONF The name of the kernel configuration file from which
the kernel should be built (the default is GENERIC).
KERNCONFDIR The directory where the kernel configuration files are
kept (the default is /usr/src/sys/config).
DESTLABEL Common suffix added to kernel and modules directory
names, prefixed by a single dot. For example,
make DESTLABEL=test installkernel
installs them as /boot/kernel.test and
/boot/modules.test, respectively.
DESTKERNDIR Where to install the kernel and the modules (the
default is /boot), in the directory hierarchy specified
by the environment variable DESTDIR.
DESTKERNNAME The name of the installed kernel file (the default is
kernel), under the directory specified by DESTKERNDIR.
This overrides the effect of DESTLABEL.
DESTMODULESNAME The name of the directory to install the kernel modules
(the default is modules), under the directory specified
by DESTKERNDIR. This overrides the effect of
DESTLABEL.
FILES
/etc/make.conf
/etc/defaults/make.conf
/usr/src/share/doc/Makefile
/usr/src/Makefile
/usr/src/Makefile.inc1
/usr/src/Makefile_upgrade.inc
EXAMPLES
The “approved” method of updating your system from the latest sources is:
make buildworld
make buildkernel KERNCONF=FOO
make installkernel KERNCONF=FOO
make installworld
make upgrade
After running these commands a system reboot is required, otherwise many
programs which have been rebuilt (such as ps(1), top(1), etc.) may not
work with the old kernel which is still running.
CAVEATS
The build and install order in the EXAMPLES section enforces that the new
kernel is installed before the new world. Sometimes it might be neces‐
sary to reboot the system between those two steps. In this case “make
installworld” will tell you to do so.
SEE ALSOcc(1), install(1), make(1), wmake(1), make.conf(5), development(7),
pkgsrc(7), release(7), config(8), reboot(8), shutdown(8)AUTHORS
Mike W. Meyer ⟨mwm@mired.org⟩ and Sascha Wildner ⟨swildner@gmail.com⟩.
BSD April 12, 2009 BSD