.\"
.\" Copyright (c) 2007-2009 Hypertriton, Inc.
.\" All rights reserved.
.\"
.\" 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 DEVELOPERS ``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 DEVELOPERS 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.
.\"
.Dd July 18, 2007
.Dt BUILD.COMMON.MK 5
.Os
.ds vT BSDBuild Reference
.ds oS BSDBuild 1.0
.Sh NAME
.Nm build.common.mk
.Nd bsdbuild - common defines
.Sh SYNOPSIS
.Fd .include
.Sh DESCRIPTION
.Nm
defines common variables that are used by the different BSDBuild modules.
They can be referenced from Makefiles, but they are almost always treated
read-only and overrided by a
.Pa Makefile.config
generated by a configure script
(see
.Xr mkconfigure 1
for details).
.Sh TARGETS
.Pp
This module defines no target.
.Sh VARIABLES
.Bl -tag -width "DEINSTALL_PROG_DIR "
.It Ev PREFIX
Base target installation directory.
Defaults to
.Sq /usr/local .
.It Ev DESTDIR
Optional prefix for all installation directories.
This variable is typically passed as an argument to a
.Sq make install
command.
Defaults to an empty string.
.It Ev STATEDIR
Installation directory for writeable machine-wide data files.
Defaults to
.Sq PREFIX/var .
.It Ev SYSCONFDIR
System-wide configuration directory.
Defaults to
.Sq PREFIX/etc .
.It Ev DATADIR
Installation directory for read-only machine-wide data files.
.It Ev BINDIR
Installation directory for executables.
Defaults to
.Sq PREFIX/bin .
.It Ev LIBDIR
Installation directory for library files.
Defaults to
.Sq PREFIX/lib .
.It Ev MODULEDIR
Installation directory for dynamically-loaded modules.
Defaults to
.Sq PREFIX/lib
(but this default is almost always overridden by the application's
configure script).
.It Ev INCLDIR
Installation directory for library header files.
Defaults to
.Sq PREFIX/include .
.It Ev MANDIR
Installation directory for manual pages.
Defaults to
.Sq PREFIX/man .
.It Ev SUDO
Optional path to
.Xr sudo 8 .
If set, all modules will use it for privileged commands.
.It Ev SH
Path to the Bourne shell.
Defaults to
.Sq sh .
.It Ev FIND
Path to the
.Sq find 1
command.
Not used by BSDBuild itself, but useful for maintainer scripts and such.
.It Ev AWK
Path to
.Sq awk
interpreter.
Not used by BSDBuild itself, but useful for maintainer scripts and such.
.It Ev INSTALL_PROG
Command to execute for installing an executable file.
Defaults to
.Sq install -c -m 755 .
.It Ev INSTALL_LIB
Command to execute for installing a library file.
Defaults to
.Sq install -c -m 644 .
.It Ev INSTALL_DATA
Command to execute for installing a data file.
Defaults to
.Sq install -c -m 644 .
.It Ev INSTALL_INCL
Command to execute for installing a library header file.
Defaults to
.Sq install -c -m 644 .
.It Ev DEINSTALL_PROG
Command to execute for uninstalling an executable.
.It Ev DEINSTALL_LIB
Command to execute for uninstalling a library.
.It Ev DEINSTALL_DATA
Command to execute for uninstalling a data file.
.It Ev DEINSTALL_INCL
Command to execute for uninstalling a library header file.
.El
.Sh SEE ALSO
.Xr build.prog.mk 5 ,
.Xr build.lib.mk 5
.Sh HISTORY
.Nm
first appeared in BSDBuild 1.0.
.Pp
BSDBuild is based on the 4.4BSD build system.