build.sh, BUILDING: consistency improvements
Consistently use "show", instead of sometimes using "display" or "print". Fix mdoc markup (even though BUILDING is raw text). Document help, -P, -?
This commit is contained in:
parent
b9abc1c511
commit
9d6c4a2602
35
BUILDING
35
BUILDING
|
@ -168,7 +168,7 @@ CONFIGURATION
|
|||
directory names, and can be consulted in the make(1)
|
||||
configuration file in order to set additional build
|
||||
parameters, such as compiler flags. It will also be used as
|
||||
part of the kernel version string, which can be printed by
|
||||
part of the kernel version string, which can be shown by
|
||||
"uname -v".
|
||||
|
||||
Default: Unset.
|
||||
|
@ -225,15 +225,15 @@ CONFIGURATION
|
|||
|
||||
1 Brief messages are shown describing what is being done,
|
||||
but the actual commands executed by make(1) are not
|
||||
displayed.
|
||||
shown.
|
||||
|
||||
2 Descriptive messages are shown as above (prefixed with a
|
||||
`#'), and ordinary commands performed by make(1) are
|
||||
displayed.
|
||||
shown.
|
||||
|
||||
3 In addition to the above, all commands performed by
|
||||
make(1) are displayed, even if they would ordinarily
|
||||
have been hidden through use of the "@" prefix in the
|
||||
make(1) are shown, even if they would ordinarily have
|
||||
been hidden through use of the "@" prefix in the
|
||||
relevant makefile.
|
||||
|
||||
4 In addition to the above, commands executed by make(1)
|
||||
|
@ -553,11 +553,11 @@ BUILDING
|
|||
automatically when building from the top level, or when using
|
||||
build.sh.
|
||||
|
||||
-n Display the commands that would have been executed, but do not
|
||||
-n Show the commands that would have been executed, but do not
|
||||
actually execute them. This will still cause recursion to
|
||||
take place.
|
||||
|
||||
-V var Print make(1)'s idea of the value of var. Does not build any
|
||||
-V var Show make(1)'s idea of the value of var. Does not build any
|
||||
targets.
|
||||
|
||||
var=value Set the variable var to value, overriding any setting
|
||||
|
@ -777,7 +777,7 @@ BUILDING
|
|||
${HOST_SH} build.sh [options]
|
||||
|
||||
If 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.
|
||||
it attempts to exec a suitable shell instead, or shows an error message.
|
||||
If HOST_SH is not set explicitly, then build.sh sets a default using
|
||||
heuristics dependent on the host platform, or from the shell under which
|
||||
build.sh is executed (if that can be determined), or using the first copy
|
||||
|
@ -806,6 +806,8 @@ BUILDING
|
|||
release Build a full release as per "make release". This command
|
||||
first runs the distribution operation.
|
||||
|
||||
help Show a help message, and exit.
|
||||
|
||||
makewrapper Create the nbmake-MACHINE wrapper. This operation is
|
||||
automatically performed for any of the other operations.
|
||||
|
||||
|
@ -877,8 +879,8 @@ BUILDING
|
|||
|
||||
live-image Perform "make live-image".
|
||||
|
||||
list-arch Prints a list of valid MACHINE and MACHINE_ARCH settings,
|
||||
the default MACHINE_ARCH for each MACHINE, and aliases for
|
||||
list-arch Show a list of valid MACHINE and MACHINE_ARCH settings, the
|
||||
default MACHINE_ARCH for each MACHINE, and aliases for
|
||||
MACHINE/MACHINE_ARCH pairs, and then exits. The -m or -a
|
||||
options (or both) may be used to specify glob patterns that
|
||||
will be used to narrow the list of results; for example,
|
||||
|
@ -933,7 +935,7 @@ BUILDING
|
|||
Note: It is highly recommended that you know what you are doing
|
||||
when you use this option.
|
||||
|
||||
-h Print a help message.
|
||||
-h Show a help message, and exit.
|
||||
|
||||
-j njob Run up to njob make(1) subjobs in parallel; passed through to
|
||||
make(1). If you see failures for reasons other than running
|
||||
|
@ -1018,6 +1020,9 @@ BUILDING
|
|||
automatically set to "yes". This default is opposite to the
|
||||
behaviour when not using build.sh.
|
||||
|
||||
-P Set the value of MKREPRO and MKREPRO_TIMESTAMP to the latest
|
||||
source CVS timestamp for reproducible builds.
|
||||
|
||||
-R rel Set the value of RELEASEDIR to rel. If a relative path is
|
||||
specified, it will be converted to an absolute path before
|
||||
being used.
|
||||
|
@ -1060,6 +1065,8 @@ BUILDING
|
|||
-Z var Unset ("zap") the environment variable var. This is propagated
|
||||
to the nbmake wrapper.
|
||||
|
||||
-? Show a help message, and exit.
|
||||
|
||||
The "nbmake-MACHINE" wrapper script
|
||||
If using the build.sh script to build NetBSD, a nbmake-MACHINE script
|
||||
will be created in TOOLDIR/bin upon the first build to assist in building
|
||||
|
@ -1083,7 +1090,7 @@ EXAMPLES
|
|||
2. % ./build.sh [options] -U distribution
|
||||
|
||||
Using unprivileged mode, build a complete distribution to a DESTDIR
|
||||
directory that build.sh selects (and will display).
|
||||
directory that build.sh selects (and will show).
|
||||
|
||||
3. # ./build.sh [options] -U install=/
|
||||
|
||||
|
@ -1095,7 +1102,7 @@ EXAMPLES
|
|||
4. % ./build.sh [options] -U -u release
|
||||
|
||||
Using unprivileged mode, build a complete release to DESTDIR and
|
||||
RELEASEDIR directories that build.sh selects (and will display).
|
||||
RELEASEDIR directories that build.sh selects (and will show).
|
||||
MKUPDATE=yes (-u) is set to prevent the "make cleandir", so that if
|
||||
this is run after example 2, it doesn't need to redo that portion of
|
||||
the release build.
|
||||
|
@ -1121,4 +1128,4 @@ CAVEATS
|
|||
in object directories. Instead, one may have to manually remove the
|
||||
files. Consult the UPDATING file for notices concerning this.
|
||||
|
||||
NetBSD October 13, 2020 NetBSD
|
||||
NetBSD May 16, 2023 NetBSD
|
||||
|
|
51
build.sh
51
build.sh
|
@ -1,7 +1,7 @@
|
|||
#! /usr/bin/env sh
|
||||
# $NetBSD: build.sh,v 1.368 2023/04/23 09:54:15 uwe Exp $
|
||||
# $NetBSD: build.sh,v 1.369 2023/05/16 21:39:26 lukem Exp $
|
||||
#
|
||||
# Copyright (c) 2001-2022 The NetBSD Foundation, Inc.
|
||||
# Copyright (c) 2001-2023 The NetBSD Foundation, Inc.
|
||||
# All rights reserved.
|
||||
#
|
||||
# This code is derived from software contributed to The NetBSD Foundation
|
||||
|
@ -38,7 +38,7 @@
|
|||
# We try to determine whether or not this script is being run under
|
||||
# a shell that supports the features that we use. If not, we try to
|
||||
# re-exec the script under another shell. If we can't find another
|
||||
# suitable shell, then we print a message and exit.
|
||||
# suitable shell, then we show a message and exit.
|
||||
#
|
||||
|
||||
errmsg='' # error message, if not empty
|
||||
|
@ -358,8 +358,8 @@ warning()
|
|||
statusmsg "Warning: $@"
|
||||
}
|
||||
|
||||
# Find a program in the PATH, and print the result. If not found,
|
||||
# print a default. If $2 is defined (even if it is an empty string),
|
||||
# Find a program in the PATH, and show the result. If not found,
|
||||
# show a default. If $2 is defined (even if it is an empty string),
|
||||
# then that is the default; otherwise, $1 is used as the default.
|
||||
#
|
||||
find_in_PATH()
|
||||
|
@ -490,7 +490,7 @@ level of source directory"
|
|||
#
|
||||
# Note that "uname -p" is not part of POSIX, but we want uname_p
|
||||
# to be set to the host MACHINE_ARCH, if possible. On systems
|
||||
# where "uname -p" fails, prints "unknown", or prints a string
|
||||
# where "uname -p" fails, shows "unknown", or shows a string
|
||||
# that does not look like an identifier, fall back to using the
|
||||
# output from "uname -m" instead.
|
||||
#
|
||||
|
@ -906,7 +906,7 @@ listarch()
|
|||
}
|
||||
|
||||
# nobomb_getmakevar --
|
||||
# Given the name of a make variable in $1, print make's idea of the
|
||||
# Given the name of a make variable in $1, show make's idea of the
|
||||
# value of that variable, or return 1 if there's an error.
|
||||
#
|
||||
nobomb_getmakevar()
|
||||
|
@ -921,7 +921,7 @@ EOF
|
|||
}
|
||||
|
||||
# bomb_getmakevar --
|
||||
# Given the name of a make variable in $1, print make's idea of the
|
||||
# Given the name of a make variable in $1, show make's idea of the
|
||||
# value of that variable, or bomb if there's an error.
|
||||
#
|
||||
bomb_getmakevar()
|
||||
|
@ -931,8 +931,8 @@ bomb_getmakevar()
|
|||
}
|
||||
|
||||
# getmakevar --
|
||||
# Given the name of a make variable in $1, print make's idea of the
|
||||
# value of that variable, or print a literal '$' followed by the
|
||||
# Given the name of a make variable in $1, show make's idea of the
|
||||
# value of that variable, or show a literal '$' followed by the
|
||||
# variable name if ${make} is not executable. This is intended for use in
|
||||
# messages that need to be readable even if $make hasn't been built,
|
||||
# such as when build.sh is run with the "-n" option.
|
||||
|
@ -1022,7 +1022,8 @@ resolvepath()
|
|||
eval ${var}=\"\${val}\"
|
||||
}
|
||||
|
||||
# Display synopsis to stdout.
|
||||
# Show synopsis to stdout.
|
||||
#
|
||||
synopsis()
|
||||
{
|
||||
cat <<_usage_
|
||||
|
@ -1038,7 +1039,7 @@ Usage: ${progname} [-EnoPRrUux] [-a ARCH] [-B BID] [-C EXTRAS]
|
|||
_usage_
|
||||
}
|
||||
|
||||
# Display help to stdout.
|
||||
# Show help to stdout.
|
||||
#
|
||||
help()
|
||||
{
|
||||
|
@ -1050,7 +1051,7 @@ help()
|
|||
release Run "make release" (includes kernels & distrib media).
|
||||
|
||||
Other OPERATIONs:
|
||||
help Show this message and exit.
|
||||
help Show this help message, and exit.
|
||||
makewrapper Create ${toolprefix}make-\${MACHINE} wrapper and ${toolprefix}make.
|
||||
Always performed.
|
||||
cleandir Run "make cleandir". [Default unless -u is used]
|
||||
|
@ -1083,8 +1084,8 @@ help()
|
|||
RELEASEDIR/RELEASEMACHINEDIR/installation/installimage.
|
||||
disk-image=TARGET Create bootable disk image in
|
||||
RELEASEDIR/RELEASEMACHINEDIR/binary/gzimg/TARGET.img.gz.
|
||||
params Display various make(1) parameters.
|
||||
list-arch Display a list of valid MACHINE/MACHINE_ARCH values,
|
||||
params Show various make(1) parameters.
|
||||
list-arch Show a list of valid MACHINE/MACHINE_ARCH values,
|
||||
and exit. The list may be narrowed by passing glob
|
||||
patterns or exact values in MACHINE or MACHINE_ARCH.
|
||||
mkrepro-timestamp Show the latest source timestamp used for reproducable
|
||||
|
@ -1102,7 +1103,7 @@ help()
|
|||
-E Set "expert" mode; disables various safety checks.
|
||||
Should not be used without expert knowledge of the build
|
||||
system.
|
||||
-h Print this help message, and exit.
|
||||
-h Show this help message, and exit.
|
||||
-j NJOB Run up to NJOB jobs in parallel; see make(1) -j.
|
||||
-M MOBJ Set obj root directory to MOBJ; sets MAKEOBJDIRPREFIX=MOBJ,
|
||||
unsets MAKEOBJDIR.
|
||||
|
@ -1143,12 +1144,12 @@ help()
|
|||
-X X11SRC Set X11SRCDIR=X11SRC. [Default: /usr/xsrc]
|
||||
-x Set MKX11=yes; build X11 from X11SRCDIR.
|
||||
-Z VAR Unset ("zap") variable VAR.
|
||||
-? Print this help message, and exit.
|
||||
-? Show this help message, and exit.
|
||||
|
||||
_usage_
|
||||
}
|
||||
|
||||
# Display optional error message, help to stderr, and exit 1.
|
||||
# Show optional error message, help to stderr, and exit 1.
|
||||
#
|
||||
usage()
|
||||
{
|
||||
|
@ -1559,9 +1560,10 @@ sanitycheck()
|
|||
done
|
||||
}
|
||||
|
||||
# print_tooldir_make --
|
||||
# Try to find and print a path to an existing
|
||||
# print_tooldir_program --
|
||||
# Try to find and show a path to an existing
|
||||
# ${TOOLDIR}/bin/${toolprefix}program
|
||||
#
|
||||
print_tooldir_program()
|
||||
{
|
||||
local possible_TOP_OBJ
|
||||
|
@ -1615,8 +1617,9 @@ print_tooldir_program()
|
|||
done
|
||||
echo ""
|
||||
}
|
||||
|
||||
# print_tooldir_make --
|
||||
# Try to find and print a path to an existing
|
||||
# Try to find and show a path to an existing
|
||||
# ${TOOLDIR}/bin/${toolprefix}make, for use by rebuildmake() before a
|
||||
# new version of ${toolprefix}make has been built.
|
||||
#
|
||||
|
@ -1634,7 +1637,7 @@ print_tooldir_program()
|
|||
# nobomb_getmakevar to find the correct value for TOOLDIR, and believe the
|
||||
# result only if it's a directory that already exists;
|
||||
# * If a value of TOOLDIR was found above, and if
|
||||
# ${TOOLDIR}/bin/${toolprefix}make exists, print that value.
|
||||
# ${TOOLDIR}/bin/${toolprefix}make exists, show that value.
|
||||
#
|
||||
print_tooldir_make()
|
||||
{
|
||||
|
@ -1758,7 +1761,7 @@ rebuildmake()
|
|||
# Creates the top-level obj directory, because that
|
||||
# is needed by some of the sanity checks.
|
||||
#
|
||||
# Prints status messages reporting the values of several variables.
|
||||
# Shows status messages reporting the values of several variables.
|
||||
#
|
||||
validatemakeparams()
|
||||
{
|
||||
|
@ -2010,7 +2013,7 @@ createmakewrapper()
|
|||
eval cat <<EOF ${makewrapout}
|
||||
#! ${HOST_SH}
|
||||
# Set proper variables to allow easy "make" building of a NetBSD subtree.
|
||||
# Generated from: \$NetBSD: build.sh,v 1.368 2023/04/23 09:54:15 uwe Exp $
|
||||
# Generated from: \$NetBSD: build.sh,v 1.369 2023/05/16 21:39:26 lukem Exp $
|
||||
# with these arguments: ${_args}
|
||||
#
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
.\" $NetBSD: BUILDING.mdoc,v 1.136 2023/05/16 21:21:38 lukem Exp $
|
||||
.\" $NetBSD: BUILDING.mdoc,v 1.137 2023/05/16 21:39:26 lukem Exp $
|
||||
.\"
|
||||
.\" Copyright (c) 2001-2023 The NetBSD Foundation, Inc.
|
||||
.\" All rights reserved.
|
||||
|
@ -33,7 +33,7 @@
|
|||
.\" Toolchain prefix for commands
|
||||
.ds toolprefix nb
|
||||
.
|
||||
.Dd October 13, 2020
|
||||
.Dd May 16, 2023
|
||||
.Dt BUILDING 8
|
||||
.Os NetBSD
|
||||
.
|
||||
|
@ -374,7 +374,7 @@ object directory names, and can be consulted in the
|
|||
configuration file in order to set additional build parameters,
|
||||
such as compiler flags.
|
||||
It will also be used as part of the kernel version string,
|
||||
which can be printed by
|
||||
which can be shown by
|
||||
.Dq Li uname \-v .
|
||||
.DFLTu
|
||||
.
|
||||
|
@ -468,17 +468,17 @@ are shown.
|
|||
Brief messages are shown describing what is being done,
|
||||
but the actual commands executed by
|
||||
.Xr make 1
|
||||
are not displayed.
|
||||
are not shown.
|
||||
.It 2
|
||||
Descriptive messages are shown as above (prefixed with a
|
||||
.Sq # ) ,
|
||||
and ordinary commands performed by
|
||||
.Xr make 1
|
||||
are displayed.
|
||||
are shown.
|
||||
.It 3
|
||||
In addition to the above, all commands performed by
|
||||
.Xr make 1
|
||||
are displayed, even if they would ordinarily have been hidden
|
||||
are shown, even if they would ordinarily have been hidden
|
||||
through use of the
|
||||
.Dq \&@
|
||||
prefix in the relevant makefile.
|
||||
|
@ -996,22 +996,22 @@ This is set automatically when building from the top level, or when using
|
|||
.Sy build.sh .
|
||||
.
|
||||
.It Fl n
|
||||
Display the commands that would have been executed, but do not
|
||||
Show the commands that would have been executed, but do not
|
||||
actually execute them.
|
||||
This will still cause recursion to take place.
|
||||
.
|
||||
.It Fl V Ar var
|
||||
Print
|
||||
Show
|
||||
.Xr make 1 Ns 's
|
||||
idea of the value of
|
||||
.Ar var .
|
||||
Does not build any targets.
|
||||
.
|
||||
.It Em var=value
|
||||
.It Ar var Ns Sy = Ns Ar value
|
||||
Set the variable
|
||||
.Em var
|
||||
.Ar var
|
||||
to
|
||||
.Em value ,
|
||||
.Ar value ,
|
||||
overriding any setting specified by the process environment, the
|
||||
.Sy MAKECONF
|
||||
configuration file, or the system Makefile segments.
|
||||
|
@ -1412,7 +1412,7 @@ but if that fails, then the following set of commands may be used instead:
|
|||
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.
|
||||
to exec a suitable shell instead, or shows an error message.
|
||||
If
|
||||
.Sy HOST_SH
|
||||
is not set explicitly, then
|
||||
|
@ -1484,6 +1484,9 @@ This command first runs the
|
|||
.Sy distribution
|
||||
operation.
|
||||
.
|
||||
.It Sy help
|
||||
Show a help message, and exit.
|
||||
.
|
||||
.It Sy makewrapper
|
||||
Create the
|
||||
.Sy \*[toolprefix]make-MACHINE
|
||||
|
@ -1632,7 +1635,7 @@ Perform
|
|||
.Dq make live-image .
|
||||
.
|
||||
.It Sy list-arch
|
||||
Prints a list of valid
|
||||
Show a list of valid
|
||||
.Sy MACHINE
|
||||
and
|
||||
.Sy MACHINE_ARCH
|
||||
|
@ -1754,7 +1757,7 @@ It is highly recommended that you know what you are doing when
|
|||
you use this option.
|
||||
.
|
||||
.It Fl h
|
||||
Print a help message.
|
||||
Show a help message, and exit.
|
||||
.
|
||||
.It Fl j Ar njob
|
||||
Run up to
|
||||
|
@ -1931,6 +1934,7 @@ from the same source tree without cleaning between builds (in which
|
|||
case, one would specify distinct
|
||||
.Ar obj
|
||||
locations for each).
|
||||
.
|
||||
.It Fl o
|
||||
Set the value of
|
||||
.Sy MKOBJDIRS
|
||||
|
@ -1941,6 +1945,13 @@ Otherwise, it will be automatically set to
|
|||
This default is opposite to the behaviour when not using
|
||||
.Sy build.sh .
|
||||
.
|
||||
.It Fl P
|
||||
Set the value of
|
||||
.Sy MKREPRO
|
||||
and
|
||||
.Sy MKREPRO_TIMESTAMP
|
||||
to the latest source CVS timestamp for reproducible builds.
|
||||
.
|
||||
.It Fl R Ar rel
|
||||
Set the value of
|
||||
.Sy RELEASEDIR
|
||||
|
@ -2037,6 +2048,9 @@ This is propagated to the
|
|||
.Sy \*[toolprefix]make
|
||||
wrapper.
|
||||
.
|
||||
.It Fl ?
|
||||
Show a help message, and exit.
|
||||
.
|
||||
.El
|
||||
.
|
||||
.Ss The \*q\*[toolprefix]make-MACHINE\*q wrapper script
|
||||
|
@ -2091,7 +2105,7 @@ build a complete distribution to a
|
|||
.Sy DESTDIR
|
||||
directory that
|
||||
.Sy build.sh
|
||||
selects (and will display).
|
||||
selects (and will show).
|
||||
.
|
||||
.It
|
||||
.Li "# ./build.sh [options] -U install=/"
|
||||
|
@ -2117,7 +2131,7 @@ and
|
|||
.Sy RELEASEDIR
|
||||
directories that
|
||||
.Sy build.sh
|
||||
selects (and will display).
|
||||
selects (and will show).
|
||||
.Sy MKUPDATE=yes
|
||||
.Pq Fl u
|
||||
is set to prevent the
|
||||
|
|
Loading…
Reference in New Issue