2015-07-23 11:03:24 +03:00
|
|
|
.\" $NetBSD: BUILDING.mdoc,v 1.114 2015/07/23 08:03:25 mrg Exp $
|
2001-10-29 22:46:47 +03:00
|
|
|
.\"
|
2011-09-09 17:29:23 +04:00
|
|
|
.\" Copyright (c) 2001-2011 The NetBSD Foundation, Inc.
|
2001-10-29 22:46:47 +03:00
|
|
|
.\" All rights reserved.
|
|
|
|
.\"
|
|
|
|
.\" This code is derived from software contributed to The NetBSD Foundation
|
2003-01-23 19:24:08 +03:00
|
|
|
.\" by Todd Vierling and Luke Mewburn.
|
2001-10-29 22:46:47 +03:00
|
|
|
.\"
|
|
|
|
.\" 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 NETBSD FOUNDATION, INC. AND CONTRIBUTORS
|
|
|
|
.\" ``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 FOUNDATION OR CONTRIBUTORS
|
|
|
|
.\" 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.
|
|
|
|
.\"
|
2011-09-09 18:23:37 +04:00
|
|
|
.\" NOTE: After changing this file, run "make regen" in the src/doc
|
|
|
|
.\" directory, and check in both src/BUILDING and src/doc/BUILDING.mdoc.
|
2001-10-29 23:02:01 +03:00
|
|
|
.\"
|
2003-01-30 01:50:08 +03:00
|
|
|
.\" Toolchain prefix for commands
|
|
|
|
.ds toolprefix nb
|
|
|
|
.
|
2015-04-08 08:47:43 +03:00
|
|
|
.Dd April 7, 2015
|
2001-10-29 22:46:47 +03:00
|
|
|
.Dt BUILDING 8
|
|
|
|
.Os NetBSD
|
|
|
|
.
|
|
|
|
.Sh NAME
|
|
|
|
.
|
|
|
|
.Nm BUILDING
|
|
|
|
.Nd Procedure for building
|
|
|
|
.Nx
|
|
|
|
from source code.
|
|
|
|
.
|
|
|
|
.Sh REQUIREMENTS
|
|
|
|
.
|
|
|
|
.Nx
|
2001-10-30 19:22:40 +03:00
|
|
|
is designed to be buildable on most POSIX-compliant host systems.
|
2001-10-29 22:46:47 +03:00
|
|
|
The basic build procedure is the same whether compiling
|
|
|
|
.Em natively
|
|
|
|
(on the same
|
|
|
|
.Nx
|
|
|
|
architecture) or
|
|
|
|
.Em cross compiling
|
|
|
|
(on another architecture or OS).
|
|
|
|
.Pp
|
|
|
|
This source tree contains a special subtree,
|
|
|
|
.Dq tools ,
|
|
|
|
which uses the host system to create a build toolchain for the target
|
2002-12-18 22:46:48 +03:00
|
|
|
architecture.
|
|
|
|
The host system must have at least C and C++
|
2001-10-29 22:46:47 +03:00
|
|
|
compilers in order to create the toolchain
|
|
|
|
.Nm ( make
|
|
|
|
is not required); all other tools are created as part of the
|
|
|
|
.Nx
|
|
|
|
build process.
|
2005-02-15 21:41:18 +03:00
|
|
|
(See the environment variables section below if you need
|
|
|
|
to override or manually select your compilers.)
|
2001-10-29 22:46:47 +03:00
|
|
|
.
|
|
|
|
.Sh FILES
|
|
|
|
.
|
|
|
|
.Ss Source tree layout
|
|
|
|
.
|
|
|
|
.Bl -tag -width "BUILDING.mdoc"
|
2014-05-21 17:11:25 +04:00
|
|
|
.It Pa doc/BUILDING.mdoc
|
2001-10-29 23:02:01 +03:00
|
|
|
This document (in -mdoc troff format; the original copy).
|
2014-05-21 17:11:25 +04:00
|
|
|
.It Pa BUILDING
|
2001-10-29 23:02:01 +03:00
|
|
|
This document (in plaintext).
|
2014-05-21 17:11:25 +04:00
|
|
|
.It Pa tools/compat/README
|
2003-12-29 10:10:24 +03:00
|
|
|
Special notes for cross-hosting a NetBSD build on non-NetBSD platforms.
|
2014-05-21 17:11:25 +04:00
|
|
|
.It Pa Makefile
|
2001-10-29 22:46:47 +03:00
|
|
|
The main Makefile for
|
|
|
|
.Nx ;
|
2001-10-30 19:22:40 +03:00
|
|
|
should only be run for native builds with an appropriately up-to-date
|
2001-10-29 22:46:47 +03:00
|
|
|
version of
|
|
|
|
.Nx
|
|
|
|
.Xr make 1 .
|
|
|
|
(For building from out-of-date systems or on a non-native host, see the
|
|
|
|
.Nm build.sh
|
|
|
|
shell script.)
|
2014-05-21 17:11:25 +04:00
|
|
|
.It Pa UPDATING
|
2001-10-29 22:46:47 +03:00
|
|
|
Special notes for updating from an earlier revision of
|
|
|
|
.Nx .
|
|
|
|
It is important to read this file before every build of an updated
|
|
|
|
source tree.
|
2014-05-21 17:11:25 +04:00
|
|
|
.It Pa build.sh
|
2001-10-29 22:46:47 +03:00
|
|
|
Bourne-compatible shell script used for building the host build tools
|
|
|
|
and the
|
|
|
|
.Nx
|
2002-12-18 22:46:48 +03:00
|
|
|
system from scratch.
|
|
|
|
Can be used for both native and cross builds, and should be used instead of
|
2001-10-29 22:46:47 +03:00
|
|
|
.Xr make 1
|
|
|
|
for any source tree that is updated and recompiled regularly.
|
2014-05-21 17:11:25 +04:00
|
|
|
.It Pa crypto/dist/ , dist/ , gnu/dist/
|
2001-10-29 22:46:47 +03:00
|
|
|
Sources imported verbatim from third parties, without mangling the
|
2002-12-18 22:46:48 +03:00
|
|
|
existing build structure.
|
|
|
|
Other source trees in
|
2001-10-29 22:46:47 +03:00
|
|
|
.Sy bin
|
|
|
|
through
|
|
|
|
.Sy usr.sbin
|
|
|
|
use the
|
|
|
|
.Nx
|
|
|
|
.Xr make 1
|
|
|
|
.Dq reachover
|
|
|
|
Makefile semantics when building these programs for a native host.
|
2014-05-21 17:11:25 +04:00
|
|
|
.It Pa external , sys/external
|
2014-05-19 13:49:07 +04:00
|
|
|
Sources and build infrastructure for components imported (mostly) unchanged
|
|
|
|
from upstream maintainers, sorted by applicable license.
|
2014-05-21 17:11:25 +04:00
|
|
|
This is (slowly) replacing the
|
|
|
|
.Pa crypto/dist ,
|
|
|
|
.Pa dist ,
|
|
|
|
and
|
|
|
|
.Pa gnu/dist
|
|
|
|
directories.
|
|
|
|
.It Pa distrib/ , etc/
|
2001-10-29 22:46:47 +03:00
|
|
|
Sources for items used when making a full release snapshot, such as
|
|
|
|
files installed in
|
2003-01-30 05:52:40 +03:00
|
|
|
.Sy DESTDIR Ns Pa /etc
|
2001-10-29 22:46:47 +03:00
|
|
|
on the destination system, boot media, and release notes.
|
2014-05-21 17:11:25 +04:00
|
|
|
.It Pa tests/ , regress/
|
2002-12-18 22:46:48 +03:00
|
|
|
Regression test harness.
|
|
|
|
Can be cross-compiled, but only run natively.
|
2008-03-28 08:23:44 +03:00
|
|
|
.Pa tests/
|
|
|
|
uses the
|
|
|
|
.Xr atf 7
|
|
|
|
test framework;
|
|
|
|
.Pa regress/
|
|
|
|
contains older tests that have not yet been migrated to
|
|
|
|
.Xr atf 7 .
|
2014-05-21 17:11:25 +04:00
|
|
|
.It Pa sys/
|
2001-10-29 22:46:47 +03:00
|
|
|
.Nx
|
|
|
|
kernel sources.
|
2014-05-21 17:11:25 +04:00
|
|
|
.It Pa tools/
|
2001-10-29 22:46:47 +03:00
|
|
|
.Dq Reachover
|
2002-12-18 22:46:48 +03:00
|
|
|
build structure for the host build tools.
|
|
|
|
This has a special method of determining out-of-date status.
|
2014-05-21 17:11:25 +04:00
|
|
|
.It Pa bin/ ... usr.sbin/
|
2001-10-29 22:46:47 +03:00
|
|
|
Sources to the
|
|
|
|
.Nx
|
2002-12-18 22:46:48 +03:00
|
|
|
userland (non-kernel) programs.
|
|
|
|
If any of these directories are missing, they will be skipped during the build.
|
2015-07-23 11:03:24 +03:00
|
|
|
.It Pa external/mit/xorg/
|
2004-02-07 02:22:44 +03:00
|
|
|
.Dq Reachover
|
2015-07-23 11:03:24 +03:00
|
|
|
build structure for modular Xorg; the source is in
|
2004-02-07 02:22:44 +03:00
|
|
|
.Sy X11SRCDIR .
|
2014-11-13 11:25:31 +03:00
|
|
|
.It Pa extsrc/
|
|
|
|
.Dq Reachover
|
|
|
|
build structure for externally added programs and libraries;
|
|
|
|
the source is in
|
|
|
|
.Sy EXTSRCSRCDIR .
|
2001-10-29 22:46:47 +03:00
|
|
|
.El
|
|
|
|
.
|
|
|
|
.Ss Build tree layout
|
|
|
|
.
|
|
|
|
The
|
|
|
|
.Nx
|
|
|
|
build tree is described in
|
|
|
|
.Xr hier 7 ,
|
|
|
|
and the release layout is described in
|
|
|
|
.Xr release 7 .
|
|
|
|
.
|
|
|
|
.Sh CONFIGURATION
|
|
|
|
.
|
2002-03-05 04:15:51 +03:00
|
|
|
.Ss Environment variables
|
2013-05-29 18:45:55 +04:00
|
|
|
.
|
2002-03-05 04:15:51 +03:00
|
|
|
Several environment variables control the behaviour of
|
|
|
|
.Nx
|
|
|
|
builds.
|
|
|
|
.
|
|
|
|
.Bl -tag -width "MAKEOBJDIRPREFIX"
|
|
|
|
.
|
2005-02-15 21:41:18 +03:00
|
|
|
.
|
2006-09-29 23:57:04 +04:00
|
|
|
.It Sy HOST_SH
|
2011-09-09 22:48:34 +04:00
|
|
|
Path name to a shell available on the host system
|
|
|
|
and suitable for use during the build.
|
|
|
|
The
|
|
|
|
.Nx
|
|
|
|
build system requires a modern Bourne-like shell
|
|
|
|
with POSIX-compliant features,
|
|
|
|
and also requires support for the
|
|
|
|
.Dq local
|
|
|
|
keyword to declare local variables in shell functions
|
|
|
|
(which is a widely-implemented but non-standardised feature).
|
|
|
|
.Pp
|
|
|
|
Depending on the host system, a suitable shell may be
|
|
|
|
.Pa /bin/sh ,
|
|
|
|
.Pa /usr/xpg4/bin/sh ,
|
|
|
|
.Pa /bin/ksh
|
|
|
|
(provided it is a variant of ksh that supports the
|
|
|
|
.Dq local
|
|
|
|
keyword,
|
|
|
|
such as ksh88, but not ksh93),
|
|
|
|
or
|
|
|
|
.Pa /usr/local/bin/bash .
|
|
|
|
.Pp
|
|
|
|
Most parts of the build require
|
|
|
|
.Sy HOST_SH
|
|
|
|
to be an absolute path; however,
|
2006-09-29 23:57:04 +04:00
|
|
|
.Nm build.sh
|
2011-09-09 22:48:34 +04:00
|
|
|
allows it to be a simple command name, which will be converted
|
|
|
|
to an absolute path by searching the
|
2006-09-29 23:57:04 +04:00
|
|
|
.Sy PATH .
|
|
|
|
.
|
2005-02-15 21:41:18 +03:00
|
|
|
.It Sy HOST_CC
|
|
|
|
Path name to C compiler used to create the toolchain.
|
|
|
|
.
|
|
|
|
.It Sy HOST_CXX
|
|
|
|
Path name to C++ compiler used to create the toolchain.
|
|
|
|
.
|
2002-03-05 04:15:51 +03:00
|
|
|
.It Sy MACHINE
|
2008-03-28 08:23:44 +03:00
|
|
|
Machine type, e.g.,
|
|
|
|
.Dq macppc .
|
2002-03-05 04:15:51 +03:00
|
|
|
.
|
|
|
|
.It Sy MACHINE_ARCH
|
2008-03-28 08:23:44 +03:00
|
|
|
Machine architecture, e.g.,
|
|
|
|
.Dq powerpc .
|
2002-03-05 04:15:51 +03:00
|
|
|
.
|
|
|
|
.It Sy MAKE
|
|
|
|
Path name to invoke
|
|
|
|
.Xr make 1
|
|
|
|
as.
|
|
|
|
.
|
|
|
|
.It Sy MAKEFLAGS
|
|
|
|
Flags to invoke
|
|
|
|
.Xr make 1
|
|
|
|
with.
|
2011-09-09 17:29:23 +04:00
|
|
|
Note that
|
|
|
|
.Sy build.sh
|
|
|
|
ignores the value of
|
|
|
|
.Sy MAKEFLAGS
|
|
|
|
passed in the environment, but allows
|
|
|
|
.Sy MAKEFLAGS
|
|
|
|
to be set via the
|
|
|
|
.Fl V
|
|
|
|
option.
|
2002-03-05 04:15:51 +03:00
|
|
|
.
|
|
|
|
.It Sy MAKEOBJDIR
|
|
|
|
Directory to use as the
|
|
|
|
.Sy .OBJDIR
|
|
|
|
for the current directory.
|
2006-10-08 21:54:30 +04:00
|
|
|
The value is subjected to variable expansion by
|
|
|
|
.Xr make 1 .
|
2008-08-06 02:40:33 +04:00
|
|
|
Typical usage is to set this variable to a value involving the use of
|
|
|
|
.Sq ${.CURDIR:S...}
|
|
|
|
or
|
|
|
|
.Sq ${.CURDIR:C...} ,
|
|
|
|
to derive the value of
|
|
|
|
.Sy .OBJDIR
|
|
|
|
from the value of
|
|
|
|
.Sy .CURDIR .
|
2002-03-05 04:15:51 +03:00
|
|
|
Used only if
|
|
|
|
.Sy MAKEOBJDIRPREFIX
|
|
|
|
is not defined.
|
|
|
|
.Sy MAKEOBJDIR
|
2008-08-06 02:40:33 +04:00
|
|
|
can be provided only in the environment or via the
|
2003-08-08 05:52:24 +04:00
|
|
|
.Fl O
|
2003-07-03 09:52:47 +04:00
|
|
|
flag of
|
2008-08-06 02:40:33 +04:00
|
|
|
.Nm build.sh ;
|
2008-12-03 01:28:21 +03:00
|
|
|
it cannot usefully be set inside a Makefile, including
|
|
|
|
.Pa mk.conf
|
|
|
|
or
|
|
|
|
.Sy ${MAKECONF} .
|
2002-03-05 04:15:51 +03:00
|
|
|
.
|
|
|
|
.It Sy MAKEOBJDIRPREFIX
|
|
|
|
Top level directory of the object directory tree.
|
2009-09-27 22:08:24 +04:00
|
|
|
The value is subjected to variable expansion by
|
|
|
|
.Xr make 1 .
|
|
|
|
.Sy build.sh
|
|
|
|
will create the
|
|
|
|
${MAKEOBJDIRPREFIX}
|
|
|
|
directory if necessary, but if
|
|
|
|
.Xr make 1
|
|
|
|
is used without
|
|
|
|
.Sy build.sh ,
|
|
|
|
then rules in
|
|
|
|
.Aq bsd.obj.mk
|
|
|
|
will abort the build if the
|
|
|
|
${MAKEOBJDIRPREFIX}
|
|
|
|
directory does not exist.
|
|
|
|
If the value is defined and valid, then
|
2002-03-05 04:15:51 +03:00
|
|
|
${MAKEOBJDIRPREFIX}/${.CURDIR}
|
|
|
|
is used as the
|
|
|
|
.Sy .OBJDIR
|
|
|
|
for the current directory.
|
|
|
|
The current directory may be read only.
|
|
|
|
.Sy MAKEOBJDIRPREFIX
|
2008-08-06 02:40:33 +04:00
|
|
|
can be provided only in the environment or via the
|
2003-07-03 09:52:47 +04:00
|
|
|
.Fl M
|
|
|
|
flag of
|
2008-08-06 02:40:33 +04:00
|
|
|
.Nm build.sh ;
|
2012-09-20 03:08:37 +04:00
|
|
|
it cannot usefully be set inside a Makefile, including
|
2008-12-03 01:28:21 +03:00
|
|
|
.Pa mk.conf
|
|
|
|
or
|
|
|
|
.Sy ${MAKECONF} .
|
2002-03-05 04:15:51 +03:00
|
|
|
.
|
|
|
|
.El
|
|
|
|
.
|
2001-10-30 17:40:24 +03:00
|
|
|
.Ss \*qmake\*q variables
|
2001-10-29 22:46:47 +03:00
|
|
|
.
|
|
|
|
.de YorN
|
|
|
|
Can be set to
|
|
|
|
.Dq yes
|
|
|
|
or
|
|
|
|
.Dq no .
|
|
|
|
..
|
|
|
|
.de DFLT
|
|
|
|
.Pp
|
|
|
|
.Em Default :
|
|
|
|
..
|
|
|
|
.de DFLTu
|
|
|
|
.DFLT
|
|
|
|
Unset.
|
|
|
|
..
|
|
|
|
.de DFLTy
|
|
|
|
.DFLT
|
|
|
|
.Dq yes
|
|
|
|
..
|
|
|
|
.de DFLTn
|
|
|
|
.DFLT
|
|
|
|
.Dq no
|
|
|
|
..
|
|
|
|
Several variables control the behavior of
|
|
|
|
.Nx
|
2002-12-18 22:46:48 +03:00
|
|
|
builds.
|
|
|
|
Unless otherwise specified, these variables may be set in
|
2001-10-29 22:46:47 +03:00
|
|
|
either the process environment or the
|
|
|
|
.Xr make 1
|
|
|
|
configuration file specified by
|
|
|
|
.Sy MAKECONF .
|
|
|
|
.
|
|
|
|
.Bl -tag -width "MKCATPAGES"
|
|
|
|
.
|
2002-03-14 21:33:04 +03:00
|
|
|
.It Sy BUILDID
|
2002-12-18 22:46:48 +03:00
|
|
|
Identifier for the build.
|
2014-06-14 16:20:17 +04:00
|
|
|
If set, this should be a short string that is suitable for use as
|
|
|
|
part of a file or directory name.
|
2002-12-18 22:46:48 +03:00
|
|
|
The identifier will be appended to
|
2002-03-14 21:33:04 +03:00
|
|
|
object directory names, and can be consulted in the
|
|
|
|
.Xr make 1
|
|
|
|
configuration file in order to set additional build parameters,
|
|
|
|
such as compiler flags.
|
2014-06-14 16:20:17 +04:00
|
|
|
It will also be used as part of the kernel version string,
|
|
|
|
which can be printed by
|
|
|
|
.Dq Li uname \-v .
|
|
|
|
.DFLTu
|
2002-03-14 21:33:04 +03:00
|
|
|
.
|
2014-08-03 13:24:08 +04:00
|
|
|
.It Sy BUILDINFO
|
|
|
|
This may be a multi-line string containing information about the build.
|
|
|
|
This will appear in
|
|
|
|
.Sy DESTDIR Ns Pa /etc/release ,
|
|
|
|
and it will be stored in the
|
|
|
|
.Va buildinfo
|
|
|
|
variable in any kernels that are built.
|
|
|
|
When such kernels are booted, the
|
|
|
|
.Xr sysctl 7
|
|
|
|
.Va kern.buildinfo
|
|
|
|
variable will report this value.
|
|
|
|
The string may contain backslash escape sequences, such as
|
|
|
|
.Dq "\e\e"
|
|
|
|
(representing a backslash character)
|
|
|
|
and
|
|
|
|
.Dq "\en"
|
|
|
|
(representing a newline).
|
|
|
|
.DFLTu
|
|
|
|
.
|
2008-08-05 23:43:33 +04:00
|
|
|
.It Sy BUILDSEED
|
|
|
|
GCC uses random numbers when compiling C++ code.
|
|
|
|
This variable seeds the gcc random number generator using
|
|
|
|
the -frandom-seed flag with this value.
|
|
|
|
By default, it is set to NetBSD-(majorversion).
|
|
|
|
Using a fixed value causes C++ binaries to be the same when
|
2009-07-12 18:16:36 +04:00
|
|
|
built from the same sources, resulting in identical (reproducible) builds.
|
2008-08-05 23:43:33 +04:00
|
|
|
Additional information is available in the GCC
|
|
|
|
documentation of -frandom-seed.
|
|
|
|
.
|
2001-10-29 22:46:47 +03:00
|
|
|
.It Sy DESTDIR
|
|
|
|
Directory to contain the built
|
|
|
|
.Nx
|
2002-12-18 22:46:48 +03:00
|
|
|
system.
|
|
|
|
If set, special options are passed to the compilation tools to
|
2001-10-29 22:46:47 +03:00
|
|
|
prevent their default use of the host system's
|
2014-05-21 17:11:25 +04:00
|
|
|
.Pa /usr/include , /usr/lib ,
|
2002-12-18 22:46:48 +03:00
|
|
|
and so forth.
|
2006-10-08 21:54:30 +04:00
|
|
|
This pathname must be an absolute path, and should
|
2001-10-29 22:46:47 +03:00
|
|
|
.Em not
|
|
|
|
end with a slash
|
|
|
|
.Pq /
|
2006-10-08 21:54:30 +04:00
|
|
|
character.
|
|
|
|
(For installation into the system's root directory, set
|
2001-10-29 22:46:47 +03:00
|
|
|
.Sy DESTDIR
|
2006-10-08 21:54:30 +04:00
|
|
|
to an empty string, not to
|
|
|
|
.Dq / ) .
|
2002-03-04 05:10:02 +03:00
|
|
|
The directory must reside on a file system which supports long file
|
|
|
|
names and hard links.
|
2001-10-29 22:46:47 +03:00
|
|
|
.DFLT
|
|
|
|
Empty string if
|
|
|
|
.Sy USETOOLS
|
|
|
|
is
|
|
|
|
.Dq yes ;
|
|
|
|
unset otherwise.
|
2003-05-08 18:42:05 +04:00
|
|
|
.Pp
|
|
|
|
.Em Note :
|
|
|
|
.Sy build.sh
|
|
|
|
will provide a default of
|
|
|
|
.Pa destdir. Ns Sy MACHINE
|
|
|
|
(in the top-level
|
|
|
|
.Sy .OBJDIR )
|
|
|
|
unless run in
|
|
|
|
.Sq expert
|
2008-03-28 08:23:44 +03:00
|
|
|
mode.
|
2001-10-29 22:46:47 +03:00
|
|
|
.
|
2014-11-13 11:25:31 +03:00
|
|
|
.It Sy EXTSRCSRCDIR
|
|
|
|
Directory containing sources of externally added programs
|
|
|
|
and libraries.
|
|
|
|
If specified, must be an absolute path.
|
|
|
|
.DFLT
|
|
|
|
.Sy NETBSDRCDIR Ns Pa /../extsrc ,
|
|
|
|
if that exists; otherwise
|
|
|
|
.Pa /usr/extsrc .
|
|
|
|
.
|
2001-10-29 22:46:47 +03:00
|
|
|
.It Sy MAKECONF
|
|
|
|
The name of the
|
|
|
|
.Xr make 1
|
|
|
|
configuration file.
|
|
|
|
.Em Only settable in the process environment.
|
|
|
|
.DFLT
|
|
|
|
.Dq /etc/mk.conf
|
|
|
|
.
|
2003-10-25 07:46:09 +04:00
|
|
|
.It Sy MAKEVERBOSE
|
|
|
|
Level of verbosity of status messages.
|
|
|
|
Supported values:
|
|
|
|
.Bl -tag -width xxx
|
|
|
|
.It 0
|
2008-11-13 23:40:11 +03:00
|
|
|
No descriptive messages or commands executed by
|
|
|
|
.Xr make 1
|
|
|
|
are shown.
|
2003-10-25 07:46:09 +04:00
|
|
|
.It 1
|
2008-11-13 23:40:11 +03:00
|
|
|
Brief messages are shown describing what is being done,
|
|
|
|
but the actual commands executed by
|
|
|
|
.Xr make 1
|
|
|
|
are not displayed.
|
2003-10-25 07:46:09 +04:00
|
|
|
.It 2
|
2008-11-13 23:40:11 +03:00
|
|
|
Descriptive messages are shown as above (prefixed with a
|
|
|
|
.Sq # ) ,
|
|
|
|
and ordinary commands performed by
|
|
|
|
.Xr make 1
|
|
|
|
are displayed.
|
|
|
|
.It 3
|
|
|
|
In addition to the above, all commands performed by
|
|
|
|
.Xr make 1
|
|
|
|
are displayed, even if they would ordinarily have been hidden
|
|
|
|
through use of the
|
|
|
|
.Dq \&@
|
|
|
|
prefix in the relevant makefile.
|
|
|
|
.It 4
|
|
|
|
In addition to the above, commands executed by
|
|
|
|
.Xr make 1
|
|
|
|
are traced through use of the
|
|
|
|
.Xr sh 1
|
|
|
|
.Dq Fl x
|
|
|
|
flag.
|
2003-10-25 07:46:09 +04:00
|
|
|
.El
|
|
|
|
.DFLT
|
|
|
|
2
|
|
|
|
.
|
2001-10-29 22:46:47 +03:00
|
|
|
.It Sy MKCATPAGES
|
|
|
|
.YorN
|
2001-10-30 19:22:40 +03:00
|
|
|
Indicates whether preformatted plaintext manual pages will be created
|
2001-10-29 22:46:47 +03:00
|
|
|
during a build.
|
2012-11-08 19:24:40 +04:00
|
|
|
.DFLTn
|
2001-10-29 22:46:47 +03:00
|
|
|
.
|
2014-05-19 14:12:19 +04:00
|
|
|
.It Sy MKCROSSGDB
|
|
|
|
.YorN
|
|
|
|
Create a cross-gdb as a host tool.
|
|
|
|
.DFLTn
|
|
|
|
.
|
2001-10-29 22:46:47 +03:00
|
|
|
.It Sy MKCRYPTO
|
|
|
|
.YorN
|
2001-10-30 19:22:40 +03:00
|
|
|
Indicates whether cryptographic code will be included in a build;
|
|
|
|
provided for the benefit of countries that do not allow strong
|
2002-12-18 22:46:48 +03:00
|
|
|
cryptography.
|
|
|
|
Will not affect use of the standard low-security password encryption system,
|
2001-10-29 22:46:47 +03:00
|
|
|
.Xr crypt 3 .
|
|
|
|
.DFLTy
|
|
|
|
.
|
2014-05-19 13:56:17 +04:00
|
|
|
.It Sy MKDEBUG
|
|
|
|
.YorN
|
|
|
|
Indicates whether debug information should be generated for all userland
|
|
|
|
binaries compiled.
|
|
|
|
The result is collected as an additional
|
|
|
|
.Sy debug.tgz
|
|
|
|
and
|
|
|
|
.Sy xdebug.tgz
|
|
|
|
set and installed in
|
|
|
|
.Pa /usr/libdata/debug .
|
|
|
|
.DFLTn
|
|
|
|
.
|
|
|
|
.It Sy MKDEBUGLIB
|
|
|
|
.YorN
|
2014-05-21 17:11:25 +04:00
|
|
|
Indicates whether debug information (see
|
2014-05-19 13:56:17 +04:00
|
|
|
.Sy MKDEBUG )
|
|
|
|
should also be generated for all libraries build.
|
|
|
|
.DFLTn
|
|
|
|
.
|
2001-10-29 22:46:47 +03:00
|
|
|
.It Sy MKDOC
|
|
|
|
.YorN
|
|
|
|
Indicates whether system documentation destined for
|
2003-01-30 05:52:40 +03:00
|
|
|
.Sy DESTDIR Ns Pa /usr/share/doc
|
2001-10-29 22:46:47 +03:00
|
|
|
will be installed during a build.
|
|
|
|
.DFLTy
|
|
|
|
.
|
2014-11-13 11:25:31 +03:00
|
|
|
.It Sy MKEXTSRC
|
|
|
|
.YorN
|
|
|
|
Indicates whether extsrc is built from
|
|
|
|
.Sy EXTSRCSRCDIR .
|
|
|
|
.DFLTn
|
|
|
|
.
|
2008-09-07 03:22:46 +04:00
|
|
|
.It Sy MKHTML
|
|
|
|
.YorN
|
|
|
|
Indicates whether preformatted HTML manual pages will be built
|
|
|
|
and installed
|
|
|
|
.DFLTy
|
|
|
|
.
|
2001-11-15 01:29:23 +03:00
|
|
|
.It Sy MKHOSTOBJ
|
|
|
|
.YorN
|
|
|
|
If set to
|
|
|
|
.Dq yes ,
|
|
|
|
then for programs intended to be run on the compile host,
|
|
|
|
the name, release, and architecture of the host operating system
|
|
|
|
will be suffixed to the name of the object directory created by
|
|
|
|
.Dq make obj .
|
|
|
|
(This allows multiple host systems to compile NetBSD for a single target.)
|
|
|
|
If set to
|
|
|
|
.Dq no ,
|
|
|
|
then programs built to be run on the compile host will use the same
|
|
|
|
object directory names as programs built to be run on the target.
|
|
|
|
.DFLTn
|
|
|
|
.
|
2001-10-29 22:46:47 +03:00
|
|
|
.It Sy MKINFO
|
|
|
|
.YorN
|
|
|
|
Indicates whether GNU Info files, used for the documentation for
|
2001-10-30 19:22:40 +03:00
|
|
|
most of the compilation tools, will be created and installed during a
|
2001-10-29 22:46:47 +03:00
|
|
|
build.
|
|
|
|
.DFLTy
|
|
|
|
.
|
2014-05-19 14:12:19 +04:00
|
|
|
.It Sy MKKDEBUG
|
|
|
|
.YorN
|
|
|
|
Force generation of full-debug symbol versions of all kernels compiled.
|
|
|
|
Alongside of the
|
|
|
|
.Pa netbsd
|
|
|
|
kernel file, an unstripped version
|
|
|
|
.Pa netbsd.gdb
|
|
|
|
is created.
|
2014-05-21 17:11:25 +04:00
|
|
|
This is useful if a cross-gdb is built as well (see
|
2014-05-19 14:12:19 +04:00
|
|
|
.Sy MKCROSSGDB ) .
|
|
|
|
.DFLTn
|
|
|
|
.
|
2011-09-09 18:01:28 +04:00
|
|
|
.It Sy MKKMOD
|
|
|
|
.YorN
|
|
|
|
Indicates whether kernel modules are built and installed.
|
|
|
|
.DFLTy
|
|
|
|
.
|
2001-10-29 22:46:47 +03:00
|
|
|
.It Sy MKLINT
|
|
|
|
.YorN
|
|
|
|
Indicates whether
|
|
|
|
.Xr lint 1
|
|
|
|
will be run against portions of the
|
|
|
|
.Nx
|
2001-10-30 19:22:40 +03:00
|
|
|
source code during the build, and whether lint libraries will be
|
2001-10-29 22:46:47 +03:00
|
|
|
installed into
|
2003-01-30 05:52:40 +03:00
|
|
|
.Sy DESTDIR Ns Pa /usr/libdata/lint .
|
2001-10-29 22:46:47 +03:00
|
|
|
.DFLTy
|
|
|
|
.
|
|
|
|
.It Sy MKMAN
|
|
|
|
.YorN
|
|
|
|
Indicates whether manual pages will be installed during a build.
|
|
|
|
.DFLTy
|
|
|
|
.
|
|
|
|
.It Sy MKNLS
|
|
|
|
.YorN
|
|
|
|
Indicates whether Native Language System locale zone files will be
|
|
|
|
compiled and installed during a build.
|
|
|
|
.DFLTy
|
|
|
|
.
|
|
|
|
.It Sy MKOBJ
|
|
|
|
.YorN
|
|
|
|
Indicates whether object directories will be created when running
|
|
|
|
.Dq make obj .
|
|
|
|
If set to
|
|
|
|
.Dq no ,
|
|
|
|
then all built files will be located inside the regular source tree.
|
|
|
|
.DFLTy
|
2008-03-28 08:23:44 +03:00
|
|
|
.Pp
|
|
|
|
Note that setting
|
|
|
|
.Sy MKOBJ
|
|
|
|
to
|
|
|
|
.Dq no
|
|
|
|
is not recommended and may cause problems when updating the tree with
|
|
|
|
.Xr cvs 1 .
|
2001-10-29 22:46:47 +03:00
|
|
|
.
|
|
|
|
.It Sy MKPIC
|
|
|
|
.YorN
|
|
|
|
Indicates whether shared objects and libraries will be created and
|
2002-12-18 22:46:48 +03:00
|
|
|
installed during a build.
|
|
|
|
If set to
|
2001-10-29 22:46:47 +03:00
|
|
|
.Dq no ,
|
|
|
|
the entire built system will be statically linked.
|
|
|
|
.DFLT
|
2002-12-18 22:46:48 +03:00
|
|
|
Platform dependent.
|
|
|
|
As of this writing, all platforms except
|
2001-10-29 22:46:47 +03:00
|
|
|
.Sy sh3
|
|
|
|
default to
|
|
|
|
.Dq yes .
|
|
|
|
.
|
|
|
|
.It Sy MKPICINSTALL
|
|
|
|
.YorN
|
|
|
|
Indicates whether the
|
|
|
|
.Xr ar 1
|
|
|
|
format libraries
|
|
|
|
.Sy ( lib*_pic.a ) ,
|
|
|
|
used to generate shared libraries, are installed during a build.
|
|
|
|
.DFLTy
|
|
|
|
.
|
|
|
|
.It Sy MKPROFILE
|
|
|
|
.YorN
|
|
|
|
Indicates whether profiled libraries
|
|
|
|
.Sy ( lib*_p.a )
|
|
|
|
will be built and installed during a build.
|
|
|
|
.DFLT
|
|
|
|
.Dq yes ;
|
|
|
|
however, some platforms turn off
|
|
|
|
.Sy MKPROFILE
|
|
|
|
by default at times due to toolchain problems with profiled code.
|
|
|
|
.
|
2012-05-25 14:47:25 +04:00
|
|
|
.It Sy MKREPRO
|
|
|
|
.YorN
|
|
|
|
Create reproducable builds.
|
|
|
|
This enables different switches to make two builds from the same
|
|
|
|
source tree result in the same build results.
|
|
|
|
.DFLTn
|
|
|
|
.
|
2001-10-29 22:46:47 +03:00
|
|
|
.It Sy MKSHARE
|
|
|
|
.YorN
|
|
|
|
Indicates whether files destined to reside in
|
2003-01-30 05:52:40 +03:00
|
|
|
.Sy DESTDIR Ns Pa /usr/share
|
2002-12-18 22:46:48 +03:00
|
|
|
will be built and installed during a build.
|
|
|
|
If set to
|
2001-10-29 22:46:47 +03:00
|
|
|
.Dq no ,
|
|
|
|
then all of
|
|
|
|
.Sy MKCATPAGES , MKDOC , MKINFO , MKMAN ,
|
|
|
|
and
|
|
|
|
.Sy MKNLS
|
|
|
|
will be set to
|
|
|
|
.Dq no
|
|
|
|
unconditionally.
|
|
|
|
.DFLTy
|
|
|
|
.
|
2008-09-10 15:16:41 +04:00
|
|
|
.It Sy MKSTRIPIDENT
|
|
|
|
.YorN
|
2012-09-20 03:06:22 +04:00
|
|
|
Indicates whether RCS IDs, for use with
|
|
|
|
.Xr ident 1 ,
|
|
|
|
should be stripped from program binaries and shared libraries.
|
2008-09-10 15:16:41 +04:00
|
|
|
.DFLTn
|
|
|
|
.
|
2003-07-18 12:38:10 +04:00
|
|
|
.It Sy MKUNPRIVED
|
|
|
|
.YorN
|
|
|
|
Indicates whether an unprivileged install will occur.
|
2002-03-04 05:10:02 +03:00
|
|
|
The user, group, permissions, and file flags, will not be set on
|
2004-10-12 08:07:09 +04:00
|
|
|
the installed items; instead the information will be appended to
|
2002-03-04 05:10:02 +03:00
|
|
|
a file called
|
|
|
|
.Pa METALOG
|
2002-05-03 12:58:45 +04:00
|
|
|
in
|
|
|
|
.Sy DESTDIR .
|
2002-03-04 05:10:02 +03:00
|
|
|
The contents of
|
|
|
|
.Pa METALOG
|
2004-10-12 08:07:09 +04:00
|
|
|
are used during the generation of the distribution tar files to ensure
|
2002-03-04 05:10:02 +03:00
|
|
|
that the appropriate file ownership is stored.
|
2003-07-18 12:38:10 +04:00
|
|
|
.DFLTn
|
2002-03-04 05:10:02 +03:00
|
|
|
.
|
2003-07-18 12:38:10 +04:00
|
|
|
.It Sy MKUPDATE
|
|
|
|
.YorN
|
|
|
|
Indicates whether all install operations intended to write to
|
2001-10-29 22:46:47 +03:00
|
|
|
.Sy DESTDIR
|
2001-10-30 19:22:40 +03:00
|
|
|
will compare file timestamps before installing, and skip the install
|
2002-12-18 22:46:48 +03:00
|
|
|
phase if the destination files are up-to-date.
|
|
|
|
This also has implications on full builds (see next subsection).
|
2003-07-18 12:38:10 +04:00
|
|
|
.DFLTn
|
|
|
|
.
|
2004-02-07 02:22:44 +03:00
|
|
|
.It Sy MKX11
|
|
|
|
.YorN
|
2008-11-10 02:02:28 +03:00
|
|
|
Indicates whether X11 is built from
|
2004-02-07 02:22:44 +03:00
|
|
|
.Sy X11SRCDIR .
|
|
|
|
.DFLTn
|
|
|
|
.
|
2003-07-18 12:38:10 +04:00
|
|
|
.It Sy TOOLDIR
|
|
|
|
Directory to hold the host tools, once built.
|
2006-10-08 21:54:30 +04:00
|
|
|
If specified, must be an absolute path.
|
2003-07-18 12:38:10 +04:00
|
|
|
This directory should be unique to a given host system and
|
|
|
|
.Nx
|
|
|
|
source tree.
|
|
|
|
(However, multiple targets may share the same
|
|
|
|
.Sy TOOLDIR ;
|
|
|
|
the target-dependent files have unique names.) If unset, a default based
|
|
|
|
on the
|
|
|
|
.Xr uname 1
|
|
|
|
information of the host platform will be created in the
|
|
|
|
.Sy .OBJDIR
|
|
|
|
of
|
2003-07-18 20:30:48 +04:00
|
|
|
.Pa src .
|
2001-10-29 22:46:47 +03:00
|
|
|
.DFLTu
|
|
|
|
.
|
|
|
|
.It Sy USETOOLS
|
|
|
|
Indicates whether the tools specified by
|
|
|
|
.Sy TOOLDIR
|
2002-12-18 22:46:48 +03:00
|
|
|
should be used as part of a build in progress.
|
|
|
|
Must be set to
|
2001-10-29 22:46:47 +03:00
|
|
|
.Dq yes
|
|
|
|
if cross-compiling.
|
|
|
|
.Bl -tag -width "never"
|
|
|
|
.It Sy yes
|
|
|
|
Use the tools from
|
|
|
|
.Sy TOOLDIR .
|
|
|
|
.It Sy no
|
|
|
|
Do not use the tools from
|
|
|
|
.Sy TOOLDIR ,
|
|
|
|
but refuse to build native compilation tool components that are
|
|
|
|
version-specific for that tool.
|
|
|
|
.It Sy never
|
|
|
|
Do not use the tools from
|
|
|
|
.Sy TOOLDIR ,
|
2002-12-18 22:46:48 +03:00
|
|
|
even when building native tool components.
|
|
|
|
This is similar to the traditional
|
2001-10-29 22:46:47 +03:00
|
|
|
.Nx
|
|
|
|
build method, but does
|
|
|
|
.Em not
|
2001-10-30 19:22:40 +03:00
|
|
|
verify that the compilation tools in use are up-to-date enough in order
|
2002-12-18 22:46:48 +03:00
|
|
|
to build the tree successfully.
|
|
|
|
This may cause build or runtime problems when building the whole
|
2001-10-29 22:46:47 +03:00
|
|
|
.Nx
|
|
|
|
source tree.
|
|
|
|
.El
|
2008-03-29 08:22:42 +03:00
|
|
|
.DFLT
|
|
|
|
.Dq yes ,
|
|
|
|
unless
|
|
|
|
.Sy TOOLCHAIN_MISSING
|
|
|
|
is set to
|
|
|
|
.Dq yes .
|
|
|
|
.Pp
|
|
|
|
.Sy USETOOLS
|
|
|
|
is also set to
|
|
|
|
.Dq no
|
|
|
|
when using
|
|
|
|
.Aq bsd.*.mk
|
|
|
|
outside the
|
|
|
|
.Nx
|
|
|
|
source tree.
|
2001-10-29 22:46:47 +03:00
|
|
|
.
|
2004-02-07 02:22:44 +03:00
|
|
|
.It Sy X11SRCDIR
|
2015-07-23 11:03:24 +03:00
|
|
|
Directory containing the modular Xorg source.
|
2006-10-08 21:54:30 +04:00
|
|
|
If specified, must be an absolute path.
|
2015-07-23 11:03:24 +03:00
|
|
|
The main modular Xorg source is found in
|
|
|
|
.Sy X11SRCDIR Ns Pa /external/mit .
|
2004-02-07 02:22:44 +03:00
|
|
|
.DFLT
|
2009-10-10 23:05:28 +04:00
|
|
|
.Sy NETBSDRCDIR Ns Pa /../xsrc ,
|
|
|
|
if that exists; otherwise
|
|
|
|
.Pa /usr/xsrc .
|
2004-02-07 02:22:44 +03:00
|
|
|
.
|
2001-10-29 22:46:47 +03:00
|
|
|
.El
|
|
|
|
.
|
2001-10-30 17:40:24 +03:00
|
|
|
.Ss \*qmake\*q variables for full builds
|
2001-10-29 22:46:47 +03:00
|
|
|
These variables only affect the top level
|
|
|
|
.Dq Makefile
|
2002-03-04 05:10:02 +03:00
|
|
|
and do not affect manually building subtrees of the
|
2001-10-29 22:46:47 +03:00
|
|
|
.Nx
|
|
|
|
source code.
|
|
|
|
.
|
2002-12-25 03:58:00 +03:00
|
|
|
.Bl -tag -width "INSTALLWORLDDIR"
|
|
|
|
.
|
|
|
|
.It Sy INSTALLWORLDDIR
|
|
|
|
Location for the
|
|
|
|
.Dq make installworld
|
|
|
|
target to install to.
|
2006-10-08 21:54:30 +04:00
|
|
|
If specified, must be an absolute path.
|
2002-12-25 03:58:00 +03:00
|
|
|
.DFLT
|
|
|
|
.Dq /
|
2001-10-29 22:46:47 +03:00
|
|
|
.
|
|
|
|
.It Sy MKOBJDIRS
|
|
|
|
.YorN
|
|
|
|
Indicates whether object directories will be created automatically
|
|
|
|
(via a
|
|
|
|
.Dq make obj
|
|
|
|
pass) at the start of a build.
|
2003-05-18 15:18:02 +04:00
|
|
|
.DFLTn
|
2008-03-28 08:23:44 +03:00
|
|
|
.Pp
|
|
|
|
If using
|
|
|
|
.Sy build.sh ,
|
|
|
|
the default is
|
|
|
|
.Dq yes .
|
|
|
|
This may be set back to
|
|
|
|
.Dq no
|
|
|
|
by giving
|
|
|
|
.Sy build.sh
|
|
|
|
the
|
|
|
|
.Fl o
|
|
|
|
option.
|
2001-10-29 22:46:47 +03:00
|
|
|
.
|
2003-07-18 12:38:10 +04:00
|
|
|
.It Sy MKUPDATE
|
|
|
|
.YorN
|
|
|
|
If set, then in addition to the effects described for
|
|
|
|
.Sy MKUPDATE=yes
|
|
|
|
above, this implies the effects of
|
|
|
|
.Sy NOCLEANDIR
|
2012-09-20 03:08:37 +04:00
|
|
|
(i.e.,
|
2003-07-18 12:38:10 +04:00
|
|
|
.Dq make cleandir
|
|
|
|
is avoided).
|
|
|
|
.DFLTn
|
2008-03-28 08:23:44 +03:00
|
|
|
.Pp
|
|
|
|
If using
|
|
|
|
.Sy build.sh ,
|
|
|
|
this may be set by giving the
|
|
|
|
.Fl u
|
|
|
|
option.
|
2003-07-18 12:38:10 +04:00
|
|
|
.
|
2001-10-29 22:46:47 +03:00
|
|
|
.It Sy NBUILDJOBS
|
2002-12-18 22:46:48 +03:00
|
|
|
Now obsolete.
|
2012-09-20 03:08:37 +04:00
|
|
|
Use the
|
2001-10-29 22:46:47 +03:00
|
|
|
.Xr make 1
|
|
|
|
option
|
2002-12-08 11:42:51 +03:00
|
|
|
.Fl j ,
|
2008-03-28 08:23:44 +03:00
|
|
|
instead.
|
|
|
|
See below.
|
2001-10-29 22:46:47 +03:00
|
|
|
.DFLTu
|
|
|
|
.
|
|
|
|
.It Sy NOCLEANDIR
|
|
|
|
If set, avoids the
|
|
|
|
.Dq make cleandir
|
2002-12-18 22:46:48 +03:00
|
|
|
phase of a full build.
|
|
|
|
This has the effect of allowing only changed
|
|
|
|
files in a source tree to be recompiled.
|
|
|
|
This can speed up builds when updating only a few files in the tree.
|
2001-10-29 22:46:47 +03:00
|
|
|
.DFLTu
|
2008-03-28 08:23:44 +03:00
|
|
|
.Pp
|
|
|
|
See also
|
|
|
|
.Sy MKUPDATE .
|
2001-10-29 22:46:47 +03:00
|
|
|
.
|
|
|
|
.It Sy NODISTRIBDIRS
|
|
|
|
If set, avoids the
|
|
|
|
.Dq make distrib-dirs
|
2002-12-18 22:46:48 +03:00
|
|
|
phase of a full build.
|
|
|
|
This skips running
|
2001-10-30 19:22:40 +03:00
|
|
|
.Xr mtree 8
|
2001-10-29 22:46:47 +03:00
|
|
|
on
|
|
|
|
.Sy DESTDIR ,
|
2001-10-30 19:22:40 +03:00
|
|
|
useful on systems where building as an unprivileged user, or where it is
|
2001-10-29 22:46:47 +03:00
|
|
|
known that the system-wide mtree files have not changed.
|
|
|
|
.DFLTu
|
|
|
|
.
|
|
|
|
.It Sy NOINCLUDES
|
|
|
|
If set, avoids the
|
|
|
|
.Dq make includes
|
2002-12-18 22:46:48 +03:00
|
|
|
phase of a full build.
|
|
|
|
This has the effect of preventing
|
2001-10-29 22:46:47 +03:00
|
|
|
.Xr make 1
|
2001-10-30 19:22:40 +03:00
|
|
|
from thinking that some programs are out-of-date simply because the
|
2002-12-18 22:46:48 +03:00
|
|
|
system include files have changed.
|
|
|
|
However, this option should not be used when updating the entire
|
2001-10-29 22:46:47 +03:00
|
|
|
.Nx
|
|
|
|
source tree arbitrarily; it is suggested to use
|
2003-07-18 12:38:10 +04:00
|
|
|
.Sy MKUPDATE=yes
|
2008-03-28 08:23:44 +03:00
|
|
|
instead in that case.
|
2001-10-29 22:46:47 +03:00
|
|
|
.DFLTu
|
|
|
|
.
|
|
|
|
.It Sy RELEASEDIR
|
|
|
|
If set, specifies the directory to which a
|
|
|
|
.Xr release 7
|
|
|
|
layout will be written at the end of a
|
|
|
|
.Dq make release .
|
2006-10-08 21:54:30 +04:00
|
|
|
If specified, must be an absolute path.
|
2001-10-29 22:46:47 +03:00
|
|
|
.DFLTu
|
2003-05-08 18:42:05 +04:00
|
|
|
.Pp
|
|
|
|
.Em Note :
|
|
|
|
.Sy build.sh
|
|
|
|
will provide a default of
|
|
|
|
.Pa releasedir
|
|
|
|
(in the top-level
|
|
|
|
.Sy .OBJDIR )
|
|
|
|
unless run in
|
|
|
|
.Sq expert
|
2008-03-28 08:23:44 +03:00
|
|
|
mode.
|
2001-10-29 22:46:47 +03:00
|
|
|
.
|
|
|
|
.El
|
|
|
|
.
|
|
|
|
.Sh BUILDING
|
|
|
|
.
|
2001-10-30 17:40:24 +03:00
|
|
|
.Ss \*qmake\*q command line options
|
2004-10-12 08:07:09 +04:00
|
|
|
This is not a summary of all the options available to
|
2001-10-29 22:46:47 +03:00
|
|
|
.Xr make 1 ;
|
|
|
|
only the options used most frequently with
|
|
|
|
.Nx
|
|
|
|
builds are listed here.
|
|
|
|
.
|
|
|
|
.Bl -tag -width "var=value"
|
|
|
|
.
|
2002-12-08 11:42:51 +03:00
|
|
|
.It Fl j Ar njob
|
2002-05-03 02:13:30 +04:00
|
|
|
Run up to
|
2002-12-08 11:42:51 +03:00
|
|
|
.Ar njob
|
2012-09-20 03:08:37 +04:00
|
|
|
.Xr make 1
|
2002-05-03 02:13:30 +04:00
|
|
|
subjobs in parallel.
|
2012-09-20 03:08:37 +04:00
|
|
|
Makefiles should use .WAIT or have explicit dependencies
|
2002-05-03 02:13:30 +04:00
|
|
|
as necessary to enforce build ordering.
|
|
|
|
.
|
2002-12-08 11:42:51 +03:00
|
|
|
.It Fl m Ar dir
|
2001-10-30 19:22:40 +03:00
|
|
|
Specify the default directory for searching for system Makefile
|
2001-10-29 22:46:47 +03:00
|
|
|
segments, mainly the
|
|
|
|
.Aq bsd.*.mk
|
2002-12-18 22:46:48 +03:00
|
|
|
files.
|
|
|
|
When building any full
|
2001-10-29 22:46:47 +03:00
|
|
|
.Nx
|
|
|
|
source tree, this should be set to the
|
2014-05-21 17:11:25 +04:00
|
|
|
.Dq Pa share/mk
|
2002-12-18 22:46:48 +03:00
|
|
|
directory in the source tree.
|
2008-03-28 08:23:44 +03:00
|
|
|
This is set automatically when building from the top level, or when using
|
|
|
|
.Sy build.sh .
|
2001-10-29 22:46:47 +03:00
|
|
|
.
|
2002-12-08 11:42:51 +03:00
|
|
|
.It Fl n
|
2001-10-29 22:46:47 +03:00
|
|
|
Display the commands that would have been executed, but do not
|
2002-12-18 22:46:48 +03:00
|
|
|
actually execute them.
|
|
|
|
This will still cause recursion to take place.
|
2001-10-29 22:46:47 +03:00
|
|
|
.
|
2003-12-19 15:06:45 +03:00
|
|
|
.It Fl V Ar var
|
2001-10-29 22:46:47 +03:00
|
|
|
Print
|
2001-10-30 19:22:40 +03:00
|
|
|
.Xr make 1 Ns 's
|
2001-10-29 22:46:47 +03:00
|
|
|
idea of the value of
|
2002-12-08 11:42:51 +03:00
|
|
|
.Ar var .
|
2001-10-29 22:46:47 +03:00
|
|
|
Does not build any targets.
|
|
|
|
.
|
|
|
|
.It Em var=value
|
|
|
|
Set the variable
|
|
|
|
.Em var
|
|
|
|
to
|
|
|
|
.Em value ,
|
|
|
|
overriding any setting specified by the process environment, the
|
|
|
|
.Sy MAKECONF
|
|
|
|
configuration file, or the system Makefile segments.
|
|
|
|
.
|
|
|
|
.El
|
|
|
|
.
|
2001-10-30 17:40:24 +03:00
|
|
|
.Ss \*qmake\*q targets
|
2001-10-29 22:46:47 +03:00
|
|
|
.
|
|
|
|
These default targets may be built by running
|
|
|
|
.Xr make 1
|
|
|
|
in any subtree of the
|
|
|
|
.Nx
|
2002-12-18 22:46:48 +03:00
|
|
|
source code.
|
|
|
|
It is recommended that none of these be used from the top
|
2001-10-29 22:46:47 +03:00
|
|
|
level Makefile; as a specific exception,
|
|
|
|
.Dq make obj
|
|
|
|
and
|
|
|
|
.Dq make cleandir
|
|
|
|
are useful in that context.
|
|
|
|
.
|
|
|
|
.Bl -tag -width "dependall"
|
|
|
|
.
|
|
|
|
.It Sy all
|
|
|
|
Build programs, libraries, and preformatted documentation.
|
|
|
|
.
|
|
|
|
.It Sy clean
|
|
|
|
Remove program and library object code files.
|
|
|
|
.
|
|
|
|
.It Sy cleandir
|
|
|
|
Same as
|
|
|
|
.Sy clean ,
|
2001-10-30 19:22:40 +03:00
|
|
|
but also remove preformatted documentation, dependency files generated
|
2001-10-29 22:46:47 +03:00
|
|
|
by
|
|
|
|
.Dq make depend ,
|
2001-10-30 19:22:40 +03:00
|
|
|
and any other files known to be created at build time.
|
2001-10-29 22:46:47 +03:00
|
|
|
.
|
|
|
|
.It Sy depend
|
|
|
|
Create dependency files
|
|
|
|
.Sy ( .depend )
|
2001-10-30 19:22:40 +03:00
|
|
|
containing more detailed information about the dependencies of source
|
2002-12-18 22:46:48 +03:00
|
|
|
code on header files.
|
|
|
|
Allows programs to be recompiled automatically when a dependency changes.
|
2001-10-29 22:46:47 +03:00
|
|
|
.
|
|
|
|
.It Sy dependall
|
|
|
|
Does a
|
|
|
|
.Dq make depend
|
|
|
|
immediately followed by a
|
|
|
|
.Dq make all .
|
2002-05-03 02:13:30 +04:00
|
|
|
This improves cache locality of the build since both passes read the source
|
|
|
|
files in their entirety.
|
2001-10-29 22:46:47 +03:00
|
|
|
.
|
2004-02-07 02:22:44 +03:00
|
|
|
.It Sy distclean
|
|
|
|
Synonym for
|
|
|
|
.Sy cleandir .
|
|
|
|
.
|
2001-10-29 22:46:47 +03:00
|
|
|
.It Sy includes
|
2002-12-18 22:46:48 +03:00
|
|
|
Build and install system header files.
|
|
|
|
Typically needed before any system libraries or programs can be built.
|
2001-10-29 22:46:47 +03:00
|
|
|
.
|
|
|
|
.It Sy install
|
|
|
|
Install programs, libraries, and documentation into
|
|
|
|
.Sy DESTDIR .
|
2002-09-17 20:35:39 +04:00
|
|
|
Few files will be installed to
|
2003-01-30 05:52:40 +03:00
|
|
|
.Sy DESTDIR Ns Pa /dev ,
|
|
|
|
.Sy DESTDIR Ns Pa /etc ,
|
|
|
|
.Sy DESTDIR Ns Pa /root
|
2002-09-17 20:35:39 +04:00
|
|
|
or
|
2003-01-30 05:52:40 +03:00
|
|
|
.Sy DESTDIR Ns Pa /var
|
2002-09-17 20:35:39 +04:00
|
|
|
in order to prevent user supplied configuration data from being overwritten.
|
2001-10-29 22:46:47 +03:00
|
|
|
.It Sy lint
|
|
|
|
Run
|
|
|
|
.Xr lint 1
|
2001-10-30 19:22:40 +03:00
|
|
|
against the C source code, where appropriate, and generate
|
2001-10-29 22:46:47 +03:00
|
|
|
system-installed lint libraries.
|
|
|
|
.
|
|
|
|
.It Sy obj
|
2001-10-30 19:22:40 +03:00
|
|
|
Create object directories to be used for built files, instead of
|
2001-10-29 22:46:47 +03:00
|
|
|
building directly in the source tree.
|
|
|
|
.
|
|
|
|
.It Sy tags
|
|
|
|
Create
|
|
|
|
.Xr ctags 1
|
|
|
|
searchable function lists usable by the
|
|
|
|
.Xr ex 1
|
|
|
|
and
|
|
|
|
.Xr vi 1
|
|
|
|
text editors.
|
|
|
|
.
|
|
|
|
.El
|
|
|
|
.
|
2001-10-30 17:40:24 +03:00
|
|
|
.Ss \*qmake\*q targets for the top level
|
2001-10-29 22:46:47 +03:00
|
|
|
.
|
|
|
|
Additional
|
|
|
|
.Xr make 1
|
|
|
|
targets are usable specifically from the top source level to facilitate
|
|
|
|
building the entire
|
|
|
|
.Nx
|
|
|
|
source tree.
|
|
|
|
.
|
2002-12-25 03:58:00 +03:00
|
|
|
.Bl -tag -width "distribution"
|
2001-10-29 22:46:47 +03:00
|
|
|
.
|
|
|
|
.It Sy build
|
|
|
|
Build the entire
|
|
|
|
.Nx
|
2008-03-08 17:48:57 +03:00
|
|
|
system (except the kernel).
|
2002-12-18 22:46:48 +03:00
|
|
|
This orders portions of the source tree such that prerequisites
|
2001-10-29 22:46:47 +03:00
|
|
|
will be built in the proper order.
|
|
|
|
.
|
2002-12-25 03:58:00 +03:00
|
|
|
.It Sy distribution
|
|
|
|
Do a
|
|
|
|
.Dq make build ,
|
2008-03-08 17:48:57 +03:00
|
|
|
and then install a full distribution (which does not include a kernel) into
|
2003-01-23 19:24:08 +03:00
|
|
|
.Sy DESTDIR ,
|
|
|
|
including files in
|
2003-01-30 05:52:40 +03:00
|
|
|
.Sy DESTDIR Ns Pa /dev ,
|
|
|
|
.Sy DESTDIR Ns Pa /etc ,
|
|
|
|
.Sy DESTDIR Ns Pa /root
|
2003-01-23 19:24:08 +03:00
|
|
|
and
|
2003-01-30 05:52:40 +03:00
|
|
|
.Sy DESTDIR Ns Pa /var .
|
2002-12-25 03:58:00 +03:00
|
|
|
.
|
|
|
|
.It Sy buildworld
|
|
|
|
As per
|
|
|
|
.Dq make distribution ,
|
|
|
|
except that it ensures that
|
|
|
|
.Sy DESTDIR
|
|
|
|
is not the root directory.
|
|
|
|
.
|
|
|
|
.It Sy installworld
|
|
|
|
Install the distribution from
|
|
|
|
.Sy DESTDIR
|
|
|
|
to
|
2008-03-28 08:23:44 +03:00
|
|
|
.Sy INSTALLWORLDDIR ,
|
|
|
|
which defaults to the root directory.
|
2002-12-25 03:58:00 +03:00
|
|
|
Ensures that
|
|
|
|
.Sy INSTALLWORLDDIR
|
2004-10-12 08:07:09 +04:00
|
|
|
is not the root directory if cross compiling.
|
2002-12-25 03:58:00 +03:00
|
|
|
.Pp
|
2007-03-26 21:35:06 +04:00
|
|
|
The
|
|
|
|
.Sy INSTALLSETS
|
2011-09-09 18:01:28 +04:00
|
|
|
environment variable may be set to a space-separated list of
|
2007-03-26 21:35:06 +04:00
|
|
|
distribution sets to be installed.
|
|
|
|
By default, all sets except
|
|
|
|
.Dq etc
|
|
|
|
and
|
|
|
|
.Dq xetc
|
2008-03-28 08:23:44 +03:00
|
|
|
are installed, so most files in
|
2007-03-26 21:35:06 +04:00
|
|
|
.Sy INSTALLWORLDDIR Ns Pa /etc
|
2008-03-28 08:23:44 +03:00
|
|
|
will not be installed or modified.
|
2007-03-26 21:35:06 +04:00
|
|
|
.Pp
|
2002-12-25 03:58:00 +03:00
|
|
|
.Em Note :
|
2007-03-26 21:35:06 +04:00
|
|
|
Before performing this operation with
|
|
|
|
.Sy INSTALLWORLDDIR Ns = Ns Pa / ,
|
|
|
|
it is highly recommended that you upgrade your kernel and reboot.
|
|
|
|
After performing this operation,
|
|
|
|
it is recommended that you use
|
|
|
|
.Xr etcupdate 8
|
|
|
|
to update files in
|
2012-09-20 03:31:36 +04:00
|
|
|
.Sy INSTALLWORLDDIR Ns Pa /etc ,
|
|
|
|
and
|
2007-03-26 21:35:06 +04:00
|
|
|
.Xr postinstall 8
|
2012-09-20 03:31:36 +04:00
|
|
|
to check for or fix inconsistencies.
|
2003-01-26 16:15:17 +03:00
|
|
|
.It Sy sets
|
|
|
|
Create distribution sets from
|
|
|
|
.Sy DESTDIR
|
|
|
|
into
|
2008-03-18 07:24:38 +03:00
|
|
|
.Sy RELEASEDIR/RELEASEMACHINEDIR Ns Pa /binary/sets .
|
2003-01-26 16:15:17 +03:00
|
|
|
Should be run after
|
2008-03-28 08:23:44 +03:00
|
|
|
.Dq make distribution ,
|
|
|
|
as
|
2003-01-26 16:15:17 +03:00
|
|
|
.Dq make build
|
2008-03-28 08:23:44 +03:00
|
|
|
alone does not install all of the required files.
|
2003-01-26 16:15:17 +03:00
|
|
|
.
|
2003-05-10 11:12:37 +04:00
|
|
|
.It Sy sourcesets
|
|
|
|
Create source sets of the source tree into
|
|
|
|
.Sy RELEASEDIR Ns Pa /source/sets .
|
|
|
|
.
|
2006-01-04 18:35:20 +03:00
|
|
|
.It Sy syspkgs
|
|
|
|
Create syspkgs from
|
|
|
|
.Sy DESTDIR
|
|
|
|
into
|
2008-03-18 07:24:38 +03:00
|
|
|
.Sy RELEASEDIR/RELEASEMACHINEDIR Ns Pa /binary/syspkgs .
|
2006-01-04 18:35:20 +03:00
|
|
|
Should be run after
|
2008-03-28 08:23:44 +03:00
|
|
|
.Dq make distribution ,
|
|
|
|
as
|
2006-01-04 18:35:20 +03:00
|
|
|
.Dq make build
|
2008-03-28 08:23:44 +03:00
|
|
|
alone does not install all of the required files.
|
2006-01-04 18:35:20 +03:00
|
|
|
.
|
2001-10-29 22:46:47 +03:00
|
|
|
.It Sy release
|
|
|
|
Do a
|
2003-01-23 19:24:08 +03:00
|
|
|
.Dq make distribution ,
|
2003-01-26 16:15:17 +03:00
|
|
|
build kernels, distribution media, and install sets
|
|
|
|
(this as per
|
|
|
|
.Dq make sets ) ,
|
|
|
|
and
|
2001-10-29 22:46:47 +03:00
|
|
|
then package the system into a standard release layout as described by
|
|
|
|
.Xr release 7 .
|
|
|
|
This requires that
|
|
|
|
.Sy RELEASEDIR
|
|
|
|
be set (see above).
|
|
|
|
.
|
2008-03-28 08:23:44 +03:00
|
|
|
.It Sy iso-image
|
2007-04-13 23:43:38 +04:00
|
|
|
Create a
|
|
|
|
.Nx
|
|
|
|
installation CD-ROM image in the
|
2014-11-05 11:15:04 +03:00
|
|
|
.Sy RELEASEDIR Ns Pa /images
|
2007-04-13 23:43:38 +04:00
|
|
|
directory.
|
|
|
|
The CD-ROM file system will have a layout as described in
|
|
|
|
.Xr release 7 .
|
|
|
|
.Pp
|
|
|
|
For most machine types, the CD-ROM will be bootable, and will automatically
|
|
|
|
run the
|
|
|
|
.Xr sysinst 8
|
|
|
|
menu-based installation program, which can be used to install or upgrade a
|
|
|
|
.Nx
|
|
|
|
system.
|
|
|
|
Bootable CD-ROMs also contain tools that may be useful in
|
|
|
|
repairing a damaged
|
|
|
|
.Nx
|
|
|
|
installation.
|
|
|
|
.Pp
|
|
|
|
Before
|
|
|
|
.Dq make iso-image
|
|
|
|
is attempted, RELEASEDIR must be populated by
|
2006-01-29 00:34:07 +03:00
|
|
|
.Dq make release
|
|
|
|
or equivalent.
|
2007-04-13 23:43:38 +04:00
|
|
|
.Pp
|
|
|
|
Note that other, smaller, CD-ROM images may be created in the
|
2008-03-18 07:24:38 +03:00
|
|
|
.Sy RELEASEDIR/RELEASEMACHINEDIR Ns Pa /installation/cdrom
|
2007-04-13 23:43:38 +04:00
|
|
|
directory by
|
|
|
|
.Dq "make release" .
|
|
|
|
These smaller images usually contain the same tools as the larger images in
|
2014-11-05 11:15:04 +03:00
|
|
|
.Sy RELEASEDIR Ns Pa /images ,
|
2007-04-13 23:43:38 +04:00
|
|
|
but do not contain additional content such as the distribution sets.
|
|
|
|
.Pp
|
|
|
|
Note that the mac68k port still uses an older method of creating
|
|
|
|
CD-ROM images.
|
2006-01-29 00:34:07 +03:00
|
|
|
This requires the
|
|
|
|
.Xr mkisofs 1
|
|
|
|
utility, which is not part of
|
|
|
|
.Nx ,
|
|
|
|
but which can be installed from
|
2006-01-29 17:03:59 +03:00
|
|
|
.Pa pkgsrc/sysutils/cdrtools .
|
2006-01-29 00:34:07 +03:00
|
|
|
.
|
2008-08-18 09:27:05 +04:00
|
|
|
.It Sy iso-image-source
|
2007-08-30 14:29:02 +04:00
|
|
|
Create a
|
|
|
|
.Nx
|
|
|
|
installation CD-ROM image in the
|
2014-11-05 11:15:04 +03:00
|
|
|
.Sy RELEASEDIR Ns Pa /images
|
2007-08-30 14:29:02 +04:00
|
|
|
directory.
|
|
|
|
The CD-ROM file system will have a layout as described in
|
|
|
|
.Xr release 7 .
|
|
|
|
It will have top level directories for the machine type and source.
|
|
|
|
.Pp
|
|
|
|
For most machine types, the CD-ROM will be bootable, and will automatically
|
|
|
|
run the
|
|
|
|
.Xr sysinst 8
|
|
|
|
menu-based installation program, which can be used to install or upgrade a
|
|
|
|
.Nx
|
|
|
|
system.
|
|
|
|
Bootable CD-ROMs also contain tools that may be useful in
|
|
|
|
repairing a damaged
|
|
|
|
.Nx
|
|
|
|
installation.
|
|
|
|
.Pp
|
|
|
|
Before
|
|
|
|
.Dq make iso-image-source
|
|
|
|
is attempted, RELEASEDIR must be populated by
|
|
|
|
.Dq make sourcesets release
|
|
|
|
or equivalent.
|
|
|
|
.Pp
|
|
|
|
Note that other, smaller, CD-ROM images may be created in the
|
2008-03-18 07:24:38 +03:00
|
|
|
.Sy RELEASEDIR/RELEASEMACHINEDIR Ns Pa /installation/cdrom
|
2007-08-30 14:29:02 +04:00
|
|
|
directory by
|
|
|
|
.Dq make release .
|
|
|
|
These smaller images usually contain the same tools as the larger images in
|
2014-11-05 11:15:04 +03:00
|
|
|
.Sy RELEASEDIR Ns Pa /images ,
|
2007-08-30 14:29:02 +04:00
|
|
|
but do not contain additional content such as the distribution sets.
|
|
|
|
.Pp
|
|
|
|
Note that the mac68k port still uses an older method of creating
|
|
|
|
CD-ROM images.
|
|
|
|
This requires the
|
|
|
|
.Xr mkisofs 1
|
|
|
|
utility, which is not part of
|
|
|
|
.Nx ,
|
|
|
|
but which can be installed from
|
|
|
|
.Pa pkgsrc/sysutils/cdrtools .
|
|
|
|
.
|
Document build.sh "live-image" and "install-image" targets.
These were documented in revision 1.97 of src/BUILDING, but were
not documented in src/doc/BUILDING.sh. The original log message
was:
revision 1.97
date: 2012/01/22 03:53:32; author: tsutsui; state: Exp; lines: +39 -0
Add "live-image" and "install-image" target support to build.sh.
"live-image" target builds pre-installed disk images that can be used on
emulators or boot from USB memory sticks to try NetBSD without installation.
Currently amd64, i386, pmax, sparc, sparc64, sun2, sun3, and vax
(which have working emulators and don't require extra tools like preparing
msdosfs or partitioning MD label structures) support this target.
"install-image" target builds an bootable installation disk image that can
be used as an install CD but burned into USB memory sticks etc.
Current only amd64 and i386 (which would support USB boot) have this target.
For more details (and known issue) see following posts on netbsd-bugs@:
http://mail-index.NetBSD.org/netbsd-bugs/2011/08/06/msg023639.html
http://mail-index.NetBSD.org/netbsd-bugs/2011/09/23/msg024207.html
http://mail-index.NetBSD.org/netbsd-bugs/2011/12/07/msg025166.html
http://mail-index.NetBSD.org/netbsd-bugs/2011/12/08/msg025178.html
No particular comments about implementation, and
"go ahead" comments from mrg@, riz@ and christos@.
Closes PR toolchain/45153 and PR misc/45155.
2012-02-15 01:19:19 +04:00
|
|
|
.It Sy install-image
|
|
|
|
Create a bootable
|
|
|
|
.Nx
|
|
|
|
installation disk image in the
|
|
|
|
.Sy RELEASEDIR/RELEASEMACHINEDIR Ns Pa /installation/installimage
|
|
|
|
directory.
|
2012-02-15 01:32:07 +04:00
|
|
|
The installation disk image is suitable for copying to
|
|
|
|
bootable USB flash memory sticks, etc., for machines which
|
|
|
|
are able to boot from such devices.
|
|
|
|
The file system in the bootable disk image will have a layout
|
Document build.sh "live-image" and "install-image" targets.
These were documented in revision 1.97 of src/BUILDING, but were
not documented in src/doc/BUILDING.sh. The original log message
was:
revision 1.97
date: 2012/01/22 03:53:32; author: tsutsui; state: Exp; lines: +39 -0
Add "live-image" and "install-image" target support to build.sh.
"live-image" target builds pre-installed disk images that can be used on
emulators or boot from USB memory sticks to try NetBSD without installation.
Currently amd64, i386, pmax, sparc, sparc64, sun2, sun3, and vax
(which have working emulators and don't require extra tools like preparing
msdosfs or partitioning MD label structures) support this target.
"install-image" target builds an bootable installation disk image that can
be used as an install CD but burned into USB memory sticks etc.
Current only amd64 and i386 (which would support USB boot) have this target.
For more details (and known issue) see following posts on netbsd-bugs@:
http://mail-index.NetBSD.org/netbsd-bugs/2011/08/06/msg023639.html
http://mail-index.NetBSD.org/netbsd-bugs/2011/09/23/msg024207.html
http://mail-index.NetBSD.org/netbsd-bugs/2011/12/07/msg025166.html
http://mail-index.NetBSD.org/netbsd-bugs/2011/12/08/msg025178.html
No particular comments about implementation, and
"go ahead" comments from mrg@, riz@ and christos@.
Closes PR toolchain/45153 and PR misc/45155.
2012-02-15 01:19:19 +04:00
|
|
|
as described in
|
|
|
|
.Xr release 7 .
|
|
|
|
.Pp
|
|
|
|
The installation image is bootable, and will automatically
|
|
|
|
run the
|
|
|
|
.Xr sysinst 8
|
|
|
|
menu-based installation program, which can be used to install or upgrade a
|
|
|
|
.Nx
|
|
|
|
system.
|
2012-02-15 01:32:07 +04:00
|
|
|
The image also contains tools that may be
|
Document build.sh "live-image" and "install-image" targets.
These were documented in revision 1.97 of src/BUILDING, but were
not documented in src/doc/BUILDING.sh. The original log message
was:
revision 1.97
date: 2012/01/22 03:53:32; author: tsutsui; state: Exp; lines: +39 -0
Add "live-image" and "install-image" target support to build.sh.
"live-image" target builds pre-installed disk images that can be used on
emulators or boot from USB memory sticks to try NetBSD without installation.
Currently amd64, i386, pmax, sparc, sparc64, sun2, sun3, and vax
(which have working emulators and don't require extra tools like preparing
msdosfs or partitioning MD label structures) support this target.
"install-image" target builds an bootable installation disk image that can
be used as an install CD but burned into USB memory sticks etc.
Current only amd64 and i386 (which would support USB boot) have this target.
For more details (and known issue) see following posts on netbsd-bugs@:
http://mail-index.NetBSD.org/netbsd-bugs/2011/08/06/msg023639.html
http://mail-index.NetBSD.org/netbsd-bugs/2011/09/23/msg024207.html
http://mail-index.NetBSD.org/netbsd-bugs/2011/12/07/msg025166.html
http://mail-index.NetBSD.org/netbsd-bugs/2011/12/08/msg025178.html
No particular comments about implementation, and
"go ahead" comments from mrg@, riz@ and christos@.
Closes PR toolchain/45153 and PR misc/45155.
2012-02-15 01:19:19 +04:00
|
|
|
useful in repairing a damaged
|
|
|
|
.Nx
|
|
|
|
installation.
|
|
|
|
.Pp
|
|
|
|
Before
|
|
|
|
.Dq make install-image
|
2012-02-15 01:32:07 +04:00
|
|
|
is attempted,
|
|
|
|
.Sy RELEASEDIR
|
|
|
|
must be populated by
|
Document build.sh "live-image" and "install-image" targets.
These were documented in revision 1.97 of src/BUILDING, but were
not documented in src/doc/BUILDING.sh. The original log message
was:
revision 1.97
date: 2012/01/22 03:53:32; author: tsutsui; state: Exp; lines: +39 -0
Add "live-image" and "install-image" target support to build.sh.
"live-image" target builds pre-installed disk images that can be used on
emulators or boot from USB memory sticks to try NetBSD without installation.
Currently amd64, i386, pmax, sparc, sparc64, sun2, sun3, and vax
(which have working emulators and don't require extra tools like preparing
msdosfs or partitioning MD label structures) support this target.
"install-image" target builds an bootable installation disk image that can
be used as an install CD but burned into USB memory sticks etc.
Current only amd64 and i386 (which would support USB boot) have this target.
For more details (and known issue) see following posts on netbsd-bugs@:
http://mail-index.NetBSD.org/netbsd-bugs/2011/08/06/msg023639.html
http://mail-index.NetBSD.org/netbsd-bugs/2011/09/23/msg024207.html
http://mail-index.NetBSD.org/netbsd-bugs/2011/12/07/msg025166.html
http://mail-index.NetBSD.org/netbsd-bugs/2011/12/08/msg025178.html
No particular comments about implementation, and
"go ahead" comments from mrg@, riz@ and christos@.
Closes PR toolchain/45153 and PR misc/45155.
2012-02-15 01:19:19 +04:00
|
|
|
.Dq make release
|
2012-02-15 01:32:07 +04:00
|
|
|
or equivalent.
|
|
|
|
The build must have been performed with
|
2012-09-20 03:08:37 +04:00
|
|
|
.Sy MKUNPRIVED=yes
|
2012-02-15 01:32:07 +04:00
|
|
|
because
|
|
|
|
.Dq make install-image
|
|
|
|
relies on information in
|
|
|
|
.Sy DESTDIR Ns Pa /METALOG .
|
Document build.sh "live-image" and "install-image" targets.
These were documented in revision 1.97 of src/BUILDING, but were
not documented in src/doc/BUILDING.sh. The original log message
was:
revision 1.97
date: 2012/01/22 03:53:32; author: tsutsui; state: Exp; lines: +39 -0
Add "live-image" and "install-image" target support to build.sh.
"live-image" target builds pre-installed disk images that can be used on
emulators or boot from USB memory sticks to try NetBSD without installation.
Currently amd64, i386, pmax, sparc, sparc64, sun2, sun3, and vax
(which have working emulators and don't require extra tools like preparing
msdosfs or partitioning MD label structures) support this target.
"install-image" target builds an bootable installation disk image that can
be used as an install CD but burned into USB memory sticks etc.
Current only amd64 and i386 (which would support USB boot) have this target.
For more details (and known issue) see following posts on netbsd-bugs@:
http://mail-index.NetBSD.org/netbsd-bugs/2011/08/06/msg023639.html
http://mail-index.NetBSD.org/netbsd-bugs/2011/09/23/msg024207.html
http://mail-index.NetBSD.org/netbsd-bugs/2011/12/07/msg025166.html
http://mail-index.NetBSD.org/netbsd-bugs/2011/12/08/msg025178.html
No particular comments about implementation, and
"go ahead" comments from mrg@, riz@ and christos@.
Closes PR toolchain/45153 and PR misc/45155.
2012-02-15 01:19:19 +04:00
|
|
|
.
|
2015-01-09 02:59:26 +03:00
|
|
|
.It Sy live-image
|
Document build.sh "live-image" and "install-image" targets.
These were documented in revision 1.97 of src/BUILDING, but were
not documented in src/doc/BUILDING.sh. The original log message
was:
revision 1.97
date: 2012/01/22 03:53:32; author: tsutsui; state: Exp; lines: +39 -0
Add "live-image" and "install-image" target support to build.sh.
"live-image" target builds pre-installed disk images that can be used on
emulators or boot from USB memory sticks to try NetBSD without installation.
Currently amd64, i386, pmax, sparc, sparc64, sun2, sun3, and vax
(which have working emulators and don't require extra tools like preparing
msdosfs or partitioning MD label structures) support this target.
"install-image" target builds an bootable installation disk image that can
be used as an install CD but burned into USB memory sticks etc.
Current only amd64 and i386 (which would support USB boot) have this target.
For more details (and known issue) see following posts on netbsd-bugs@:
http://mail-index.NetBSD.org/netbsd-bugs/2011/08/06/msg023639.html
http://mail-index.NetBSD.org/netbsd-bugs/2011/09/23/msg024207.html
http://mail-index.NetBSD.org/netbsd-bugs/2011/12/07/msg025166.html
http://mail-index.NetBSD.org/netbsd-bugs/2011/12/08/msg025178.html
No particular comments about implementation, and
"go ahead" comments from mrg@, riz@ and christos@.
Closes PR toolchain/45153 and PR misc/45155.
2012-02-15 01:19:19 +04:00
|
|
|
Create
|
|
|
|
.Nx
|
|
|
|
live images in the
|
2015-06-07 08:30:18 +03:00
|
|
|
.Sy RELEASEDIR/images
|
Document build.sh "live-image" and "install-image" targets.
These were documented in revision 1.97 of src/BUILDING, but were
not documented in src/doc/BUILDING.sh. The original log message
was:
revision 1.97
date: 2012/01/22 03:53:32; author: tsutsui; state: Exp; lines: +39 -0
Add "live-image" and "install-image" target support to build.sh.
"live-image" target builds pre-installed disk images that can be used on
emulators or boot from USB memory sticks to try NetBSD without installation.
Currently amd64, i386, pmax, sparc, sparc64, sun2, sun3, and vax
(which have working emulators and don't require extra tools like preparing
msdosfs or partitioning MD label structures) support this target.
"install-image" target builds an bootable installation disk image that can
be used as an install CD but burned into USB memory sticks etc.
Current only amd64 and i386 (which would support USB boot) have this target.
For more details (and known issue) see following posts on netbsd-bugs@:
http://mail-index.NetBSD.org/netbsd-bugs/2011/08/06/msg023639.html
http://mail-index.NetBSD.org/netbsd-bugs/2011/09/23/msg024207.html
http://mail-index.NetBSD.org/netbsd-bugs/2011/12/07/msg025166.html
http://mail-index.NetBSD.org/netbsd-bugs/2011/12/08/msg025178.html
No particular comments about implementation, and
"go ahead" comments from mrg@, riz@ and christos@.
Closes PR toolchain/45153 and PR misc/45155.
2012-02-15 01:19:19 +04:00
|
|
|
directory.
|
|
|
|
The live image contains all necessary files
|
|
|
|
to boot
|
|
|
|
.Nx
|
2012-02-15 01:32:07 +04:00
|
|
|
up to multi-user mode, including all files
|
Document build.sh "live-image" and "install-image" targets.
These were documented in revision 1.97 of src/BUILDING, but were
not documented in src/doc/BUILDING.sh. The original log message
was:
revision 1.97
date: 2012/01/22 03:53:32; author: tsutsui; state: Exp; lines: +39 -0
Add "live-image" and "install-image" target support to build.sh.
"live-image" target builds pre-installed disk images that can be used on
emulators or boot from USB memory sticks to try NetBSD without installation.
Currently amd64, i386, pmax, sparc, sparc64, sun2, sun3, and vax
(which have working emulators and don't require extra tools like preparing
msdosfs or partitioning MD label structures) support this target.
"install-image" target builds an bootable installation disk image that can
be used as an install CD but burned into USB memory sticks etc.
Current only amd64 and i386 (which would support USB boot) have this target.
For more details (and known issue) see following posts on netbsd-bugs@:
http://mail-index.NetBSD.org/netbsd-bugs/2011/08/06/msg023639.html
http://mail-index.NetBSD.org/netbsd-bugs/2011/09/23/msg024207.html
http://mail-index.NetBSD.org/netbsd-bugs/2011/12/07/msg025166.html
http://mail-index.NetBSD.org/netbsd-bugs/2011/12/08/msg025178.html
No particular comments about implementation, and
"go ahead" comments from mrg@, riz@ and christos@.
Closes PR toolchain/45153 and PR misc/45155.
2012-02-15 01:19:19 +04:00
|
|
|
which should be extracted during installation,
|
|
|
|
.Nx
|
2012-02-15 01:32:07 +04:00
|
|
|
disklabel, bootloaders, etc.
|
Document build.sh "live-image" and "install-image" targets.
These were documented in revision 1.97 of src/BUILDING, but were
not documented in src/doc/BUILDING.sh. The original log message
was:
revision 1.97
date: 2012/01/22 03:53:32; author: tsutsui; state: Exp; lines: +39 -0
Add "live-image" and "install-image" target support to build.sh.
"live-image" target builds pre-installed disk images that can be used on
emulators or boot from USB memory sticks to try NetBSD without installation.
Currently amd64, i386, pmax, sparc, sparc64, sun2, sun3, and vax
(which have working emulators and don't require extra tools like preparing
msdosfs or partitioning MD label structures) support this target.
"install-image" target builds an bootable installation disk image that can
be used as an install CD but burned into USB memory sticks etc.
Current only amd64 and i386 (which would support USB boot) have this target.
For more details (and known issue) see following posts on netbsd-bugs@:
http://mail-index.NetBSD.org/netbsd-bugs/2011/08/06/msg023639.html
http://mail-index.NetBSD.org/netbsd-bugs/2011/09/23/msg024207.html
http://mail-index.NetBSD.org/netbsd-bugs/2011/12/07/msg025166.html
http://mail-index.NetBSD.org/netbsd-bugs/2011/12/08/msg025178.html
No particular comments about implementation, and
"go ahead" comments from mrg@, riz@ and christos@.
Closes PR toolchain/45153 and PR misc/45155.
2012-02-15 01:19:19 +04:00
|
|
|
.Pp
|
2012-02-15 01:32:07 +04:00
|
|
|
The live image is suitable for use as a disk image in
|
|
|
|
virtual machine environments such as QEMU,
|
|
|
|
and also useful to boot
|
Document build.sh "live-image" and "install-image" targets.
These were documented in revision 1.97 of src/BUILDING, but were
not documented in src/doc/BUILDING.sh. The original log message
was:
revision 1.97
date: 2012/01/22 03:53:32; author: tsutsui; state: Exp; lines: +39 -0
Add "live-image" and "install-image" target support to build.sh.
"live-image" target builds pre-installed disk images that can be used on
emulators or boot from USB memory sticks to try NetBSD without installation.
Currently amd64, i386, pmax, sparc, sparc64, sun2, sun3, and vax
(which have working emulators and don't require extra tools like preparing
msdosfs or partitioning MD label structures) support this target.
"install-image" target builds an bootable installation disk image that can
be used as an install CD but burned into USB memory sticks etc.
Current only amd64 and i386 (which would support USB boot) have this target.
For more details (and known issue) see following posts on netbsd-bugs@:
http://mail-index.NetBSD.org/netbsd-bugs/2011/08/06/msg023639.html
http://mail-index.NetBSD.org/netbsd-bugs/2011/09/23/msg024207.html
http://mail-index.NetBSD.org/netbsd-bugs/2011/12/07/msg025166.html
http://mail-index.NetBSD.org/netbsd-bugs/2011/12/08/msg025178.html
No particular comments about implementation, and
"go ahead" comments from mrg@, riz@ and christos@.
Closes PR toolchain/45153 and PR misc/45155.
2012-02-15 01:19:19 +04:00
|
|
|
.Nx
|
2012-02-15 01:32:07 +04:00
|
|
|
from a USB flash memory stick
|
|
|
|
on a real machine, without the need for installation.
|
Document build.sh "live-image" and "install-image" targets.
These were documented in revision 1.97 of src/BUILDING, but were
not documented in src/doc/BUILDING.sh. The original log message
was:
revision 1.97
date: 2012/01/22 03:53:32; author: tsutsui; state: Exp; lines: +39 -0
Add "live-image" and "install-image" target support to build.sh.
"live-image" target builds pre-installed disk images that can be used on
emulators or boot from USB memory sticks to try NetBSD without installation.
Currently amd64, i386, pmax, sparc, sparc64, sun2, sun3, and vax
(which have working emulators and don't require extra tools like preparing
msdosfs or partitioning MD label structures) support this target.
"install-image" target builds an bootable installation disk image that can
be used as an install CD but burned into USB memory sticks etc.
Current only amd64 and i386 (which would support USB boot) have this target.
For more details (and known issue) see following posts on netbsd-bugs@:
http://mail-index.NetBSD.org/netbsd-bugs/2011/08/06/msg023639.html
http://mail-index.NetBSD.org/netbsd-bugs/2011/09/23/msg024207.html
http://mail-index.NetBSD.org/netbsd-bugs/2011/12/07/msg025166.html
http://mail-index.NetBSD.org/netbsd-bugs/2011/12/08/msg025178.html
No particular comments about implementation, and
"go ahead" comments from mrg@, riz@ and christos@.
Closes PR toolchain/45153 and PR misc/45155.
2012-02-15 01:19:19 +04:00
|
|
|
.Pp
|
|
|
|
Before
|
|
|
|
.Dq make live-image
|
|
|
|
is attempted, RELEASEDIR must be populated by
|
|
|
|
.Dq make release
|
2012-02-23 17:34:15 +04:00
|
|
|
or equivalent.
|
2012-02-15 01:32:07 +04:00
|
|
|
The build must have been performed with
|
2012-09-20 03:08:37 +04:00
|
|
|
.Sy MKUNPRIVED=yes
|
2012-02-15 01:32:07 +04:00
|
|
|
because
|
|
|
|
.Dq make install-image
|
|
|
|
relies on information in
|
|
|
|
.Sy DESTDIR Ns Pa /METALOG .
|
Document build.sh "live-image" and "install-image" targets.
These were documented in revision 1.97 of src/BUILDING, but were
not documented in src/doc/BUILDING.sh. The original log message
was:
revision 1.97
date: 2012/01/22 03:53:32; author: tsutsui; state: Exp; lines: +39 -0
Add "live-image" and "install-image" target support to build.sh.
"live-image" target builds pre-installed disk images that can be used on
emulators or boot from USB memory sticks to try NetBSD without installation.
Currently amd64, i386, pmax, sparc, sparc64, sun2, sun3, and vax
(which have working emulators and don't require extra tools like preparing
msdosfs or partitioning MD label structures) support this target.
"install-image" target builds an bootable installation disk image that can
be used as an install CD but burned into USB memory sticks etc.
Current only amd64 and i386 (which would support USB boot) have this target.
For more details (and known issue) see following posts on netbsd-bugs@:
http://mail-index.NetBSD.org/netbsd-bugs/2011/08/06/msg023639.html
http://mail-index.NetBSD.org/netbsd-bugs/2011/09/23/msg024207.html
http://mail-index.NetBSD.org/netbsd-bugs/2011/12/07/msg025166.html
http://mail-index.NetBSD.org/netbsd-bugs/2011/12/08/msg025178.html
No particular comments about implementation, and
"go ahead" comments from mrg@, riz@ and christos@.
Closes PR toolchain/45153 and PR misc/45155.
2012-02-15 01:19:19 +04:00
|
|
|
.
|
2001-10-29 22:46:47 +03:00
|
|
|
.It Sy regression-tests
|
|
|
|
Can only be run after building the regression tests in the directory
|
|
|
|
.Dq regress .
|
2008-03-28 08:23:44 +03:00
|
|
|
Runs those compiled regression tests on the local host.
|
|
|
|
Note that most tests are now managed instead using
|
|
|
|
.Xr atf 7 ;
|
|
|
|
this target should probably run those as well but currently does not.
|
2001-10-29 22:46:47 +03:00
|
|
|
.
|
|
|
|
.El
|
|
|
|
.
|
2001-10-30 17:40:24 +03:00
|
|
|
.Ss The \*qbuild.sh\*q script
|
2001-10-29 22:46:47 +03:00
|
|
|
.
|
2011-09-09 22:48:34 +04:00
|
|
|
This script file is a shell script designed to build the
|
2001-10-29 22:46:47 +03:00
|
|
|
entire
|
|
|
|
.Nx
|
2011-09-09 22:48:34 +04:00
|
|
|
system on any host with a suitable modern shell and some common
|
|
|
|
utilities.
|
|
|
|
The required shell features are described under the
|
|
|
|
.Sy HOST_SH
|
|
|
|
variable.
|
|
|
|
.Pp
|
|
|
|
If a host system's default shell does support the required
|
|
|
|
features, then we suggest that you explicitly specify
|
|
|
|
a suitable shell using a command like
|
|
|
|
.Bd -unfilled -offset indent
|
|
|
|
.Li /path/to/suitable/shell build.sh Op Ar options
|
|
|
|
.Ed
|
|
|
|
.Pp
|
|
|
|
The above command will usually enable
|
|
|
|
.Nm build.sh
|
|
|
|
to automatically set
|
|
|
|
.Sy HOST_SH Ns Cm = Ns Pa /path/to/suitable/shell ,
|
|
|
|
but if that fails, then the following set of commands may be used instead:
|
|
|
|
.Bd -unfilled -offset indent
|
|
|
|
.Li HOST_SH= Ns Va /path/to/suitable/shell
|
|
|
|
.Li export HOST_SH
|
|
|
|
.Li ${HOST_SH} build.sh Op Ar options
|
|
|
|
.Ed
|
|
|
|
.Pp
|
|
|
|
If
|
|
|
|
.Sy build.sh
|
|
|
|
detects that it is being executed under an unsuitable shell, it attempts
|
|
|
|
to exec a suitable shell instead, or prints an error message.
|
|
|
|
If
|
|
|
|
.Sy HOST_SH
|
|
|
|
is not set explicitly, then
|
|
|
|
.Nm build.sh
|
|
|
|
sets a default using heuristics dependent on the host platform,
|
|
|
|
or from the shell under which
|
|
|
|
.Nm build.sh
|
|
|
|
is executed (if that can be determined),
|
|
|
|
or using the first copy of
|
|
|
|
.Pa sh
|
|
|
|
found in
|
|
|
|
.Sy PATH .
|
2001-10-29 22:46:47 +03:00
|
|
|
.Pp
|
2001-10-30 19:22:40 +03:00
|
|
|
All cross-compile builds, and most native builds, of the entire system
|
2001-10-29 22:46:47 +03:00
|
|
|
should make use of
|
|
|
|
.Sy build.sh
|
|
|
|
rather than just running
|
|
|
|
.Dq make .
|
|
|
|
This way, the
|
|
|
|
.Xr make 1
|
2001-10-30 19:22:40 +03:00
|
|
|
program will be bootstrapped properly, in case the host system has an
|
2001-10-29 22:46:47 +03:00
|
|
|
older or incompatible
|
|
|
|
.Dq make
|
|
|
|
program.
|
|
|
|
.Pp
|
|
|
|
When compiling the entire system via
|
|
|
|
.Sy build.sh ,
|
|
|
|
many
|
|
|
|
.Xr make 1
|
2001-10-30 19:22:40 +03:00
|
|
|
variables are set for you in order to help encapsulate the build
|
2002-12-18 22:46:48 +03:00
|
|
|
process.
|
|
|
|
In the list of options below, variables that are automatically set by
|
2001-10-29 22:46:47 +03:00
|
|
|
.Sy build.sh
|
2001-11-01 02:20:34 +03:00
|
|
|
are noted where applicable.
|
2003-01-23 19:24:08 +03:00
|
|
|
.
|
2001-10-29 22:46:47 +03:00
|
|
|
.Pp
|
2003-01-23 19:24:08 +03:00
|
|
|
The following operations are supported by
|
2001-10-29 22:46:47 +03:00
|
|
|
.Sy build.sh :
|
|
|
|
.
|
2003-01-23 19:24:08 +03:00
|
|
|
.Bl -tag -width "distribution"
|
|
|
|
.
|
|
|
|
.It Sy build
|
|
|
|
Build the system as per
|
|
|
|
.Dq make build .
|
2008-03-28 08:23:44 +03:00
|
|
|
Before the main part of the build commences, this command runs the
|
2003-01-23 19:24:08 +03:00
|
|
|
.Sy obj
|
2008-03-28 08:23:44 +03:00
|
|
|
operation (unless the
|
|
|
|
.Fl o
|
|
|
|
option is given),
|
|
|
|
.Dq make cleandir
|
|
|
|
(unless the
|
|
|
|
.Fl u
|
|
|
|
option is given),
|
|
|
|
and the
|
2003-01-23 19:24:08 +03:00
|
|
|
.Sy tools
|
2008-03-28 08:23:44 +03:00
|
|
|
operation.
|
2003-01-23 19:24:08 +03:00
|
|
|
.
|
|
|
|
.It Sy distribution
|
|
|
|
Build a full distribution as per
|
|
|
|
.Dq make distribution .
|
2008-03-28 08:23:44 +03:00
|
|
|
This command first runs the
|
2003-01-23 19:24:08 +03:00
|
|
|
.Sy build
|
|
|
|
operation.
|
|
|
|
.
|
|
|
|
.It Sy release
|
|
|
|
Build a full release as per
|
|
|
|
.Dq make release .
|
2008-03-28 08:23:44 +03:00
|
|
|
This command first runs the
|
2003-01-23 19:24:08 +03:00
|
|
|
.Sy distribution
|
|
|
|
operation.
|
|
|
|
.
|
2003-01-26 08:34:32 +03:00
|
|
|
.It Sy makewrapper
|
|
|
|
Create the
|
2003-01-30 01:50:08 +03:00
|
|
|
.Sy \*[toolprefix]make-MACHINE
|
2003-01-26 08:34:32 +03:00
|
|
|
wrapper.
|
|
|
|
This operation is automatically performed for any of the other
|
|
|
|
operations.
|
|
|
|
.
|
2008-08-18 09:27:05 +04:00
|
|
|
.It Sy cleandir
|
|
|
|
Perform
|
|
|
|
.Dq make cleandir .
|
|
|
|
.
|
2003-01-23 19:24:08 +03:00
|
|
|
.It Sy obj
|
|
|
|
Perform
|
|
|
|
.Dq make obj .
|
2003-01-26 09:19:12 +03:00
|
|
|
.
|
2003-01-23 19:24:08 +03:00
|
|
|
.It Sy tools
|
|
|
|
Build and install the host tools from
|
|
|
|
.Pa src/tools .
|
2008-03-28 08:23:44 +03:00
|
|
|
This command will first run
|
|
|
|
.Dq make obj
|
|
|
|
and
|
|
|
|
.Dq make cleandir
|
2012-09-20 03:08:37 +04:00
|
|
|
in the
|
2008-03-28 08:23:44 +03:00
|
|
|
.Pa tools
|
|
|
|
subdirectory unless the
|
|
|
|
.Fl o
|
|
|
|
or
|
|
|
|
.Fl u
|
|
|
|
options (respectively) are given.
|
2003-05-25 16:34:27 +04:00
|
|
|
.
|
|
|
|
.It Sy install Ns = Ns Ar idir
|
|
|
|
Install the contents of
|
|
|
|
.Sy DESTDIR
|
|
|
|
to
|
|
|
|
.Ar idir ,
|
|
|
|
using
|
|
|
|
.Dq make installworld .
|
2007-03-26 21:35:06 +04:00
|
|
|
Note that files that are part of the
|
|
|
|
.Dq etc
|
|
|
|
or
|
|
|
|
.Dq xetc
|
2011-09-09 18:01:28 +04:00
|
|
|
sets will not be installed, unless overridden by
|
|
|
|
the INSTALLSETS environment variable.
|
2003-05-25 16:34:27 +04:00
|
|
|
.
|
2003-01-23 19:24:08 +03:00
|
|
|
.It Sy kernel Ns = Ns Ar kconf
|
|
|
|
Build a new kernel.
|
|
|
|
The
|
|
|
|
.Ar kconf
|
|
|
|
argument is the name of a configuration file suitable
|
|
|
|
for use by
|
2005-06-20 17:25:23 +04:00
|
|
|
.Xr config 1 .
|
2003-01-23 19:24:08 +03:00
|
|
|
If
|
|
|
|
.Ar kconf
|
|
|
|
does not contain any
|
|
|
|
.Sq /
|
|
|
|
characters, the configuration file is expected to be found in the
|
|
|
|
.Sy KERNCONFDIR
|
|
|
|
directory, which is typically
|
2014-05-21 17:11:25 +04:00
|
|
|
.Pa sys/arch/MACHINE/conf .
|
2003-01-23 19:24:08 +03:00
|
|
|
The new kernel will be built in a subdirectory of
|
|
|
|
.Sy KERNOBJDIR ,
|
|
|
|
which is typically
|
2014-05-21 17:11:25 +04:00
|
|
|
.Pa sys/arch/MACHINE/compile
|
2003-01-23 19:24:08 +03:00
|
|
|
or an associated object directory.
|
2008-03-28 08:23:44 +03:00
|
|
|
.Pp
|
|
|
|
This command does
|
|
|
|
.Em not
|
|
|
|
imply the
|
|
|
|
.Sy tools
|
|
|
|
command; run the
|
2003-01-23 19:24:08 +03:00
|
|
|
.Sy tools
|
2008-03-28 08:23:44 +03:00
|
|
|
command first unless it is
|
|
|
|
.Em certain
|
|
|
|
that the tools already exist and are up to date.
|
|
|
|
.Pp
|
|
|
|
This command will run
|
|
|
|
.Dq make cleandir
|
|
|
|
on the kernel in question first unless the
|
|
|
|
.Fl u
|
|
|
|
option is given.
|
2003-01-23 19:24:08 +03:00
|
|
|
.
|
2014-05-19 14:12:19 +04:00
|
|
|
.It Sy kernel.gdb Ns = Ns Ar kconf
|
|
|
|
Build a new kernel with debug information.
|
|
|
|
Similar to the above
|
|
|
|
.Sy kernel Ns = Ns Ar kconf
|
|
|
|
operation, but creates a
|
|
|
|
.Pa netbsd.gdb
|
|
|
|
file alongside of the kernel
|
|
|
|
.Pa netbsd ,
|
|
|
|
which contains a full symbol table and can be used for debugging
|
2014-05-21 17:11:25 +04:00
|
|
|
(for example with a cross-gdb built by
|
2014-05-19 14:12:19 +04:00
|
|
|
.Sy MKCROSSGDB ) .
|
2014-11-06 09:41:23 +03:00
|
|
|
.It Sy kernels
|
|
|
|
This command will build all kernels defined in port specific release build
|
|
|
|
procedure.
|
|
|
|
.Pp
|
|
|
|
This command internally calls the
|
|
|
|
.Sy kernel Ns = Ns Ar kconf
|
|
|
|
operation for each found kernel configuration file.
|
2009-09-27 20:44:40 +04:00
|
|
|
.It Sy modules
|
|
|
|
This command will build kernel modules and install them into
|
|
|
|
.Sy DESTDIR .
|
|
|
|
.
|
2003-05-25 16:34:27 +04:00
|
|
|
.It Sy releasekernel Ns = Ns Ar kconf
|
|
|
|
Install a
|
|
|
|
.Xr gzip 1 Ns ed
|
2008-03-28 08:23:44 +03:00
|
|
|
copy of the kernel previously built by
|
2003-05-25 16:34:27 +04:00
|
|
|
.Sy kernel Ns = Ns Ar kconf
|
|
|
|
into
|
2008-03-18 07:24:38 +03:00
|
|
|
.Sy RELEASEDIR/RELEASEMACHINEDIR Ns Pa /binary/kernel ,
|
2003-05-25 16:34:27 +04:00
|
|
|
usually as
|
|
|
|
.Pa netbsd- Ns Ar kconf Ns Pa .gz ,
|
|
|
|
although the
|
|
|
|
.Dq Pa netbsd
|
|
|
|
prefix is determined from the
|
|
|
|
.Dq Sy config
|
|
|
|
directives in
|
|
|
|
.Ar kconf .
|
2003-01-23 19:24:08 +03:00
|
|
|
.
|
2003-01-26 09:19:12 +03:00
|
|
|
.It Sy sets
|
|
|
|
Perform
|
|
|
|
.Dq make sets .
|
2003-05-10 11:12:37 +04:00
|
|
|
.
|
|
|
|
.It Sy sourcesets
|
|
|
|
Perform
|
|
|
|
.Dq make sourcesets .
|
|
|
|
.
|
2006-01-04 18:35:20 +03:00
|
|
|
.It Sy syspkgs
|
|
|
|
Perform
|
|
|
|
.Dq make syspkgs .
|
|
|
|
.
|
2006-01-29 00:34:07 +03:00
|
|
|
.It Sy iso-image
|
|
|
|
Perform
|
|
|
|
.Dq make iso-image .
|
|
|
|
.
|
2007-09-01 12:15:27 +04:00
|
|
|
.It Sy iso-image-source
|
|
|
|
Perform
|
|
|
|
.Dq make iso-image-source .
|
|
|
|
.
|
Document build.sh "live-image" and "install-image" targets.
These were documented in revision 1.97 of src/BUILDING, but were
not documented in src/doc/BUILDING.sh. The original log message
was:
revision 1.97
date: 2012/01/22 03:53:32; author: tsutsui; state: Exp; lines: +39 -0
Add "live-image" and "install-image" target support to build.sh.
"live-image" target builds pre-installed disk images that can be used on
emulators or boot from USB memory sticks to try NetBSD without installation.
Currently amd64, i386, pmax, sparc, sparc64, sun2, sun3, and vax
(which have working emulators and don't require extra tools like preparing
msdosfs or partitioning MD label structures) support this target.
"install-image" target builds an bootable installation disk image that can
be used as an install CD but burned into USB memory sticks etc.
Current only amd64 and i386 (which would support USB boot) have this target.
For more details (and known issue) see following posts on netbsd-bugs@:
http://mail-index.NetBSD.org/netbsd-bugs/2011/08/06/msg023639.html
http://mail-index.NetBSD.org/netbsd-bugs/2011/09/23/msg024207.html
http://mail-index.NetBSD.org/netbsd-bugs/2011/12/07/msg025166.html
http://mail-index.NetBSD.org/netbsd-bugs/2011/12/08/msg025178.html
No particular comments about implementation, and
"go ahead" comments from mrg@, riz@ and christos@.
Closes PR toolchain/45153 and PR misc/45155.
2012-02-15 01:19:19 +04:00
|
|
|
.It Sy install-image
|
|
|
|
Perform
|
|
|
|
.Dq make install-image .
|
|
|
|
.
|
|
|
|
.It Sy live-image
|
|
|
|
Perform
|
|
|
|
.Dq make live-image .
|
|
|
|
.
|
2014-08-08 01:32:11 +04:00
|
|
|
.It Sy list-arch
|
|
|
|
Prints a list of valid
|
|
|
|
.Sy MACHINE
|
|
|
|
and
|
|
|
|
.Sy MACHINE_ARCH
|
|
|
|
settings, the default
|
|
|
|
.Sy MACHINE_ARCH
|
|
|
|
for each
|
|
|
|
.Sy MACHINE ,
|
|
|
|
and aliases for
|
|
|
|
.Sy MACHINE Ns No / Ns Sy MACHINE_ARCH
|
|
|
|
pairs, and then exits.
|
|
|
|
The
|
|
|
|
.Fl m
|
|
|
|
or
|
|
|
|
.Fl a
|
|
|
|
options (or both) may be used to specify glob patterns
|
|
|
|
that will be used to narrow the list of results;
|
|
|
|
for example,
|
|
|
|
.Dq Li build.sh -m 'evm*' -a '*arm*' list-arch
|
|
|
|
will list all known
|
|
|
|
.Sy MACHINE Ns No / Ns Sy MACHINE_ARCH
|
|
|
|
values in which either
|
|
|
|
.Sy MACHINE
|
|
|
|
or
|
|
|
|
.Sy ALIAS
|
|
|
|
matches the pattern
|
|
|
|
.Ql evb* ,
|
|
|
|
and
|
|
|
|
.Sy MACHINE_ARCH
|
|
|
|
matches the pattern
|
|
|
|
.Ql *arm* .
|
|
|
|
.
|
2003-01-23 19:24:08 +03:00
|
|
|
.El
|
|
|
|
.
|
|
|
|
.Pp
|
|
|
|
The following command line options alter the behaviour of the
|
|
|
|
.Sy build.sh
|
|
|
|
operations described above:
|
|
|
|
.
|
2001-10-29 22:46:47 +03:00
|
|
|
.Bl -tag -width "-T tools"
|
|
|
|
.
|
2002-12-08 11:42:51 +03:00
|
|
|
.It Fl a Ar arch
|
2001-10-29 22:46:47 +03:00
|
|
|
Set the value of
|
|
|
|
.Sy MACHINE_ARCH
|
|
|
|
to
|
2002-12-08 11:42:51 +03:00
|
|
|
.Ar arch .
|
2014-08-08 01:32:11 +04:00
|
|
|
See the
|
|
|
|
.Fl m
|
|
|
|
option for more information.
|
2001-10-29 22:46:47 +03:00
|
|
|
.
|
2002-12-08 11:42:51 +03:00
|
|
|
.It Fl B Ar buildid
|
2002-03-14 21:33:04 +03:00
|
|
|
Set the value of
|
|
|
|
.Sy BUILDID
|
|
|
|
to
|
2002-12-08 11:42:51 +03:00
|
|
|
.Ar buildid .
|
2007-11-23 19:19:28 +03:00
|
|
|
This will also append the build identifier to the name of the
|
2002-03-14 21:33:04 +03:00
|
|
|
.Dq make
|
|
|
|
wrapper script so that the resulting name is of the form
|
2003-01-30 01:50:08 +03:00
|
|
|
.Dq Sy \*[toolprefix]make-MACHINE-BUILDID .
|
2002-03-14 21:33:04 +03:00
|
|
|
.
|
2007-11-23 19:19:28 +03:00
|
|
|
.It Fl C Ar cdextras
|
2009-09-27 21:28:38 +04:00
|
|
|
Append
|
2012-09-20 03:08:37 +04:00
|
|
|
.Ar cdextras
|
2009-09-27 21:28:38 +04:00
|
|
|
to the
|
|
|
|
.Sy CDEXTRA
|
|
|
|
variable,
|
|
|
|
which is a space-separated list of files or directories that will be
|
|
|
|
added to the CD-ROM image that may be create by the
|
2007-09-01 13:32:19 +04:00
|
|
|
.Dq iso-image
|
|
|
|
or
|
2009-09-27 21:28:38 +04:00
|
|
|
.Dq iso-image-source
|
|
|
|
operations.
|
2007-11-23 19:19:28 +03:00
|
|
|
Files will be added to the root of the CD-ROM image, whereas directories
|
|
|
|
will be copied recursively.
|
|
|
|
If relative paths are specified, they will be converted to
|
|
|
|
absolute paths before being used.
|
2009-09-27 21:28:38 +04:00
|
|
|
Multiple paths may be specified via multiple
|
|
|
|
.Fl C
|
|
|
|
options, or via a single option whose argument contains multiple
|
|
|
|
space-separated paths.
|
2007-09-01 13:32:19 +04:00
|
|
|
.
|
2002-12-08 11:42:51 +03:00
|
|
|
.It Fl D Ar dest
|
|
|
|
Set the value of
|
|
|
|
.Sy DESTDIR
|
|
|
|
to
|
|
|
|
.Ar dest .
|
2006-10-08 21:54:30 +04:00
|
|
|
If a relative path is specified, it will be converted to an
|
|
|
|
absolute path before being used.
|
2002-12-08 11:42:51 +03:00
|
|
|
.
|
2002-12-09 01:14:00 +03:00
|
|
|
.It Fl E
|
|
|
|
Set
|
|
|
|
.Sq expert
|
2003-01-26 08:34:32 +03:00
|
|
|
mode.
|
|
|
|
This overrides various sanity checks, and allows:
|
2002-12-09 01:14:00 +03:00
|
|
|
.Sy DESTDIR
|
2003-01-26 08:34:32 +03:00
|
|
|
does not have to be set to a non-root path for builds,
|
|
|
|
and
|
2003-07-18 12:38:10 +04:00
|
|
|
.Sy MKUNPRIVED=yes
|
2003-01-26 08:34:32 +03:00
|
|
|
does not have to be set when building as a non-root user.
|
|
|
|
.Pp
|
|
|
|
.Em Note :
|
|
|
|
It is highly recommended that you know what you are doing when
|
|
|
|
you use this option.
|
2002-12-09 01:14:00 +03:00
|
|
|
.
|
2004-06-25 19:04:02 +04:00
|
|
|
.It Fl h
|
|
|
|
Print a help message.
|
|
|
|
.
|
2002-12-08 11:42:51 +03:00
|
|
|
.It Fl j Ar njob
|
2008-03-28 08:23:44 +03:00
|
|
|
Run up to
|
|
|
|
.Ar njob
|
2012-09-20 03:08:37 +04:00
|
|
|
.Xr make 1
|
2008-03-28 08:23:44 +03:00
|
|
|
subjobs in parallel;
|
2012-09-20 03:08:37 +04:00
|
|
|
passed through to
|
2002-05-03 02:13:30 +04:00
|
|
|
.Xr make 1 .
|
2008-08-11 12:22:39 +04:00
|
|
|
If you see failures for reasons other than running out of memory
|
|
|
|
while using
|
|
|
|
.Sy build.sh
|
|
|
|
with
|
|
|
|
.Fl j ,
|
2012-09-20 03:08:37 +04:00
|
|
|
please save complete build logs
|
2002-05-03 02:13:30 +04:00
|
|
|
so the failures can be analyzed.
|
2008-08-11 12:22:39 +04:00
|
|
|
.Pp
|
|
|
|
To achieve the fastest builds,
|
|
|
|
.Fl j
|
|
|
|
values between (1 + the number of CPUs) and (2 * the number of CPUs)
|
|
|
|
are recommended.
|
|
|
|
Use lower values on machines with limited memory or I/O bandwidth.
|
2001-10-29 22:46:47 +03:00
|
|
|
.
|
2002-12-08 11:42:51 +03:00
|
|
|
.It Fl M Ar obj
|
|
|
|
Set
|
|
|
|
.Sy MAKEOBJDIRPREFIX
|
|
|
|
to
|
|
|
|
.Ar obj .
|
2009-09-27 22:08:24 +04:00
|
|
|
Unsets
|
|
|
|
.Sy MAKEOBJDIR .
|
|
|
|
See
|
2013-12-25 00:10:29 +04:00
|
|
|
.Dq Fl O Ar obj
|
2009-09-27 22:08:24 +04:00
|
|
|
for more information.
|
|
|
|
.Pp
|
2008-08-06 02:40:33 +04:00
|
|
|
For instance, if the source directory is
|
|
|
|
.Pa /usr/src ,
|
|
|
|
a setting of
|
|
|
|
.Dq Fl M Pa /usr/obj
|
|
|
|
will place build-time files under
|
|
|
|
.Pa /usr/obj/usr/src/bin ,
|
|
|
|
.Pa /usr/obj/usr/src/lib ,
|
|
|
|
.Pa /usr/obj/usr/src/usr.bin ,
|
|
|
|
and so forth.
|
2009-09-27 22:08:24 +04:00
|
|
|
.Pp
|
2006-10-08 21:54:30 +04:00
|
|
|
If a relative path is specified, it will be converted to an
|
|
|
|
absolute path before being used.
|
2009-09-27 22:08:24 +04:00
|
|
|
.Sy build.sh
|
|
|
|
imposes the restriction that the argument to the
|
|
|
|
.Fl M
|
|
|
|
option must not begin with a
|
|
|
|
.Dq \&$
|
|
|
|
(dollar sign)
|
|
|
|
character; otherwise it would be too difficult
|
|
|
|
to determine whether the value is an absolute or a relative path.
|
|
|
|
If the directory does not already exist,
|
|
|
|
.Sy build.sh
|
|
|
|
will create it.
|
2002-12-08 11:42:51 +03:00
|
|
|
.
|
|
|
|
.It Fl m Ar mach
|
2001-10-29 22:46:47 +03:00
|
|
|
Set the value of
|
|
|
|
.Sy MACHINE
|
|
|
|
to
|
2007-01-27 14:47:36 +03:00
|
|
|
.Ar mach ,
|
2014-08-08 01:32:11 +04:00
|
|
|
unless the
|
|
|
|
.Ar mach
|
|
|
|
argument is an alias that refers to a
|
|
|
|
.Sy MACHINE Ns No / Ns Sy MACHINE_ARCH
|
|
|
|
pair, in which case both
|
|
|
|
.Sy MACHINE
|
|
|
|
and
|
2001-10-29 22:46:47 +03:00
|
|
|
.Sy MACHINE_ARCH
|
2014-08-08 01:32:11 +04:00
|
|
|
are set from the alias.
|
|
|
|
Such aliases are interpreted entirely by
|
|
|
|
.Sy build.sh ;
|
|
|
|
they are not used by any other part of the build system.
|
|
|
|
The
|
|
|
|
.Sy MACHINE_ARCH
|
|
|
|
setting implied by
|
|
|
|
.Ar mach
|
|
|
|
will override any value of
|
|
|
|
.Sy MACHINE_ARCH
|
|
|
|
in the process environment, but will not override a value set by the
|
2002-12-08 11:42:51 +03:00
|
|
|
.Fl a
|
2014-08-08 01:32:11 +04:00
|
|
|
option.
|
2002-12-18 22:46:48 +03:00
|
|
|
All cross builds require
|
2002-12-08 11:42:51 +03:00
|
|
|
.Fl m ,
|
2001-11-01 02:20:34 +03:00
|
|
|
but if unset on a NetBSD host, the host's value of MACHINE will be
|
|
|
|
detected and used automatically.
|
2003-05-17 12:10:39 +04:00
|
|
|
.Pp
|
2014-08-08 01:32:11 +04:00
|
|
|
See the
|
|
|
|
.Cm list-arch
|
|
|
|
operation for a way to get a list of valid
|
|
|
|
.Sy MACHINE
|
2003-05-17 12:10:39 +04:00
|
|
|
and
|
2014-08-08 01:32:11 +04:00
|
|
|
.Sy MACHINE_ARCH
|
|
|
|
settings.
|
2001-11-01 02:20:34 +03:00
|
|
|
.
|
2003-10-25 07:46:09 +04:00
|
|
|
.It Fl N Ar noiselevel
|
|
|
|
Set the
|
|
|
|
.Dq noisyness
|
2003-10-26 05:17:46 +03:00
|
|
|
level of the build, by setting
|
|
|
|
.Sy MAKEVERBOSE
|
|
|
|
to
|
|
|
|
.Ar noiselevel .
|
2003-10-25 07:46:09 +04:00
|
|
|
.
|
2002-12-08 11:42:51 +03:00
|
|
|
.It Fl n
|
2001-11-01 02:20:34 +03:00
|
|
|
Show the commands that would be executed by
|
|
|
|
.Sy build.sh ,
|
2002-12-18 22:46:48 +03:00
|
|
|
but do not make any changes.
|
|
|
|
This is similar in concept to
|
2001-11-01 02:20:34 +03:00
|
|
|
.Dq make -n .
|
|
|
|
.
|
2002-12-08 11:42:51 +03:00
|
|
|
.It Fl O Ar obj
|
2001-11-01 02:20:34 +03:00
|
|
|
Create an appropriate transform macro for
|
|
|
|
.Sy MAKEOBJDIR
|
|
|
|
that will place the built object files under
|
2002-12-08 11:42:51 +03:00
|
|
|
.Ar obj .
|
2009-09-27 22:08:24 +04:00
|
|
|
Unsets
|
|
|
|
.Sy MAKEOBJDIRPREFIX .
|
|
|
|
.Pp
|
2001-11-01 02:20:34 +03:00
|
|
|
For instance, a setting of
|
2008-08-06 02:40:33 +04:00
|
|
|
.Dq Fl O Pa /usr/obj
|
2002-07-22 13:49:05 +04:00
|
|
|
will place build-time files under
|
2008-08-06 02:40:33 +04:00
|
|
|
.Pa /usr/obj/bin ,
|
|
|
|
.Pa /usr/obj/lib ,
|
|
|
|
.Pa /usr/obj/usr.bin ,
|
2001-11-01 02:20:34 +03:00
|
|
|
and so forth.
|
2009-09-27 22:08:24 +04:00
|
|
|
.Pp
|
2008-08-06 02:40:33 +04:00
|
|
|
If a relative path is specified, it will be converted to an
|
|
|
|
absolute path before being used.
|
2009-09-27 22:08:24 +04:00
|
|
|
.Sy build.sh
|
|
|
|
imposes the restriction that the argument to the
|
|
|
|
.Fl O
|
|
|
|
option must not contain a
|
|
|
|
.Dq \&$
|
|
|
|
(dollar sign)
|
|
|
|
character.
|
|
|
|
If the directory does not already exist,
|
|
|
|
.Sy build.sh
|
|
|
|
will create it.
|
2008-08-06 02:40:33 +04:00
|
|
|
.Pp
|
|
|
|
In normal use, exactly one of the
|
|
|
|
.Fl M
|
|
|
|
or
|
|
|
|
.Fl O
|
|
|
|
options should be specified.
|
2008-09-24 11:36:52 +04:00
|
|
|
If neither
|
2008-08-06 02:40:33 +04:00
|
|
|
.Fl M
|
|
|
|
nor
|
|
|
|
.Fl O
|
|
|
|
is specified, then a default object directory will be chosen
|
|
|
|
according to rules in
|
2008-09-24 11:36:52 +04:00
|
|
|
.Aq bsd.obj.mk .
|
|
|
|
Relying on this default is not recommended because
|
|
|
|
it is determined by complex rules that are influenced
|
|
|
|
by the values of several variables and
|
|
|
|
by the location of the source directory.
|
2014-08-08 01:45:27 +04:00
|
|
|
.Pp
|
|
|
|
Note that placing the
|
|
|
|
.Ar obj
|
|
|
|
directory location outside of the default source tree hierarchy makes
|
|
|
|
it easier to manually clear out old files in the event the
|
|
|
|
.Dq make cleandir
|
|
|
|
operation is unable to do so.
|
|
|
|
(See
|
|
|
|
.Sx CAVEATS
|
|
|
|
below.)
|
|
|
|
.Pp
|
|
|
|
Note also that use of one of
|
|
|
|
.Fl M
|
|
|
|
or
|
|
|
|
.Fl O
|
|
|
|
is the only means of building multiple machine architecture userlands
|
|
|
|
from the same source tree without cleaning between builds (in which
|
|
|
|
case, one would specify distinct
|
|
|
|
.Ar obj
|
|
|
|
locations for each).
|
2002-12-08 11:42:51 +03:00
|
|
|
.It Fl o
|
|
|
|
Set the value of
|
|
|
|
.Sy MKOBJDIRS
|
|
|
|
to
|
|
|
|
.Dq no .
|
2003-05-18 15:18:02 +04:00
|
|
|
Otherwise, it will be automatically set to
|
2008-03-28 08:23:44 +03:00
|
|
|
.Dq yes .
|
|
|
|
This default is opposite to the behaviour when not using
|
|
|
|
.Sy build.sh .
|
2002-12-08 11:42:51 +03:00
|
|
|
.
|
|
|
|
.It Fl R Ar rel
|
2001-10-29 22:46:47 +03:00
|
|
|
Set the value of
|
|
|
|
.Sy RELEASEDIR
|
|
|
|
to
|
2002-12-08 11:42:51 +03:00
|
|
|
.Ar rel .
|
2006-10-08 21:54:30 +04:00
|
|
|
If a relative path is specified, it will be converted to an
|
|
|
|
absolute path before being used.
|
2001-10-29 22:46:47 +03:00
|
|
|
.
|
2002-12-08 11:42:51 +03:00
|
|
|
.It Fl r
|
|
|
|
Remove the contents of
|
|
|
|
.Sy DESTDIR
|
|
|
|
and
|
|
|
|
.Sy TOOLDIR
|
2002-12-18 22:46:48 +03:00
|
|
|
before building (provides a clean starting point).
|
|
|
|
This will skip deleting
|
2002-12-08 11:42:51 +03:00
|
|
|
.Sy DESTDIR
|
|
|
|
if building on a native system to the root directory.
|
|
|
|
.
|
2008-08-05 23:43:33 +04:00
|
|
|
.It Fl S Ar seed
|
|
|
|
Change the value of
|
|
|
|
.Sy BUILDSEED
|
|
|
|
to
|
|
|
|
.Ar seed .
|
|
|
|
This should rarely be necessary.
|
|
|
|
.
|
2002-12-08 11:42:51 +03:00
|
|
|
.It Fl T Ar tools
|
2001-10-29 22:46:47 +03:00
|
|
|
Set the value of
|
|
|
|
.Sy TOOLDIR
|
|
|
|
to
|
2002-12-08 11:42:51 +03:00
|
|
|
.Ar tools .
|
2006-10-08 21:54:30 +04:00
|
|
|
If a relative path is specified, it will be converted to an
|
|
|
|
absolute path before being used.
|
2001-11-01 02:20:34 +03:00
|
|
|
If set, the bootstrap
|
|
|
|
.Dq make
|
2008-03-28 08:23:44 +03:00
|
|
|
will only be rebuilt if the source files for
|
2001-11-01 02:20:34 +03:00
|
|
|
.Xr make 1
|
2008-03-28 08:23:44 +03:00
|
|
|
have changed.
|
2001-10-29 22:46:47 +03:00
|
|
|
.
|
2002-12-08 11:42:51 +03:00
|
|
|
.It Fl U
|
2003-07-18 12:38:10 +04:00
|
|
|
Set
|
|
|
|
.Sy MKUNPRIVED=yes .
|
2002-03-04 05:10:02 +03:00
|
|
|
.
|
2002-12-08 11:42:51 +03:00
|
|
|
.It Fl u
|
2003-07-18 12:38:10 +04:00
|
|
|
Set
|
|
|
|
.Sy MKUPDATE=yes .
|
2002-12-08 11:42:51 +03:00
|
|
|
.
|
2003-01-04 15:55:32 +03:00
|
|
|
.It Xo
|
|
|
|
.Fl V
|
|
|
|
.Sm off
|
|
|
|
.Ar var
|
|
|
|
.Li =
|
|
|
|
.Op Ar value
|
|
|
|
.Sm on
|
|
|
|
.Xc
|
2003-07-29 14:07:15 +04:00
|
|
|
Set the environment variable
|
2003-01-04 15:55:32 +03:00
|
|
|
.Ar var
|
2003-07-29 14:07:15 +04:00
|
|
|
to an optional
|
|
|
|
.Ar value .
|
2012-09-20 03:08:37 +04:00
|
|
|
This is propagated to the
|
2003-07-29 14:07:15 +04:00
|
|
|
.Sy \*[toolprefix]make
|
|
|
|
wrapper.
|
2003-01-04 15:55:32 +03:00
|
|
|
.
|
2002-12-08 11:42:51 +03:00
|
|
|
.It Fl w Ar wrapper
|
2003-07-29 14:07:15 +04:00
|
|
|
Create the
|
|
|
|
.Sy \*[toolprefix]make
|
|
|
|
wrapper script (see below) in a custom location,
|
2002-12-08 11:42:51 +03:00
|
|
|
specified by
|
|
|
|
.Ar wrapper .
|
|
|
|
This allows, for instance, to place the wrapper in
|
|
|
|
.Sy PATH
|
2002-12-18 22:46:48 +03:00
|
|
|
automatically.
|
|
|
|
Note that
|
2002-12-08 11:42:51 +03:00
|
|
|
.Ar wrapper
|
|
|
|
is the full name of the file, not just a directory name.
|
2006-10-08 21:54:30 +04:00
|
|
|
If a relative path is specified, it will be converted to an
|
|
|
|
absolute path before being used.
|
2002-12-08 11:42:51 +03:00
|
|
|
.
|
2004-02-07 02:22:44 +03:00
|
|
|
.It Fl X Ar x11src
|
|
|
|
Set the value of
|
|
|
|
.Sy X11SRCDIR
|
|
|
|
to
|
|
|
|
.Ar x11src .
|
2006-10-08 21:54:30 +04:00
|
|
|
If a relative path is specified, it will be converted to an
|
|
|
|
absolute path before being used.
|
2004-02-07 02:22:44 +03:00
|
|
|
.
|
|
|
|
.It Fl x
|
|
|
|
Set
|
|
|
|
.Sy MKX11=yes .
|
|
|
|
.
|
2014-11-13 11:25:31 +03:00
|
|
|
.It Fl Y Ar extsrcdir
|
|
|
|
Set the value of
|
|
|
|
.Sy EXTSRCSRCDIR
|
|
|
|
to
|
|
|
|
.Ar extsrcdir .
|
|
|
|
If a relative path is specified, it will be converted to an
|
|
|
|
absolute path before being used.
|
|
|
|
.
|
|
|
|
.It Fl y
|
|
|
|
Set
|
|
|
|
.Sy MKEXTSRC=yes .
|
|
|
|
.
|
2003-07-29 14:07:15 +04:00
|
|
|
.It Fl Z Ar var
|
|
|
|
Unset ("zap") the environment variable
|
|
|
|
.Ar var .
|
2012-09-20 03:08:37 +04:00
|
|
|
This is propagated to the
|
2003-07-29 14:07:15 +04:00
|
|
|
.Sy \*[toolprefix]make
|
|
|
|
wrapper.
|
|
|
|
.
|
2001-10-29 22:46:47 +03:00
|
|
|
.El
|
|
|
|
.
|
2003-01-30 01:50:08 +03:00
|
|
|
.Ss The \*q\*[toolprefix]make-MACHINE\*q wrapper script
|
2001-10-29 22:46:47 +03:00
|
|
|
.
|
|
|
|
If using the
|
|
|
|
.Sy build.sh
|
|
|
|
script to build
|
|
|
|
.Nx ,
|
|
|
|
a
|
2003-01-30 01:50:08 +03:00
|
|
|
.Sy \*[toolprefix]make-MACHINE
|
2001-10-29 22:46:47 +03:00
|
|
|
script will be created in
|
2014-05-21 17:11:25 +04:00
|
|
|
.Sy TOOLDIR Ns Pa /bin
|
2001-10-30 19:22:40 +03:00
|
|
|
upon the first build to assist in building subtrees on a cross-compile
|
2001-10-29 22:46:47 +03:00
|
|
|
host.
|
|
|
|
.Pp
|
2003-01-30 01:50:08 +03:00
|
|
|
.Sy \*[toolprefix]make-MACHINE
|
2001-10-29 22:46:47 +03:00
|
|
|
can be invoked in lieu of
|
|
|
|
.Xr make 1 ,
|
|
|
|
and will instead call the up-to-date version of
|
2003-01-30 01:50:08 +03:00
|
|
|
.Dq \*[toolprefix]make
|
2001-10-29 22:46:47 +03:00
|
|
|
installed into
|
2014-05-21 17:11:25 +04:00
|
|
|
.Sy TOOLDIR Ns Pa /bin
|
2001-10-29 22:46:47 +03:00
|
|
|
with several key variables pre-set, including
|
|
|
|
.Sy MACHINE , MACHINE_ARCH ,
|
|
|
|
and
|
|
|
|
.Sy TOOLDIR .
|
2008-03-28 08:23:44 +03:00
|
|
|
.Sy \*[toolprefix]make-MACHINE
|
2003-07-29 14:07:15 +04:00
|
|
|
will also set variables specified with
|
|
|
|
.Fl V ,
|
|
|
|
and unset variables specified with
|
|
|
|
.Fl Z .
|
|
|
|
.Pp
|
2001-10-29 22:46:47 +03:00
|
|
|
This script can be symlinked into a directory listed in
|
|
|
|
.Sy PATH ,
|
|
|
|
or called with an absolute path.
|
|
|
|
.
|
2002-10-20 19:48:01 +04:00
|
|
|
.Sh EXAMPLES
|
2003-01-23 19:24:08 +03:00
|
|
|
.
|
2003-02-02 15:37:41 +03:00
|
|
|
.Bl -enum
|
2003-01-23 19:24:08 +03:00
|
|
|
.
|
2003-02-02 15:37:41 +03:00
|
|
|
.It
|
2008-09-24 11:36:52 +04:00
|
|
|
.Li "% ./build.sh [options] tools kernel=GENERIC"
|
2003-02-02 15:37:41 +03:00
|
|
|
.Pp
|
2002-10-20 19:48:01 +04:00
|
|
|
Build a new toolchain, and use the new toolchain to
|
|
|
|
configure and build a new GENERIC kernel.
|
2003-01-23 19:24:08 +03:00
|
|
|
.
|
2003-02-02 15:37:41 +03:00
|
|
|
.It
|
2008-09-24 11:36:52 +04:00
|
|
|
.Li "% ./build.sh [options] -U distribution"
|
2003-02-02 15:37:41 +03:00
|
|
|
.Pp
|
2002-10-20 19:48:01 +04:00
|
|
|
Using unprivileged mode,
|
2003-05-08 18:42:05 +04:00
|
|
|
build a complete distribution to a
|
|
|
|
.Sy DESTDIR
|
|
|
|
directory that
|
|
|
|
.Sy build.sh
|
|
|
|
selects (and will display).
|
2003-01-23 19:24:08 +03:00
|
|
|
.
|
2003-02-02 15:37:41 +03:00
|
|
|
.It
|
2008-09-24 11:36:52 +04:00
|
|
|
.Li "# ./build.sh [options] -U install=/"
|
2003-02-02 15:37:41 +03:00
|
|
|
.Pp
|
2003-02-08 13:00:33 +03:00
|
|
|
As root, install to
|
|
|
|
.Pa /
|
|
|
|
the distribution that was built
|
|
|
|
by example 2.
|
2003-02-02 15:37:41 +03:00
|
|
|
Even though this is run as root,
|
2003-01-23 19:24:08 +03:00
|
|
|
.Fl U
|
|
|
|
is required so that the permissions stored in
|
2003-05-08 18:42:05 +04:00
|
|
|
.Sy DESTDIR Ns Pa /METALOG
|
2003-01-23 19:24:08 +03:00
|
|
|
are correctly applied to the files as they're copied to
|
2003-02-02 15:37:41 +03:00
|
|
|
.Pa / .
|
2003-01-23 19:24:08 +03:00
|
|
|
.
|
2003-02-02 15:37:41 +03:00
|
|
|
.It
|
2008-09-24 11:36:52 +04:00
|
|
|
.Li "% ./build.sh [options] -U -u release"
|
2003-02-02 15:37:41 +03:00
|
|
|
.Pp
|
2002-10-20 19:48:01 +04:00
|
|
|
Using unprivileged mode,
|
2003-05-08 18:42:05 +04:00
|
|
|
build a complete release to
|
|
|
|
.Sy DESTDIR
|
|
|
|
and
|
|
|
|
.Sy RELEASEDIR
|
|
|
|
directories that
|
|
|
|
.Sy build.sh
|
|
|
|
selects (and will display).
|
2003-07-18 12:38:10 +04:00
|
|
|
.Sy MKUPDATE=yes
|
2003-02-02 15:37:41 +03:00
|
|
|
.Pq Fl u
|
|
|
|
is set to prevent the
|
|
|
|
.Dq make cleandir ,
|
|
|
|
so that if this is run after example 2, it doesn't need to redo that
|
|
|
|
portion of the release build.
|
2002-10-20 19:48:01 +04:00
|
|
|
.El
|
|
|
|
.
|
2002-05-03 02:13:30 +04:00
|
|
|
.Sh OBSOLETE VARIABLES
|
|
|
|
.
|
|
|
|
.Bl -tag -width "NBUILDJOBS"
|
|
|
|
.
|
|
|
|
.It Sy NBUILDJOBS
|
2012-09-20 03:08:37 +04:00
|
|
|
Use the
|
2002-05-03 02:13:30 +04:00
|
|
|
.Xr make 1
|
|
|
|
option
|
2008-03-28 08:23:44 +03:00
|
|
|
.Fl j
|
2002-05-03 02:13:30 +04:00
|
|
|
instead.
|
2002-09-21 09:17:52 +04:00
|
|
|
.
|
|
|
|
.It Sy USE_NEW_TOOLCHAIN
|
|
|
|
The new toolchain is now the default.
|
|
|
|
To disable, use
|
|
|
|
.Sy TOOLCHAIN_MISSING=yes .
|
2002-05-03 02:13:30 +04:00
|
|
|
.El
|
2001-10-29 22:46:47 +03:00
|
|
|
.Sh SEE ALSO
|
|
|
|
.Xr make 1 ,
|
|
|
|
.Xr hier 7 ,
|
2006-01-29 00:34:07 +03:00
|
|
|
.Xr release 7 ,
|
2007-03-26 21:35:06 +04:00
|
|
|
.Xr etcupdate 8 ,
|
|
|
|
.Xr postinstall 8 ,
|
2007-04-13 23:43:38 +04:00
|
|
|
.Xr sysinst 8 ,
|
2006-01-29 17:03:59 +03:00
|
|
|
.Pa pkgsrc/sysutils/cdrtools
|
2001-10-29 22:46:47 +03:00
|
|
|
.
|
|
|
|
.Sh HISTORY
|
|
|
|
.
|
|
|
|
The
|
2002-09-21 09:17:52 +04:00
|
|
|
.Nm build.sh
|
|
|
|
based build scheme was introduced for
|
|
|
|
.Nx 1.6
|
|
|
|
as
|
|
|
|
.Sy USE_NEW_TOOLCHAIN ,
|
|
|
|
and re-worked to
|
|
|
|
.Sy TOOLCHAIN_MISSING
|
|
|
|
after that.
|
2014-08-08 01:45:27 +04:00
|
|
|
.
|
|
|
|
.Sh CAVEATS
|
|
|
|
.
|
|
|
|
After significant updates to third-party components in the source
|
|
|
|
tree, the
|
|
|
|
.Dq make cleandir
|
|
|
|
operation may be insufficient to clean out old files in object
|
|
|
|
directories.
|
|
|
|
Instead, one may have to manually remove the files.
|
|
|
|
Consult the
|
|
|
|
.Pa UPDATING
|
|
|
|
file for notices concerning this.
|