NetBSD/build.sh

1012 lines
25 KiB
Bash
Raw Normal View History

#! /usr/bin/env sh
# $NetBSD: build.sh,v 1.115 2003/09/10 18:05:52 jmmv Exp $
Rework how build.sh functions, so that command line options set various parameters, and a list of "operations" defines what to do. The full usage is show below. Notes: `-b' has been deprecated (it always occurs now) `-d' is replaced by "distribution" `-R rel' onlys sets RELEASEDIR; use "release" to build a release `-k kern' has been replaced by "kernel=kern" `-i idir' has been replaced by "install=idir" -r now occurs before nbmake is rebuilt Add a copyright (long due!). Rework the code to (a KNF inspired) ShellNF. Use functions appropriately. Allow `nb' prefix to be easily changed to something else. Solve world peace (just kidding) This is part of the (never achievable) goal of attempting to make NetBSD easier to build... --8<-- new usage follows --8<-- Usage: build.sh [-EnorUu] [-a arch] [-B buildid] [-D dest] [-j njob] [-M obj] [-m mach] [-O obj] [-R release] [-T tools] [-V var=[value]] [-w wrapper] [operation [...] ] System build operations (all imply "obj" and "tools"): build Run "make build" distribution Run "make distribution" (includes etc/ files) release Run "make release" (includes kernels & distrib media) Other operations: obj Run "make obj" (default unless -o) tools Build and install tools kernel=conf Build kernel with config file `conf' install=idir Run "make installworld" to `idir' (useful after 'distribution' or 'release') Options: -a arch Set MACHINE_ARCH to arch (otherwise deduced from MACHINE) -B buildId Set BUILDID to buildId -D dest Set DESTDIR to dest -E Set "expert" mode; disables some DESTDIR checks -j njob Run up to njob jobs in parallel; see make(1) -M obj Set obj root directory to obj (sets MAKEOBJDIRPREFIX) -m mach Set MACHINE to mach (not required if NetBSD native) -n Show commands that would be executed, but do not execute them -O obj Set obj root directory to obj (sets a MAKEOBJDIR pattern) -o Set MKOBJDIRS=no (do not create objdirs at start of build) -R release Set RELEASEDIR to release -r Remove contents of TOOLDIR and DESTDIR before building -T tools Set TOOLDIR to tools. If unset, and TOOLDIR is not set in the environment, nbmake will be (re)built unconditionally. -U Set UNPRIVED -u Set UPDATE -V v=[val] Set variable `v' to `val' -w wrapper Create nbmake script as wrapper (default: ${TOOLDIR}/bin/nbmake-${MACHINE})
2003-01-23 19:24:08 +03:00
#
# Copyright (c) 2001-2003 The NetBSD Foundation, Inc.
# All rights reserved.
#
# This code is derived from software contributed to The NetBSD Foundation
# by Todd Vierling and Luke Mewburn.
#
# 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.
# 3. All advertising materials mentioning features or use of this software
# must display the following acknowledgement:
# This product includes software developed by the NetBSD
# Foundation, Inc. and its contributors.
# 4. Neither the name of The NetBSD Foundation nor the names of its
# contributors may be used to endorse or promote products derived
# from this software without specific prior written permission.
#
# 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.
#
#
# Top level build wrapper, for a system containing no tools.
#
# This script should run on any POSIX-compliant shell. For systems
# with a strange /bin/sh, "ksh" or "bash" may be an ample alternative.
#
# Note, however, that due to the way the interpreter is invoked above,
# if a POSIX-compliant shell is the first in the PATH, you won't have
# to take any further action.
#
Rework how build.sh functions, so that command line options set various parameters, and a list of "operations" defines what to do. The full usage is show below. Notes: `-b' has been deprecated (it always occurs now) `-d' is replaced by "distribution" `-R rel' onlys sets RELEASEDIR; use "release" to build a release `-k kern' has been replaced by "kernel=kern" `-i idir' has been replaced by "install=idir" -r now occurs before nbmake is rebuilt Add a copyright (long due!). Rework the code to (a KNF inspired) ShellNF. Use functions appropriately. Allow `nb' prefix to be easily changed to something else. Solve world peace (just kidding) This is part of the (never achievable) goal of attempting to make NetBSD easier to build... --8<-- new usage follows --8<-- Usage: build.sh [-EnorUu] [-a arch] [-B buildid] [-D dest] [-j njob] [-M obj] [-m mach] [-O obj] [-R release] [-T tools] [-V var=[value]] [-w wrapper] [operation [...] ] System build operations (all imply "obj" and "tools"): build Run "make build" distribution Run "make distribution" (includes etc/ files) release Run "make release" (includes kernels & distrib media) Other operations: obj Run "make obj" (default unless -o) tools Build and install tools kernel=conf Build kernel with config file `conf' install=idir Run "make installworld" to `idir' (useful after 'distribution' or 'release') Options: -a arch Set MACHINE_ARCH to arch (otherwise deduced from MACHINE) -B buildId Set BUILDID to buildId -D dest Set DESTDIR to dest -E Set "expert" mode; disables some DESTDIR checks -j njob Run up to njob jobs in parallel; see make(1) -M obj Set obj root directory to obj (sets MAKEOBJDIRPREFIX) -m mach Set MACHINE to mach (not required if NetBSD native) -n Show commands that would be executed, but do not execute them -O obj Set obj root directory to obj (sets a MAKEOBJDIR pattern) -o Set MKOBJDIRS=no (do not create objdirs at start of build) -R release Set RELEASEDIR to release -r Remove contents of TOOLDIR and DESTDIR before building -T tools Set TOOLDIR to tools. If unset, and TOOLDIR is not set in the environment, nbmake will be (re)built unconditionally. -U Set UNPRIVED -u Set UPDATE -V v=[val] Set variable `v' to `val' -w wrapper Create nbmake script as wrapper (default: ${TOOLDIR}/bin/nbmake-${MACHINE})
2003-01-23 19:24:08 +03:00
progname=${0##*/}
toppid=$$
results=/dev/null
Rework how build.sh functions, so that command line options set various parameters, and a list of "operations" defines what to do. The full usage is show below. Notes: `-b' has been deprecated (it always occurs now) `-d' is replaced by "distribution" `-R rel' onlys sets RELEASEDIR; use "release" to build a release `-k kern' has been replaced by "kernel=kern" `-i idir' has been replaced by "install=idir" -r now occurs before nbmake is rebuilt Add a copyright (long due!). Rework the code to (a KNF inspired) ShellNF. Use functions appropriately. Allow `nb' prefix to be easily changed to something else. Solve world peace (just kidding) This is part of the (never achievable) goal of attempting to make NetBSD easier to build... --8<-- new usage follows --8<-- Usage: build.sh [-EnorUu] [-a arch] [-B buildid] [-D dest] [-j njob] [-M obj] [-m mach] [-O obj] [-R release] [-T tools] [-V var=[value]] [-w wrapper] [operation [...] ] System build operations (all imply "obj" and "tools"): build Run "make build" distribution Run "make distribution" (includes etc/ files) release Run "make release" (includes kernels & distrib media) Other operations: obj Run "make obj" (default unless -o) tools Build and install tools kernel=conf Build kernel with config file `conf' install=idir Run "make installworld" to `idir' (useful after 'distribution' or 'release') Options: -a arch Set MACHINE_ARCH to arch (otherwise deduced from MACHINE) -B buildId Set BUILDID to buildId -D dest Set DESTDIR to dest -E Set "expert" mode; disables some DESTDIR checks -j njob Run up to njob jobs in parallel; see make(1) -M obj Set obj root directory to obj (sets MAKEOBJDIRPREFIX) -m mach Set MACHINE to mach (not required if NetBSD native) -n Show commands that would be executed, but do not execute them -O obj Set obj root directory to obj (sets a MAKEOBJDIR pattern) -o Set MKOBJDIRS=no (do not create objdirs at start of build) -R release Set RELEASEDIR to release -r Remove contents of TOOLDIR and DESTDIR before building -T tools Set TOOLDIR to tools. If unset, and TOOLDIR is not set in the environment, nbmake will be (re)built unconditionally. -U Set UNPRIVED -u Set UPDATE -V v=[val] Set variable `v' to `val' -w wrapper Create nbmake script as wrapper (default: ${TOOLDIR}/bin/nbmake-${MACHINE})
2003-01-23 19:24:08 +03:00
trap "exit 1" 1 2 3 15
bomb()
{
cat >&2 <<ERRORMESSAGE
ERROR: $@
*** BUILD ABORTED ***
ERRORMESSAGE
kill ${toppid} # in case we were invoked from a subshell
exit 1
}
statusmsg()
{
${runcmd} echo "===> $@" | tee -a "${results}"
}
Rework how build.sh functions, so that command line options set various parameters, and a list of "operations" defines what to do. The full usage is show below. Notes: `-b' has been deprecated (it always occurs now) `-d' is replaced by "distribution" `-R rel' onlys sets RELEASEDIR; use "release" to build a release `-k kern' has been replaced by "kernel=kern" `-i idir' has been replaced by "install=idir" -r now occurs before nbmake is rebuilt Add a copyright (long due!). Rework the code to (a KNF inspired) ShellNF. Use functions appropriately. Allow `nb' prefix to be easily changed to something else. Solve world peace (just kidding) This is part of the (never achievable) goal of attempting to make NetBSD easier to build... --8<-- new usage follows --8<-- Usage: build.sh [-EnorUu] [-a arch] [-B buildid] [-D dest] [-j njob] [-M obj] [-m mach] [-O obj] [-R release] [-T tools] [-V var=[value]] [-w wrapper] [operation [...] ] System build operations (all imply "obj" and "tools"): build Run "make build" distribution Run "make distribution" (includes etc/ files) release Run "make release" (includes kernels & distrib media) Other operations: obj Run "make obj" (default unless -o) tools Build and install tools kernel=conf Build kernel with config file `conf' install=idir Run "make installworld" to `idir' (useful after 'distribution' or 'release') Options: -a arch Set MACHINE_ARCH to arch (otherwise deduced from MACHINE) -B buildId Set BUILDID to buildId -D dest Set DESTDIR to dest -E Set "expert" mode; disables some DESTDIR checks -j njob Run up to njob jobs in parallel; see make(1) -M obj Set obj root directory to obj (sets MAKEOBJDIRPREFIX) -m mach Set MACHINE to mach (not required if NetBSD native) -n Show commands that would be executed, but do not execute them -O obj Set obj root directory to obj (sets a MAKEOBJDIR pattern) -o Set MKOBJDIRS=no (do not create objdirs at start of build) -R release Set RELEASEDIR to release -r Remove contents of TOOLDIR and DESTDIR before building -T tools Set TOOLDIR to tools. If unset, and TOOLDIR is not set in the environment, nbmake will be (re)built unconditionally. -U Set UNPRIVED -u Set UPDATE -V v=[val] Set variable `v' to `val' -w wrapper Create nbmake script as wrapper (default: ${TOOLDIR}/bin/nbmake-${MACHINE})
2003-01-23 19:24:08 +03:00
initdefaults()
{
cd "$(dirname $0)"
[ -d usr.bin/make ] ||
bomb "build.sh must be run from the top source level"
[ -f share/mk/bsd.own.mk ] ||
bomb "src/share/mk is missing; please re-fetch the source tree"
uname_s=$(uname -s 2>/dev/null)
uname_m=$(uname -m 2>/dev/null)
# If $PWD is a valid name of the current directory, POSIX mandates
# that pwd return it by default which causes problems in the
# presence of symlinks. Unsetting PWD is simpler than changing
# every occurrence of pwd to use -P.
#
# XXX Except that doesn't work on Solaris.
#
Rework how build.sh functions, so that command line options set various parameters, and a list of "operations" defines what to do. The full usage is show below. Notes: `-b' has been deprecated (it always occurs now) `-d' is replaced by "distribution" `-R rel' onlys sets RELEASEDIR; use "release" to build a release `-k kern' has been replaced by "kernel=kern" `-i idir' has been replaced by "install=idir" -r now occurs before nbmake is rebuilt Add a copyright (long due!). Rework the code to (a KNF inspired) ShellNF. Use functions appropriately. Allow `nb' prefix to be easily changed to something else. Solve world peace (just kidding) This is part of the (never achievable) goal of attempting to make NetBSD easier to build... --8<-- new usage follows --8<-- Usage: build.sh [-EnorUu] [-a arch] [-B buildid] [-D dest] [-j njob] [-M obj] [-m mach] [-O obj] [-R release] [-T tools] [-V var=[value]] [-w wrapper] [operation [...] ] System build operations (all imply "obj" and "tools"): build Run "make build" distribution Run "make distribution" (includes etc/ files) release Run "make release" (includes kernels & distrib media) Other operations: obj Run "make obj" (default unless -o) tools Build and install tools kernel=conf Build kernel with config file `conf' install=idir Run "make installworld" to `idir' (useful after 'distribution' or 'release') Options: -a arch Set MACHINE_ARCH to arch (otherwise deduced from MACHINE) -B buildId Set BUILDID to buildId -D dest Set DESTDIR to dest -E Set "expert" mode; disables some DESTDIR checks -j njob Run up to njob jobs in parallel; see make(1) -M obj Set obj root directory to obj (sets MAKEOBJDIRPREFIX) -m mach Set MACHINE to mach (not required if NetBSD native) -n Show commands that would be executed, but do not execute them -O obj Set obj root directory to obj (sets a MAKEOBJDIR pattern) -o Set MKOBJDIRS=no (do not create objdirs at start of build) -R release Set RELEASEDIR to release -r Remove contents of TOOLDIR and DESTDIR before building -T tools Set TOOLDIR to tools. If unset, and TOOLDIR is not set in the environment, nbmake will be (re)built unconditionally. -U Set UNPRIVED -u Set UPDATE -V v=[val] Set variable `v' to `val' -w wrapper Create nbmake script as wrapper (default: ${TOOLDIR}/bin/nbmake-${MACHINE})
2003-01-23 19:24:08 +03:00
unset PWD
if [ "${uname_s}" = "SunOS" ]; then
TOP=$(pwd -P)
else
TOP=$(pwd)
fi
Rework how build.sh functions, so that command line options set various parameters, and a list of "operations" defines what to do. The full usage is show below. Notes: `-b' has been deprecated (it always occurs now) `-d' is replaced by "distribution" `-R rel' onlys sets RELEASEDIR; use "release" to build a release `-k kern' has been replaced by "kernel=kern" `-i idir' has been replaced by "install=idir" -r now occurs before nbmake is rebuilt Add a copyright (long due!). Rework the code to (a KNF inspired) ShellNF. Use functions appropriately. Allow `nb' prefix to be easily changed to something else. Solve world peace (just kidding) This is part of the (never achievable) goal of attempting to make NetBSD easier to build... --8<-- new usage follows --8<-- Usage: build.sh [-EnorUu] [-a arch] [-B buildid] [-D dest] [-j njob] [-M obj] [-m mach] [-O obj] [-R release] [-T tools] [-V var=[value]] [-w wrapper] [operation [...] ] System build operations (all imply "obj" and "tools"): build Run "make build" distribution Run "make distribution" (includes etc/ files) release Run "make release" (includes kernels & distrib media) Other operations: obj Run "make obj" (default unless -o) tools Build and install tools kernel=conf Build kernel with config file `conf' install=idir Run "make installworld" to `idir' (useful after 'distribution' or 'release') Options: -a arch Set MACHINE_ARCH to arch (otherwise deduced from MACHINE) -B buildId Set BUILDID to buildId -D dest Set DESTDIR to dest -E Set "expert" mode; disables some DESTDIR checks -j njob Run up to njob jobs in parallel; see make(1) -M obj Set obj root directory to obj (sets MAKEOBJDIRPREFIX) -m mach Set MACHINE to mach (not required if NetBSD native) -n Show commands that would be executed, but do not execute them -O obj Set obj root directory to obj (sets a MAKEOBJDIR pattern) -o Set MKOBJDIRS=no (do not create objdirs at start of build) -R release Set RELEASEDIR to release -r Remove contents of TOOLDIR and DESTDIR before building -T tools Set TOOLDIR to tools. If unset, and TOOLDIR is not set in the environment, nbmake will be (re)built unconditionally. -U Set UNPRIVED -u Set UPDATE -V v=[val] Set variable `v' to `val' -w wrapper Create nbmake script as wrapper (default: ${TOOLDIR}/bin/nbmake-${MACHINE})
2003-01-23 19:24:08 +03:00
# Set defaults.
#
Rework how build.sh functions, so that command line options set various parameters, and a list of "operations" defines what to do. The full usage is show below. Notes: `-b' has been deprecated (it always occurs now) `-d' is replaced by "distribution" `-R rel' onlys sets RELEASEDIR; use "release" to build a release `-k kern' has been replaced by "kernel=kern" `-i idir' has been replaced by "install=idir" -r now occurs before nbmake is rebuilt Add a copyright (long due!). Rework the code to (a KNF inspired) ShellNF. Use functions appropriately. Allow `nb' prefix to be easily changed to something else. Solve world peace (just kidding) This is part of the (never achievable) goal of attempting to make NetBSD easier to build... --8<-- new usage follows --8<-- Usage: build.sh [-EnorUu] [-a arch] [-B buildid] [-D dest] [-j njob] [-M obj] [-m mach] [-O obj] [-R release] [-T tools] [-V var=[value]] [-w wrapper] [operation [...] ] System build operations (all imply "obj" and "tools"): build Run "make build" distribution Run "make distribution" (includes etc/ files) release Run "make release" (includes kernels & distrib media) Other operations: obj Run "make obj" (default unless -o) tools Build and install tools kernel=conf Build kernel with config file `conf' install=idir Run "make installworld" to `idir' (useful after 'distribution' or 'release') Options: -a arch Set MACHINE_ARCH to arch (otherwise deduced from MACHINE) -B buildId Set BUILDID to buildId -D dest Set DESTDIR to dest -E Set "expert" mode; disables some DESTDIR checks -j njob Run up to njob jobs in parallel; see make(1) -M obj Set obj root directory to obj (sets MAKEOBJDIRPREFIX) -m mach Set MACHINE to mach (not required if NetBSD native) -n Show commands that would be executed, but do not execute them -O obj Set obj root directory to obj (sets a MAKEOBJDIR pattern) -o Set MKOBJDIRS=no (do not create objdirs at start of build) -R release Set RELEASEDIR to release -r Remove contents of TOOLDIR and DESTDIR before building -T tools Set TOOLDIR to tools. If unset, and TOOLDIR is not set in the environment, nbmake will be (re)built unconditionally. -U Set UNPRIVED -u Set UPDATE -V v=[val] Set variable `v' to `val' -w wrapper Create nbmake script as wrapper (default: ${TOOLDIR}/bin/nbmake-${MACHINE})
2003-01-23 19:24:08 +03:00
toolprefix=nb
# Some systems have a small ARG_MAX. -X prevents make(1) from
# exporting variables in the environment redundantly.
#
case "${uname_s}" in
2003-05-08 16:49:45 +04:00
Darwin | FreeBSD | CYGWIN*)
MAKEFLAGS=-X
;;
*)
MAKEFLAGS=
;;
esac
Rework how build.sh functions, so that command line options set various parameters, and a list of "operations" defines what to do. The full usage is show below. Notes: `-b' has been deprecated (it always occurs now) `-d' is replaced by "distribution" `-R rel' onlys sets RELEASEDIR; use "release" to build a release `-k kern' has been replaced by "kernel=kern" `-i idir' has been replaced by "install=idir" -r now occurs before nbmake is rebuilt Add a copyright (long due!). Rework the code to (a KNF inspired) ShellNF. Use functions appropriately. Allow `nb' prefix to be easily changed to something else. Solve world peace (just kidding) This is part of the (never achievable) goal of attempting to make NetBSD easier to build... --8<-- new usage follows --8<-- Usage: build.sh [-EnorUu] [-a arch] [-B buildid] [-D dest] [-j njob] [-M obj] [-m mach] [-O obj] [-R release] [-T tools] [-V var=[value]] [-w wrapper] [operation [...] ] System build operations (all imply "obj" and "tools"): build Run "make build" distribution Run "make distribution" (includes etc/ files) release Run "make release" (includes kernels & distrib media) Other operations: obj Run "make obj" (default unless -o) tools Build and install tools kernel=conf Build kernel with config file `conf' install=idir Run "make installworld" to `idir' (useful after 'distribution' or 'release') Options: -a arch Set MACHINE_ARCH to arch (otherwise deduced from MACHINE) -B buildId Set BUILDID to buildId -D dest Set DESTDIR to dest -E Set "expert" mode; disables some DESTDIR checks -j njob Run up to njob jobs in parallel; see make(1) -M obj Set obj root directory to obj (sets MAKEOBJDIRPREFIX) -m mach Set MACHINE to mach (not required if NetBSD native) -n Show commands that would be executed, but do not execute them -O obj Set obj root directory to obj (sets a MAKEOBJDIR pattern) -o Set MKOBJDIRS=no (do not create objdirs at start of build) -R release Set RELEASEDIR to release -r Remove contents of TOOLDIR and DESTDIR before building -T tools Set TOOLDIR to tools. If unset, and TOOLDIR is not set in the environment, nbmake will be (re)built unconditionally. -U Set UNPRIVED -u Set UPDATE -V v=[val] Set variable `v' to `val' -w wrapper Create nbmake script as wrapper (default: ${TOOLDIR}/bin/nbmake-${MACHINE})
2003-01-23 19:24:08 +03:00
makeenv=
makewrapper=
makewrappermachine=
Rework how build.sh functions, so that command line options set various parameters, and a list of "operations" defines what to do. The full usage is show below. Notes: `-b' has been deprecated (it always occurs now) `-d' is replaced by "distribution" `-R rel' onlys sets RELEASEDIR; use "release" to build a release `-k kern' has been replaced by "kernel=kern" `-i idir' has been replaced by "install=idir" -r now occurs before nbmake is rebuilt Add a copyright (long due!). Rework the code to (a KNF inspired) ShellNF. Use functions appropriately. Allow `nb' prefix to be easily changed to something else. Solve world peace (just kidding) This is part of the (never achievable) goal of attempting to make NetBSD easier to build... --8<-- new usage follows --8<-- Usage: build.sh [-EnorUu] [-a arch] [-B buildid] [-D dest] [-j njob] [-M obj] [-m mach] [-O obj] [-R release] [-T tools] [-V var=[value]] [-w wrapper] [operation [...] ] System build operations (all imply "obj" and "tools"): build Run "make build" distribution Run "make distribution" (includes etc/ files) release Run "make release" (includes kernels & distrib media) Other operations: obj Run "make obj" (default unless -o) tools Build and install tools kernel=conf Build kernel with config file `conf' install=idir Run "make installworld" to `idir' (useful after 'distribution' or 'release') Options: -a arch Set MACHINE_ARCH to arch (otherwise deduced from MACHINE) -B buildId Set BUILDID to buildId -D dest Set DESTDIR to dest -E Set "expert" mode; disables some DESTDIR checks -j njob Run up to njob jobs in parallel; see make(1) -M obj Set obj root directory to obj (sets MAKEOBJDIRPREFIX) -m mach Set MACHINE to mach (not required if NetBSD native) -n Show commands that would be executed, but do not execute them -O obj Set obj root directory to obj (sets a MAKEOBJDIR pattern) -o Set MKOBJDIRS=no (do not create objdirs at start of build) -R release Set RELEASEDIR to release -r Remove contents of TOOLDIR and DESTDIR before building -T tools Set TOOLDIR to tools. If unset, and TOOLDIR is not set in the environment, nbmake will be (re)built unconditionally. -U Set UNPRIVED -u Set UPDATE -V v=[val] Set variable `v' to `val' -w wrapper Create nbmake script as wrapper (default: ${TOOLDIR}/bin/nbmake-${MACHINE})
2003-01-23 19:24:08 +03:00
runcmd=
operations=
removedirs=
do_expertmode=false
do_rebuildmake=false
do_removedirs=false
# do_{operation}=true if given operation is requested.
#
do_tools=false
do_obj=false
do_build=false
do_distribution=false
do_release=false
do_kernel=false
do_releasekernel=false
Rework how build.sh functions, so that command line options set various parameters, and a list of "operations" defines what to do. The full usage is show below. Notes: `-b' has been deprecated (it always occurs now) `-d' is replaced by "distribution" `-R rel' onlys sets RELEASEDIR; use "release" to build a release `-k kern' has been replaced by "kernel=kern" `-i idir' has been replaced by "install=idir" -r now occurs before nbmake is rebuilt Add a copyright (long due!). Rework the code to (a KNF inspired) ShellNF. Use functions appropriately. Allow `nb' prefix to be easily changed to something else. Solve world peace (just kidding) This is part of the (never achievable) goal of attempting to make NetBSD easier to build... --8<-- new usage follows --8<-- Usage: build.sh [-EnorUu] [-a arch] [-B buildid] [-D dest] [-j njob] [-M obj] [-m mach] [-O obj] [-R release] [-T tools] [-V var=[value]] [-w wrapper] [operation [...] ] System build operations (all imply "obj" and "tools"): build Run "make build" distribution Run "make distribution" (includes etc/ files) release Run "make release" (includes kernels & distrib media) Other operations: obj Run "make obj" (default unless -o) tools Build and install tools kernel=conf Build kernel with config file `conf' install=idir Run "make installworld" to `idir' (useful after 'distribution' or 'release') Options: -a arch Set MACHINE_ARCH to arch (otherwise deduced from MACHINE) -B buildId Set BUILDID to buildId -D dest Set DESTDIR to dest -E Set "expert" mode; disables some DESTDIR checks -j njob Run up to njob jobs in parallel; see make(1) -M obj Set obj root directory to obj (sets MAKEOBJDIRPREFIX) -m mach Set MACHINE to mach (not required if NetBSD native) -n Show commands that would be executed, but do not execute them -O obj Set obj root directory to obj (sets a MAKEOBJDIR pattern) -o Set MKOBJDIRS=no (do not create objdirs at start of build) -R release Set RELEASEDIR to release -r Remove contents of TOOLDIR and DESTDIR before building -T tools Set TOOLDIR to tools. If unset, and TOOLDIR is not set in the environment, nbmake will be (re)built unconditionally. -U Set UNPRIVED -u Set UPDATE -V v=[val] Set variable `v' to `val' -w wrapper Create nbmake script as wrapper (default: ${TOOLDIR}/bin/nbmake-${MACHINE})
2003-01-23 19:24:08 +03:00
do_install=false
do_sets=false
do_sourcesets=false
2003-07-16 17:21:47 +04:00
do_params=false
# Create scratch directory
#
tmpdir="${TMPDIR-/tmp}/nbbuild$$"
mkdir "${tmpdir}" || bomb "Cannot mkdir: ${tmpdir}"
trap "cd /; rm -r -f \"${tmpdir}\"" 0
results="${tmpdir}/build.sh.results"
Rework how build.sh functions, so that command line options set various parameters, and a list of "operations" defines what to do. The full usage is show below. Notes: `-b' has been deprecated (it always occurs now) `-d' is replaced by "distribution" `-R rel' onlys sets RELEASEDIR; use "release" to build a release `-k kern' has been replaced by "kernel=kern" `-i idir' has been replaced by "install=idir" -r now occurs before nbmake is rebuilt Add a copyright (long due!). Rework the code to (a KNF inspired) ShellNF. Use functions appropriately. Allow `nb' prefix to be easily changed to something else. Solve world peace (just kidding) This is part of the (never achievable) goal of attempting to make NetBSD easier to build... --8<-- new usage follows --8<-- Usage: build.sh [-EnorUu] [-a arch] [-B buildid] [-D dest] [-j njob] [-M obj] [-m mach] [-O obj] [-R release] [-T tools] [-V var=[value]] [-w wrapper] [operation [...] ] System build operations (all imply "obj" and "tools"): build Run "make build" distribution Run "make distribution" (includes etc/ files) release Run "make release" (includes kernels & distrib media) Other operations: obj Run "make obj" (default unless -o) tools Build and install tools kernel=conf Build kernel with config file `conf' install=idir Run "make installworld" to `idir' (useful after 'distribution' or 'release') Options: -a arch Set MACHINE_ARCH to arch (otherwise deduced from MACHINE) -B buildId Set BUILDID to buildId -D dest Set DESTDIR to dest -E Set "expert" mode; disables some DESTDIR checks -j njob Run up to njob jobs in parallel; see make(1) -M obj Set obj root directory to obj (sets MAKEOBJDIRPREFIX) -m mach Set MACHINE to mach (not required if NetBSD native) -n Show commands that would be executed, but do not execute them -O obj Set obj root directory to obj (sets a MAKEOBJDIR pattern) -o Set MKOBJDIRS=no (do not create objdirs at start of build) -R release Set RELEASEDIR to release -r Remove contents of TOOLDIR and DESTDIR before building -T tools Set TOOLDIR to tools. If unset, and TOOLDIR is not set in the environment, nbmake will be (re)built unconditionally. -U Set UNPRIVED -u Set UPDATE -V v=[val] Set variable `v' to `val' -w wrapper Create nbmake script as wrapper (default: ${TOOLDIR}/bin/nbmake-${MACHINE})
2003-01-23 19:24:08 +03:00
}
getarch()
{
# Translate a MACHINE into a default MACHINE_ARCH.
Rework how build.sh functions, so that command line options set various parameters, and a list of "operations" defines what to do. The full usage is show below. Notes: `-b' has been deprecated (it always occurs now) `-d' is replaced by "distribution" `-R rel' onlys sets RELEASEDIR; use "release" to build a release `-k kern' has been replaced by "kernel=kern" `-i idir' has been replaced by "install=idir" -r now occurs before nbmake is rebuilt Add a copyright (long due!). Rework the code to (a KNF inspired) ShellNF. Use functions appropriately. Allow `nb' prefix to be easily changed to something else. Solve world peace (just kidding) This is part of the (never achievable) goal of attempting to make NetBSD easier to build... --8<-- new usage follows --8<-- Usage: build.sh [-EnorUu] [-a arch] [-B buildid] [-D dest] [-j njob] [-M obj] [-m mach] [-O obj] [-R release] [-T tools] [-V var=[value]] [-w wrapper] [operation [...] ] System build operations (all imply "obj" and "tools"): build Run "make build" distribution Run "make distribution" (includes etc/ files) release Run "make release" (includes kernels & distrib media) Other operations: obj Run "make obj" (default unless -o) tools Build and install tools kernel=conf Build kernel with config file `conf' install=idir Run "make installworld" to `idir' (useful after 'distribution' or 'release') Options: -a arch Set MACHINE_ARCH to arch (otherwise deduced from MACHINE) -B buildId Set BUILDID to buildId -D dest Set DESTDIR to dest -E Set "expert" mode; disables some DESTDIR checks -j njob Run up to njob jobs in parallel; see make(1) -M obj Set obj root directory to obj (sets MAKEOBJDIRPREFIX) -m mach Set MACHINE to mach (not required if NetBSD native) -n Show commands that would be executed, but do not execute them -O obj Set obj root directory to obj (sets a MAKEOBJDIR pattern) -o Set MKOBJDIRS=no (do not create objdirs at start of build) -R release Set RELEASEDIR to release -r Remove contents of TOOLDIR and DESTDIR before building -T tools Set TOOLDIR to tools. If unset, and TOOLDIR is not set in the environment, nbmake will be (re)built unconditionally. -U Set UNPRIVED -u Set UPDATE -V v=[val] Set variable `v' to `val' -w wrapper Create nbmake script as wrapper (default: ${TOOLDIR}/bin/nbmake-${MACHINE})
2003-01-23 19:24:08 +03:00
#
case "${MACHINE}" in
acorn26|acorn32|cats|evbarm|hpcarm|netwinder|shark)
Rework how build.sh functions, so that command line options set various parameters, and a list of "operations" defines what to do. The full usage is show below. Notes: `-b' has been deprecated (it always occurs now) `-d' is replaced by "distribution" `-R rel' onlys sets RELEASEDIR; use "release" to build a release `-k kern' has been replaced by "kernel=kern" `-i idir' has been replaced by "install=idir" -r now occurs before nbmake is rebuilt Add a copyright (long due!). Rework the code to (a KNF inspired) ShellNF. Use functions appropriately. Allow `nb' prefix to be easily changed to something else. Solve world peace (just kidding) This is part of the (never achievable) goal of attempting to make NetBSD easier to build... --8<-- new usage follows --8<-- Usage: build.sh [-EnorUu] [-a arch] [-B buildid] [-D dest] [-j njob] [-M obj] [-m mach] [-O obj] [-R release] [-T tools] [-V var=[value]] [-w wrapper] [operation [...] ] System build operations (all imply "obj" and "tools"): build Run "make build" distribution Run "make distribution" (includes etc/ files) release Run "make release" (includes kernels & distrib media) Other operations: obj Run "make obj" (default unless -o) tools Build and install tools kernel=conf Build kernel with config file `conf' install=idir Run "make installworld" to `idir' (useful after 'distribution' or 'release') Options: -a arch Set MACHINE_ARCH to arch (otherwise deduced from MACHINE) -B buildId Set BUILDID to buildId -D dest Set DESTDIR to dest -E Set "expert" mode; disables some DESTDIR checks -j njob Run up to njob jobs in parallel; see make(1) -M obj Set obj root directory to obj (sets MAKEOBJDIRPREFIX) -m mach Set MACHINE to mach (not required if NetBSD native) -n Show commands that would be executed, but do not execute them -O obj Set obj root directory to obj (sets a MAKEOBJDIR pattern) -o Set MKOBJDIRS=no (do not create objdirs at start of build) -R release Set RELEASEDIR to release -r Remove contents of TOOLDIR and DESTDIR before building -T tools Set TOOLDIR to tools. If unset, and TOOLDIR is not set in the environment, nbmake will be (re)built unconditionally. -U Set UNPRIVED -u Set UPDATE -V v=[val] Set variable `v' to `val' -w wrapper Create nbmake script as wrapper (default: ${TOOLDIR}/bin/nbmake-${MACHINE})
2003-01-23 19:24:08 +03:00
MACHINE_ARCH=arm
;;
hp700)
MACHINE_ARCH=hppa
;;
Rework how build.sh functions, so that command line options set various parameters, and a list of "operations" defines what to do. The full usage is show below. Notes: `-b' has been deprecated (it always occurs now) `-d' is replaced by "distribution" `-R rel' onlys sets RELEASEDIR; use "release" to build a release `-k kern' has been replaced by "kernel=kern" `-i idir' has been replaced by "install=idir" -r now occurs before nbmake is rebuilt Add a copyright (long due!). Rework the code to (a KNF inspired) ShellNF. Use functions appropriately. Allow `nb' prefix to be easily changed to something else. Solve world peace (just kidding) This is part of the (never achievable) goal of attempting to make NetBSD easier to build... --8<-- new usage follows --8<-- Usage: build.sh [-EnorUu] [-a arch] [-B buildid] [-D dest] [-j njob] [-M obj] [-m mach] [-O obj] [-R release] [-T tools] [-V var=[value]] [-w wrapper] [operation [...] ] System build operations (all imply "obj" and "tools"): build Run "make build" distribution Run "make distribution" (includes etc/ files) release Run "make release" (includes kernels & distrib media) Other operations: obj Run "make obj" (default unless -o) tools Build and install tools kernel=conf Build kernel with config file `conf' install=idir Run "make installworld" to `idir' (useful after 'distribution' or 'release') Options: -a arch Set MACHINE_ARCH to arch (otherwise deduced from MACHINE) -B buildId Set BUILDID to buildId -D dest Set DESTDIR to dest -E Set "expert" mode; disables some DESTDIR checks -j njob Run up to njob jobs in parallel; see make(1) -M obj Set obj root directory to obj (sets MAKEOBJDIRPREFIX) -m mach Set MACHINE to mach (not required if NetBSD native) -n Show commands that would be executed, but do not execute them -O obj Set obj root directory to obj (sets a MAKEOBJDIR pattern) -o Set MKOBJDIRS=no (do not create objdirs at start of build) -R release Set RELEASEDIR to release -r Remove contents of TOOLDIR and DESTDIR before building -T tools Set TOOLDIR to tools. If unset, and TOOLDIR is not set in the environment, nbmake will be (re)built unconditionally. -U Set UNPRIVED -u Set UPDATE -V v=[val] Set variable `v' to `val' -w wrapper Create nbmake script as wrapper (default: ${TOOLDIR}/bin/nbmake-${MACHINE})
2003-01-23 19:24:08 +03:00
sun2)
MACHINE_ARCH=m68000
;;
amiga|atari|cesfic|hp300|luna68k|mac68k|mvme68k|news68k|next68k|sun3|x68k)
Rework how build.sh functions, so that command line options set various parameters, and a list of "operations" defines what to do. The full usage is show below. Notes: `-b' has been deprecated (it always occurs now) `-d' is replaced by "distribution" `-R rel' onlys sets RELEASEDIR; use "release" to build a release `-k kern' has been replaced by "kernel=kern" `-i idir' has been replaced by "install=idir" -r now occurs before nbmake is rebuilt Add a copyright (long due!). Rework the code to (a KNF inspired) ShellNF. Use functions appropriately. Allow `nb' prefix to be easily changed to something else. Solve world peace (just kidding) This is part of the (never achievable) goal of attempting to make NetBSD easier to build... --8<-- new usage follows --8<-- Usage: build.sh [-EnorUu] [-a arch] [-B buildid] [-D dest] [-j njob] [-M obj] [-m mach] [-O obj] [-R release] [-T tools] [-V var=[value]] [-w wrapper] [operation [...] ] System build operations (all imply "obj" and "tools"): build Run "make build" distribution Run "make distribution" (includes etc/ files) release Run "make release" (includes kernels & distrib media) Other operations: obj Run "make obj" (default unless -o) tools Build and install tools kernel=conf Build kernel with config file `conf' install=idir Run "make installworld" to `idir' (useful after 'distribution' or 'release') Options: -a arch Set MACHINE_ARCH to arch (otherwise deduced from MACHINE) -B buildId Set BUILDID to buildId -D dest Set DESTDIR to dest -E Set "expert" mode; disables some DESTDIR checks -j njob Run up to njob jobs in parallel; see make(1) -M obj Set obj root directory to obj (sets MAKEOBJDIRPREFIX) -m mach Set MACHINE to mach (not required if NetBSD native) -n Show commands that would be executed, but do not execute them -O obj Set obj root directory to obj (sets a MAKEOBJDIR pattern) -o Set MKOBJDIRS=no (do not create objdirs at start of build) -R release Set RELEASEDIR to release -r Remove contents of TOOLDIR and DESTDIR before building -T tools Set TOOLDIR to tools. If unset, and TOOLDIR is not set in the environment, nbmake will be (re)built unconditionally. -U Set UNPRIVED -u Set UPDATE -V v=[val] Set variable `v' to `val' -w wrapper Create nbmake script as wrapper (default: ${TOOLDIR}/bin/nbmake-${MACHINE})
2003-01-23 19:24:08 +03:00
MACHINE_ARCH=m68k
;;
evbmips-e[bl]|sbmips-e[bl])
MACHINE_ARCH=mips${MACHINE##*-}
makewrappermachine=${MACHINE}
MACHINE=${MACHINE%-e[bl]}
;;
evbmips|sbmips) # no default MACHINE_ARCH
;;
mipsco|newsmips|sgimips)
Rework how build.sh functions, so that command line options set various parameters, and a list of "operations" defines what to do. The full usage is show below. Notes: `-b' has been deprecated (it always occurs now) `-d' is replaced by "distribution" `-R rel' onlys sets RELEASEDIR; use "release" to build a release `-k kern' has been replaced by "kernel=kern" `-i idir' has been replaced by "install=idir" -r now occurs before nbmake is rebuilt Add a copyright (long due!). Rework the code to (a KNF inspired) ShellNF. Use functions appropriately. Allow `nb' prefix to be easily changed to something else. Solve world peace (just kidding) This is part of the (never achievable) goal of attempting to make NetBSD easier to build... --8<-- new usage follows --8<-- Usage: build.sh [-EnorUu] [-a arch] [-B buildid] [-D dest] [-j njob] [-M obj] [-m mach] [-O obj] [-R release] [-T tools] [-V var=[value]] [-w wrapper] [operation [...] ] System build operations (all imply "obj" and "tools"): build Run "make build" distribution Run "make distribution" (includes etc/ files) release Run "make release" (includes kernels & distrib media) Other operations: obj Run "make obj" (default unless -o) tools Build and install tools kernel=conf Build kernel with config file `conf' install=idir Run "make installworld" to `idir' (useful after 'distribution' or 'release') Options: -a arch Set MACHINE_ARCH to arch (otherwise deduced from MACHINE) -B buildId Set BUILDID to buildId -D dest Set DESTDIR to dest -E Set "expert" mode; disables some DESTDIR checks -j njob Run up to njob jobs in parallel; see make(1) -M obj Set obj root directory to obj (sets MAKEOBJDIRPREFIX) -m mach Set MACHINE to mach (not required if NetBSD native) -n Show commands that would be executed, but do not execute them -O obj Set obj root directory to obj (sets a MAKEOBJDIR pattern) -o Set MKOBJDIRS=no (do not create objdirs at start of build) -R release Set RELEASEDIR to release -r Remove contents of TOOLDIR and DESTDIR before building -T tools Set TOOLDIR to tools. If unset, and TOOLDIR is not set in the environment, nbmake will be (re)built unconditionally. -U Set UNPRIVED -u Set UPDATE -V v=[val] Set variable `v' to `val' -w wrapper Create nbmake script as wrapper (default: ${TOOLDIR}/bin/nbmake-${MACHINE})
2003-01-23 19:24:08 +03:00
MACHINE_ARCH=mipseb
;;
algor|arc|cobalt|hpcmips|playstation2|pmax)
Rework how build.sh functions, so that command line options set various parameters, and a list of "operations" defines what to do. The full usage is show below. Notes: `-b' has been deprecated (it always occurs now) `-d' is replaced by "distribution" `-R rel' onlys sets RELEASEDIR; use "release" to build a release `-k kern' has been replaced by "kernel=kern" `-i idir' has been replaced by "install=idir" -r now occurs before nbmake is rebuilt Add a copyright (long due!). Rework the code to (a KNF inspired) ShellNF. Use functions appropriately. Allow `nb' prefix to be easily changed to something else. Solve world peace (just kidding) This is part of the (never achievable) goal of attempting to make NetBSD easier to build... --8<-- new usage follows --8<-- Usage: build.sh [-EnorUu] [-a arch] [-B buildid] [-D dest] [-j njob] [-M obj] [-m mach] [-O obj] [-R release] [-T tools] [-V var=[value]] [-w wrapper] [operation [...] ] System build operations (all imply "obj" and "tools"): build Run "make build" distribution Run "make distribution" (includes etc/ files) release Run "make release" (includes kernels & distrib media) Other operations: obj Run "make obj" (default unless -o) tools Build and install tools kernel=conf Build kernel with config file `conf' install=idir Run "make installworld" to `idir' (useful after 'distribution' or 'release') Options: -a arch Set MACHINE_ARCH to arch (otherwise deduced from MACHINE) -B buildId Set BUILDID to buildId -D dest Set DESTDIR to dest -E Set "expert" mode; disables some DESTDIR checks -j njob Run up to njob jobs in parallel; see make(1) -M obj Set obj root directory to obj (sets MAKEOBJDIRPREFIX) -m mach Set MACHINE to mach (not required if NetBSD native) -n Show commands that would be executed, but do not execute them -O obj Set obj root directory to obj (sets a MAKEOBJDIR pattern) -o Set MKOBJDIRS=no (do not create objdirs at start of build) -R release Set RELEASEDIR to release -r Remove contents of TOOLDIR and DESTDIR before building -T tools Set TOOLDIR to tools. If unset, and TOOLDIR is not set in the environment, nbmake will be (re)built unconditionally. -U Set UNPRIVED -u Set UPDATE -V v=[val] Set variable `v' to `val' -w wrapper Create nbmake script as wrapper (default: ${TOOLDIR}/bin/nbmake-${MACHINE})
2003-01-23 19:24:08 +03:00
MACHINE_ARCH=mipsel
;;
Rework how build.sh functions, so that command line options set various parameters, and a list of "operations" defines what to do. The full usage is show below. Notes: `-b' has been deprecated (it always occurs now) `-d' is replaced by "distribution" `-R rel' onlys sets RELEASEDIR; use "release" to build a release `-k kern' has been replaced by "kernel=kern" `-i idir' has been replaced by "install=idir" -r now occurs before nbmake is rebuilt Add a copyright (long due!). Rework the code to (a KNF inspired) ShellNF. Use functions appropriately. Allow `nb' prefix to be easily changed to something else. Solve world peace (just kidding) This is part of the (never achievable) goal of attempting to make NetBSD easier to build... --8<-- new usage follows --8<-- Usage: build.sh [-EnorUu] [-a arch] [-B buildid] [-D dest] [-j njob] [-M obj] [-m mach] [-O obj] [-R release] [-T tools] [-V var=[value]] [-w wrapper] [operation [...] ] System build operations (all imply "obj" and "tools"): build Run "make build" distribution Run "make distribution" (includes etc/ files) release Run "make release" (includes kernels & distrib media) Other operations: obj Run "make obj" (default unless -o) tools Build and install tools kernel=conf Build kernel with config file `conf' install=idir Run "make installworld" to `idir' (useful after 'distribution' or 'release') Options: -a arch Set MACHINE_ARCH to arch (otherwise deduced from MACHINE) -B buildId Set BUILDID to buildId -D dest Set DESTDIR to dest -E Set "expert" mode; disables some DESTDIR checks -j njob Run up to njob jobs in parallel; see make(1) -M obj Set obj root directory to obj (sets MAKEOBJDIRPREFIX) -m mach Set MACHINE to mach (not required if NetBSD native) -n Show commands that would be executed, but do not execute them -O obj Set obj root directory to obj (sets a MAKEOBJDIR pattern) -o Set MKOBJDIRS=no (do not create objdirs at start of build) -R release Set RELEASEDIR to release -r Remove contents of TOOLDIR and DESTDIR before building -T tools Set TOOLDIR to tools. If unset, and TOOLDIR is not set in the environment, nbmake will be (re)built unconditionally. -U Set UNPRIVED -u Set UPDATE -V v=[val] Set variable `v' to `val' -w wrapper Create nbmake script as wrapper (default: ${TOOLDIR}/bin/nbmake-${MACHINE})
2003-01-23 19:24:08 +03:00
pc532)
MACHINE_ARCH=ns32k
;;
amigappc|bebox|evbppc|macppc|mvmeppc|ofppc|pmppc|prep|sandpoint)
Rework how build.sh functions, so that command line options set various parameters, and a list of "operations" defines what to do. The full usage is show below. Notes: `-b' has been deprecated (it always occurs now) `-d' is replaced by "distribution" `-R rel' onlys sets RELEASEDIR; use "release" to build a release `-k kern' has been replaced by "kernel=kern" `-i idir' has been replaced by "install=idir" -r now occurs before nbmake is rebuilt Add a copyright (long due!). Rework the code to (a KNF inspired) ShellNF. Use functions appropriately. Allow `nb' prefix to be easily changed to something else. Solve world peace (just kidding) This is part of the (never achievable) goal of attempting to make NetBSD easier to build... --8<-- new usage follows --8<-- Usage: build.sh [-EnorUu] [-a arch] [-B buildid] [-D dest] [-j njob] [-M obj] [-m mach] [-O obj] [-R release] [-T tools] [-V var=[value]] [-w wrapper] [operation [...] ] System build operations (all imply "obj" and "tools"): build Run "make build" distribution Run "make distribution" (includes etc/ files) release Run "make release" (includes kernels & distrib media) Other operations: obj Run "make obj" (default unless -o) tools Build and install tools kernel=conf Build kernel with config file `conf' install=idir Run "make installworld" to `idir' (useful after 'distribution' or 'release') Options: -a arch Set MACHINE_ARCH to arch (otherwise deduced from MACHINE) -B buildId Set BUILDID to buildId -D dest Set DESTDIR to dest -E Set "expert" mode; disables some DESTDIR checks -j njob Run up to njob jobs in parallel; see make(1) -M obj Set obj root directory to obj (sets MAKEOBJDIRPREFIX) -m mach Set MACHINE to mach (not required if NetBSD native) -n Show commands that would be executed, but do not execute them -O obj Set obj root directory to obj (sets a MAKEOBJDIR pattern) -o Set MKOBJDIRS=no (do not create objdirs at start of build) -R release Set RELEASEDIR to release -r Remove contents of TOOLDIR and DESTDIR before building -T tools Set TOOLDIR to tools. If unset, and TOOLDIR is not set in the environment, nbmake will be (re)built unconditionally. -U Set UNPRIVED -u Set UPDATE -V v=[val] Set variable `v' to `val' -w wrapper Create nbmake script as wrapper (default: ${TOOLDIR}/bin/nbmake-${MACHINE})
2003-01-23 19:24:08 +03:00
MACHINE_ARCH=powerpc
;;
evbsh3-e[bl])
MACHINE_ARCH=sh3${MACHINE##*-}
makewrappermachine=${MACHINE}
MACHINE=${MACHINE%-e[bl]}
;;
evbsh3) # no default MACHINE_ARCH
;;
mmeye)
Rework how build.sh functions, so that command line options set various parameters, and a list of "operations" defines what to do. The full usage is show below. Notes: `-b' has been deprecated (it always occurs now) `-d' is replaced by "distribution" `-R rel' onlys sets RELEASEDIR; use "release" to build a release `-k kern' has been replaced by "kernel=kern" `-i idir' has been replaced by "install=idir" -r now occurs before nbmake is rebuilt Add a copyright (long due!). Rework the code to (a KNF inspired) ShellNF. Use functions appropriately. Allow `nb' prefix to be easily changed to something else. Solve world peace (just kidding) This is part of the (never achievable) goal of attempting to make NetBSD easier to build... --8<-- new usage follows --8<-- Usage: build.sh [-EnorUu] [-a arch] [-B buildid] [-D dest] [-j njob] [-M obj] [-m mach] [-O obj] [-R release] [-T tools] [-V var=[value]] [-w wrapper] [operation [...] ] System build operations (all imply "obj" and "tools"): build Run "make build" distribution Run "make distribution" (includes etc/ files) release Run "make release" (includes kernels & distrib media) Other operations: obj Run "make obj" (default unless -o) tools Build and install tools kernel=conf Build kernel with config file `conf' install=idir Run "make installworld" to `idir' (useful after 'distribution' or 'release') Options: -a arch Set MACHINE_ARCH to arch (otherwise deduced from MACHINE) -B buildId Set BUILDID to buildId -D dest Set DESTDIR to dest -E Set "expert" mode; disables some DESTDIR checks -j njob Run up to njob jobs in parallel; see make(1) -M obj Set obj root directory to obj (sets MAKEOBJDIRPREFIX) -m mach Set MACHINE to mach (not required if NetBSD native) -n Show commands that would be executed, but do not execute them -O obj Set obj root directory to obj (sets a MAKEOBJDIR pattern) -o Set MKOBJDIRS=no (do not create objdirs at start of build) -R release Set RELEASEDIR to release -r Remove contents of TOOLDIR and DESTDIR before building -T tools Set TOOLDIR to tools. If unset, and TOOLDIR is not set in the environment, nbmake will be (re)built unconditionally. -U Set UNPRIVED -u Set UPDATE -V v=[val] Set variable `v' to `val' -w wrapper Create nbmake script as wrapper (default: ${TOOLDIR}/bin/nbmake-${MACHINE})
2003-01-23 19:24:08 +03:00
MACHINE_ARCH=sh3eb
;;
Rework how build.sh functions, so that command line options set various parameters, and a list of "operations" defines what to do. The full usage is show below. Notes: `-b' has been deprecated (it always occurs now) `-d' is replaced by "distribution" `-R rel' onlys sets RELEASEDIR; use "release" to build a release `-k kern' has been replaced by "kernel=kern" `-i idir' has been replaced by "install=idir" -r now occurs before nbmake is rebuilt Add a copyright (long due!). Rework the code to (a KNF inspired) ShellNF. Use functions appropriately. Allow `nb' prefix to be easily changed to something else. Solve world peace (just kidding) This is part of the (never achievable) goal of attempting to make NetBSD easier to build... --8<-- new usage follows --8<-- Usage: build.sh [-EnorUu] [-a arch] [-B buildid] [-D dest] [-j njob] [-M obj] [-m mach] [-O obj] [-R release] [-T tools] [-V var=[value]] [-w wrapper] [operation [...] ] System build operations (all imply "obj" and "tools"): build Run "make build" distribution Run "make distribution" (includes etc/ files) release Run "make release" (includes kernels & distrib media) Other operations: obj Run "make obj" (default unless -o) tools Build and install tools kernel=conf Build kernel with config file `conf' install=idir Run "make installworld" to `idir' (useful after 'distribution' or 'release') Options: -a arch Set MACHINE_ARCH to arch (otherwise deduced from MACHINE) -B buildId Set BUILDID to buildId -D dest Set DESTDIR to dest -E Set "expert" mode; disables some DESTDIR checks -j njob Run up to njob jobs in parallel; see make(1) -M obj Set obj root directory to obj (sets MAKEOBJDIRPREFIX) -m mach Set MACHINE to mach (not required if NetBSD native) -n Show commands that would be executed, but do not execute them -O obj Set obj root directory to obj (sets a MAKEOBJDIR pattern) -o Set MKOBJDIRS=no (do not create objdirs at start of build) -R release Set RELEASEDIR to release -r Remove contents of TOOLDIR and DESTDIR before building -T tools Set TOOLDIR to tools. If unset, and TOOLDIR is not set in the environment, nbmake will be (re)built unconditionally. -U Set UNPRIVED -u Set UPDATE -V v=[val] Set variable `v' to `val' -w wrapper Create nbmake script as wrapper (default: ${TOOLDIR}/bin/nbmake-${MACHINE})
2003-01-23 19:24:08 +03:00
dreamcast|hpcsh)
MACHINE_ARCH=sh3el
;;
2002-06-10 18:08:05 +04:00
Rework how build.sh functions, so that command line options set various parameters, and a list of "operations" defines what to do. The full usage is show below. Notes: `-b' has been deprecated (it always occurs now) `-d' is replaced by "distribution" `-R rel' onlys sets RELEASEDIR; use "release" to build a release `-k kern' has been replaced by "kernel=kern" `-i idir' has been replaced by "install=idir" -r now occurs before nbmake is rebuilt Add a copyright (long due!). Rework the code to (a KNF inspired) ShellNF. Use functions appropriately. Allow `nb' prefix to be easily changed to something else. Solve world peace (just kidding) This is part of the (never achievable) goal of attempting to make NetBSD easier to build... --8<-- new usage follows --8<-- Usage: build.sh [-EnorUu] [-a arch] [-B buildid] [-D dest] [-j njob] [-M obj] [-m mach] [-O obj] [-R release] [-T tools] [-V var=[value]] [-w wrapper] [operation [...] ] System build operations (all imply "obj" and "tools"): build Run "make build" distribution Run "make distribution" (includes etc/ files) release Run "make release" (includes kernels & distrib media) Other operations: obj Run "make obj" (default unless -o) tools Build and install tools kernel=conf Build kernel with config file `conf' install=idir Run "make installworld" to `idir' (useful after 'distribution' or 'release') Options: -a arch Set MACHINE_ARCH to arch (otherwise deduced from MACHINE) -B buildId Set BUILDID to buildId -D dest Set DESTDIR to dest -E Set "expert" mode; disables some DESTDIR checks -j njob Run up to njob jobs in parallel; see make(1) -M obj Set obj root directory to obj (sets MAKEOBJDIRPREFIX) -m mach Set MACHINE to mach (not required if NetBSD native) -n Show commands that would be executed, but do not execute them -O obj Set obj root directory to obj (sets a MAKEOBJDIR pattern) -o Set MKOBJDIRS=no (do not create objdirs at start of build) -R release Set RELEASEDIR to release -r Remove contents of TOOLDIR and DESTDIR before building -T tools Set TOOLDIR to tools. If unset, and TOOLDIR is not set in the environment, nbmake will be (re)built unconditionally. -U Set UNPRIVED -u Set UPDATE -V v=[val] Set variable `v' to `val' -w wrapper Create nbmake script as wrapper (default: ${TOOLDIR}/bin/nbmake-${MACHINE})
2003-01-23 19:24:08 +03:00
evbsh5)
MACHINE_ARCH=sh5el
;;
2003-04-26 22:42:34 +04:00
amd64)
MACHINE_ARCH=x86_64
;;
2002-10-02 20:57:29 +04:00
2003-04-26 22:42:34 +04:00
alpha|i386|sparc|sparc64|vax)
MACHINE_ARCH=${MACHINE}
Rework how build.sh functions, so that command line options set various parameters, and a list of "operations" defines what to do. The full usage is show below. Notes: `-b' has been deprecated (it always occurs now) `-d' is replaced by "distribution" `-R rel' onlys sets RELEASEDIR; use "release" to build a release `-k kern' has been replaced by "kernel=kern" `-i idir' has been replaced by "install=idir" -r now occurs before nbmake is rebuilt Add a copyright (long due!). Rework the code to (a KNF inspired) ShellNF. Use functions appropriately. Allow `nb' prefix to be easily changed to something else. Solve world peace (just kidding) This is part of the (never achievable) goal of attempting to make NetBSD easier to build... --8<-- new usage follows --8<-- Usage: build.sh [-EnorUu] [-a arch] [-B buildid] [-D dest] [-j njob] [-M obj] [-m mach] [-O obj] [-R release] [-T tools] [-V var=[value]] [-w wrapper] [operation [...] ] System build operations (all imply "obj" and "tools"): build Run "make build" distribution Run "make distribution" (includes etc/ files) release Run "make release" (includes kernels & distrib media) Other operations: obj Run "make obj" (default unless -o) tools Build and install tools kernel=conf Build kernel with config file `conf' install=idir Run "make installworld" to `idir' (useful after 'distribution' or 'release') Options: -a arch Set MACHINE_ARCH to arch (otherwise deduced from MACHINE) -B buildId Set BUILDID to buildId -D dest Set DESTDIR to dest -E Set "expert" mode; disables some DESTDIR checks -j njob Run up to njob jobs in parallel; see make(1) -M obj Set obj root directory to obj (sets MAKEOBJDIRPREFIX) -m mach Set MACHINE to mach (not required if NetBSD native) -n Show commands that would be executed, but do not execute them -O obj Set obj root directory to obj (sets a MAKEOBJDIR pattern) -o Set MKOBJDIRS=no (do not create objdirs at start of build) -R release Set RELEASEDIR to release -r Remove contents of TOOLDIR and DESTDIR before building -T tools Set TOOLDIR to tools. If unset, and TOOLDIR is not set in the environment, nbmake will be (re)built unconditionally. -U Set UNPRIVED -u Set UPDATE -V v=[val] Set variable `v' to `val' -w wrapper Create nbmake script as wrapper (default: ${TOOLDIR}/bin/nbmake-${MACHINE})
2003-01-23 19:24:08 +03:00
;;
*)
bomb "Unknown target MACHINE: ${MACHINE}"
Rework how build.sh functions, so that command line options set various parameters, and a list of "operations" defines what to do. The full usage is show below. Notes: `-b' has been deprecated (it always occurs now) `-d' is replaced by "distribution" `-R rel' onlys sets RELEASEDIR; use "release" to build a release `-k kern' has been replaced by "kernel=kern" `-i idir' has been replaced by "install=idir" -r now occurs before nbmake is rebuilt Add a copyright (long due!). Rework the code to (a KNF inspired) ShellNF. Use functions appropriately. Allow `nb' prefix to be easily changed to something else. Solve world peace (just kidding) This is part of the (never achievable) goal of attempting to make NetBSD easier to build... --8<-- new usage follows --8<-- Usage: build.sh [-EnorUu] [-a arch] [-B buildid] [-D dest] [-j njob] [-M obj] [-m mach] [-O obj] [-R release] [-T tools] [-V var=[value]] [-w wrapper] [operation [...] ] System build operations (all imply "obj" and "tools"): build Run "make build" distribution Run "make distribution" (includes etc/ files) release Run "make release" (includes kernels & distrib media) Other operations: obj Run "make obj" (default unless -o) tools Build and install tools kernel=conf Build kernel with config file `conf' install=idir Run "make installworld" to `idir' (useful after 'distribution' or 'release') Options: -a arch Set MACHINE_ARCH to arch (otherwise deduced from MACHINE) -B buildId Set BUILDID to buildId -D dest Set DESTDIR to dest -E Set "expert" mode; disables some DESTDIR checks -j njob Run up to njob jobs in parallel; see make(1) -M obj Set obj root directory to obj (sets MAKEOBJDIRPREFIX) -m mach Set MACHINE to mach (not required if NetBSD native) -n Show commands that would be executed, but do not execute them -O obj Set obj root directory to obj (sets a MAKEOBJDIR pattern) -o Set MKOBJDIRS=no (do not create objdirs at start of build) -R release Set RELEASEDIR to release -r Remove contents of TOOLDIR and DESTDIR before building -T tools Set TOOLDIR to tools. If unset, and TOOLDIR is not set in the environment, nbmake will be (re)built unconditionally. -U Set UNPRIVED -u Set UPDATE -V v=[val] Set variable `v' to `val' -w wrapper Create nbmake script as wrapper (default: ${TOOLDIR}/bin/nbmake-${MACHINE})
2003-01-23 19:24:08 +03:00
;;
esac
}
validatearch()
{
# Ensure that the MACHINE_ARCH exists (and is supported by build.sh).
Rework how build.sh functions, so that command line options set various parameters, and a list of "operations" defines what to do. The full usage is show below. Notes: `-b' has been deprecated (it always occurs now) `-d' is replaced by "distribution" `-R rel' onlys sets RELEASEDIR; use "release" to build a release `-k kern' has been replaced by "kernel=kern" `-i idir' has been replaced by "install=idir" -r now occurs before nbmake is rebuilt Add a copyright (long due!). Rework the code to (a KNF inspired) ShellNF. Use functions appropriately. Allow `nb' prefix to be easily changed to something else. Solve world peace (just kidding) This is part of the (never achievable) goal of attempting to make NetBSD easier to build... --8<-- new usage follows --8<-- Usage: build.sh [-EnorUu] [-a arch] [-B buildid] [-D dest] [-j njob] [-M obj] [-m mach] [-O obj] [-R release] [-T tools] [-V var=[value]] [-w wrapper] [operation [...] ] System build operations (all imply "obj" and "tools"): build Run "make build" distribution Run "make distribution" (includes etc/ files) release Run "make release" (includes kernels & distrib media) Other operations: obj Run "make obj" (default unless -o) tools Build and install tools kernel=conf Build kernel with config file `conf' install=idir Run "make installworld" to `idir' (useful after 'distribution' or 'release') Options: -a arch Set MACHINE_ARCH to arch (otherwise deduced from MACHINE) -B buildId Set BUILDID to buildId -D dest Set DESTDIR to dest -E Set "expert" mode; disables some DESTDIR checks -j njob Run up to njob jobs in parallel; see make(1) -M obj Set obj root directory to obj (sets MAKEOBJDIRPREFIX) -m mach Set MACHINE to mach (not required if NetBSD native) -n Show commands that would be executed, but do not execute them -O obj Set obj root directory to obj (sets a MAKEOBJDIR pattern) -o Set MKOBJDIRS=no (do not create objdirs at start of build) -R release Set RELEASEDIR to release -r Remove contents of TOOLDIR and DESTDIR before building -T tools Set TOOLDIR to tools. If unset, and TOOLDIR is not set in the environment, nbmake will be (re)built unconditionally. -U Set UNPRIVED -u Set UPDATE -V v=[val] Set variable `v' to `val' -w wrapper Create nbmake script as wrapper (default: ${TOOLDIR}/bin/nbmake-${MACHINE})
2003-01-23 19:24:08 +03:00
#
case "${MACHINE_ARCH}" in
Rework how build.sh functions, so that command line options set various parameters, and a list of "operations" defines what to do. The full usage is show below. Notes: `-b' has been deprecated (it always occurs now) `-d' is replaced by "distribution" `-R rel' onlys sets RELEASEDIR; use "release" to build a release `-k kern' has been replaced by "kernel=kern" `-i idir' has been replaced by "install=idir" -r now occurs before nbmake is rebuilt Add a copyright (long due!). Rework the code to (a KNF inspired) ShellNF. Use functions appropriately. Allow `nb' prefix to be easily changed to something else. Solve world peace (just kidding) This is part of the (never achievable) goal of attempting to make NetBSD easier to build... --8<-- new usage follows --8<-- Usage: build.sh [-EnorUu] [-a arch] [-B buildid] [-D dest] [-j njob] [-M obj] [-m mach] [-O obj] [-R release] [-T tools] [-V var=[value]] [-w wrapper] [operation [...] ] System build operations (all imply "obj" and "tools"): build Run "make build" distribution Run "make distribution" (includes etc/ files) release Run "make release" (includes kernels & distrib media) Other operations: obj Run "make obj" (default unless -o) tools Build and install tools kernel=conf Build kernel with config file `conf' install=idir Run "make installworld" to `idir' (useful after 'distribution' or 'release') Options: -a arch Set MACHINE_ARCH to arch (otherwise deduced from MACHINE) -B buildId Set BUILDID to buildId -D dest Set DESTDIR to dest -E Set "expert" mode; disables some DESTDIR checks -j njob Run up to njob jobs in parallel; see make(1) -M obj Set obj root directory to obj (sets MAKEOBJDIRPREFIX) -m mach Set MACHINE to mach (not required if NetBSD native) -n Show commands that would be executed, but do not execute them -O obj Set obj root directory to obj (sets a MAKEOBJDIR pattern) -o Set MKOBJDIRS=no (do not create objdirs at start of build) -R release Set RELEASEDIR to release -r Remove contents of TOOLDIR and DESTDIR before building -T tools Set TOOLDIR to tools. If unset, and TOOLDIR is not set in the environment, nbmake will be (re)built unconditionally. -U Set UNPRIVED -u Set UPDATE -V v=[val] Set variable `v' to `val' -w wrapper Create nbmake script as wrapper (default: ${TOOLDIR}/bin/nbmake-${MACHINE})
2003-01-23 19:24:08 +03:00
alpha|arm|armeb|hppa|i386|m68000|m68k|mipse[bl]|ns32k|powerpc|sh[35]e[bl]|sparc|sparc64|vax|x86_64)
;;
"")
bomb "No MACHINE_ARCH provided"
;;
Rework how build.sh functions, so that command line options set various parameters, and a list of "operations" defines what to do. The full usage is show below. Notes: `-b' has been deprecated (it always occurs now) `-d' is replaced by "distribution" `-R rel' onlys sets RELEASEDIR; use "release" to build a release `-k kern' has been replaced by "kernel=kern" `-i idir' has been replaced by "install=idir" -r now occurs before nbmake is rebuilt Add a copyright (long due!). Rework the code to (a KNF inspired) ShellNF. Use functions appropriately. Allow `nb' prefix to be easily changed to something else. Solve world peace (just kidding) This is part of the (never achievable) goal of attempting to make NetBSD easier to build... --8<-- new usage follows --8<-- Usage: build.sh [-EnorUu] [-a arch] [-B buildid] [-D dest] [-j njob] [-M obj] [-m mach] [-O obj] [-R release] [-T tools] [-V var=[value]] [-w wrapper] [operation [...] ] System build operations (all imply "obj" and "tools"): build Run "make build" distribution Run "make distribution" (includes etc/ files) release Run "make release" (includes kernels & distrib media) Other operations: obj Run "make obj" (default unless -o) tools Build and install tools kernel=conf Build kernel with config file `conf' install=idir Run "make installworld" to `idir' (useful after 'distribution' or 'release') Options: -a arch Set MACHINE_ARCH to arch (otherwise deduced from MACHINE) -B buildId Set BUILDID to buildId -D dest Set DESTDIR to dest -E Set "expert" mode; disables some DESTDIR checks -j njob Run up to njob jobs in parallel; see make(1) -M obj Set obj root directory to obj (sets MAKEOBJDIRPREFIX) -m mach Set MACHINE to mach (not required if NetBSD native) -n Show commands that would be executed, but do not execute them -O obj Set obj root directory to obj (sets a MAKEOBJDIR pattern) -o Set MKOBJDIRS=no (do not create objdirs at start of build) -R release Set RELEASEDIR to release -r Remove contents of TOOLDIR and DESTDIR before building -T tools Set TOOLDIR to tools. If unset, and TOOLDIR is not set in the environment, nbmake will be (re)built unconditionally. -U Set UNPRIVED -u Set UPDATE -V v=[val] Set variable `v' to `val' -w wrapper Create nbmake script as wrapper (default: ${TOOLDIR}/bin/nbmake-${MACHINE})
2003-01-23 19:24:08 +03:00
*)
bomb "Unknown target MACHINE_ARCH: ${MACHINE_ARCH}"
Rework how build.sh functions, so that command line options set various parameters, and a list of "operations" defines what to do. The full usage is show below. Notes: `-b' has been deprecated (it always occurs now) `-d' is replaced by "distribution" `-R rel' onlys sets RELEASEDIR; use "release" to build a release `-k kern' has been replaced by "kernel=kern" `-i idir' has been replaced by "install=idir" -r now occurs before nbmake is rebuilt Add a copyright (long due!). Rework the code to (a KNF inspired) ShellNF. Use functions appropriately. Allow `nb' prefix to be easily changed to something else. Solve world peace (just kidding) This is part of the (never achievable) goal of attempting to make NetBSD easier to build... --8<-- new usage follows --8<-- Usage: build.sh [-EnorUu] [-a arch] [-B buildid] [-D dest] [-j njob] [-M obj] [-m mach] [-O obj] [-R release] [-T tools] [-V var=[value]] [-w wrapper] [operation [...] ] System build operations (all imply "obj" and "tools"): build Run "make build" distribution Run "make distribution" (includes etc/ files) release Run "make release" (includes kernels & distrib media) Other operations: obj Run "make obj" (default unless -o) tools Build and install tools kernel=conf Build kernel with config file `conf' install=idir Run "make installworld" to `idir' (useful after 'distribution' or 'release') Options: -a arch Set MACHINE_ARCH to arch (otherwise deduced from MACHINE) -B buildId Set BUILDID to buildId -D dest Set DESTDIR to dest -E Set "expert" mode; disables some DESTDIR checks -j njob Run up to njob jobs in parallel; see make(1) -M obj Set obj root directory to obj (sets MAKEOBJDIRPREFIX) -m mach Set MACHINE to mach (not required if NetBSD native) -n Show commands that would be executed, but do not execute them -O obj Set obj root directory to obj (sets a MAKEOBJDIR pattern) -o Set MKOBJDIRS=no (do not create objdirs at start of build) -R release Set RELEASEDIR to release -r Remove contents of TOOLDIR and DESTDIR before building -T tools Set TOOLDIR to tools. If unset, and TOOLDIR is not set in the environment, nbmake will be (re)built unconditionally. -U Set UNPRIVED -u Set UPDATE -V v=[val] Set variable `v' to `val' -w wrapper Create nbmake script as wrapper (default: ${TOOLDIR}/bin/nbmake-${MACHINE})
2003-01-23 19:24:08 +03:00
;;
esac
# Determine valid MACHINE_ARCHs for MACHINE
#
case "${MACHINE}" in
evbarm)
arches="arm armeb"
;;
evbmips|sbmips)
arches="mipseb mipsel"
;;
evbsh3)
arches="sh3eb sh3el"
;;
evbsh5)
arches="sh5eb sh5el"
;;
*)
oma="${MACHINE_ARCH}"
getarch
arches="${MACHINE_ARCH}"
MACHINE_ARCH="${oma}"
;;
esac
# Ensure that MACHINE_ARCH supports MACHINE
#
archok=false
for a in ${arches}; do
if [ "${a}" = "${MACHINE_ARCH}" ]; then
archok=true
break
fi
done
${archok} ||
bomb "MACHINE_ARCH '${MACHINE_ARCH}' does not support MACHINE '${MACHINE}'"
}
raw_getmakevar()
{
[ -x "${make}" ] || bomb "raw_getmakevar $1: ${make} is not executable"
"${make}" -m ${TOP}/share/mk -s -f- _x_ <<EOF
Major cleanup and overhaul: * Allow MACHINE to be set automatically on NetBSD native builds. Require -m only if the host is not NetBSD. * Fail if DESTDIR is set to root (/) and the build is not NetBSD native, or the build is attempting a "make release" (option -R). * Warn the user if DESTDIR is set to root (/) that the kernel must be up to date, or else the build might hose the system. Also, do not remove DESTDIR on -r if it is set to root. * Fail if TOOLDIR is set to / or empty after checking with nbmake. * Allow DESTDIR and TOOLDIR to be set in mk.conf and/or by the new default from <bsd.own.mk>. Note that if -T is not used to set TOOLDIR, and TOOLDIR is not set in the environment, then nbmake will always be bootstrapped (rather than looking at nbmake's timestamp). This is because /bin/sh doesn't know how to get TOOLDIR from mk.conf without first having nbmake (...which lives in TOOLDIR). * Do a pass of "make obj" through src/tools before installing nbmake (so long as -o/MKOBJDIRS=no is not specified). This ensures that objdirs exist if they are desired, and paves the way for using build.sh to build all the src/tools without building everything else. * Add "-w" option, which allows the builder to specify where the nbmake wrapper shell script should be created. If not specified, $TOOLDIR/bin/nbmake-$MACHINE is still created as a default. * Print the values of DESTDIR and TOOLDIR after bootstrapping nbmake, for informational purposes. It should now be possible to type just "./build.sh" on a NetBSD-current host and get a new build in / for the appropriate architecture. However, building in-place like this has *not* been extensively tested yet, so be careful.
2001-10-31 22:59:43 +03:00
_x_:
echo \${$1}
.include <bsd.prog.mk>
.include <bsd.kernobj.mk>
Major cleanup and overhaul: * Allow MACHINE to be set automatically on NetBSD native builds. Require -m only if the host is not NetBSD. * Fail if DESTDIR is set to root (/) and the build is not NetBSD native, or the build is attempting a "make release" (option -R). * Warn the user if DESTDIR is set to root (/) that the kernel must be up to date, or else the build might hose the system. Also, do not remove DESTDIR on -r if it is set to root. * Fail if TOOLDIR is set to / or empty after checking with nbmake. * Allow DESTDIR and TOOLDIR to be set in mk.conf and/or by the new default from <bsd.own.mk>. Note that if -T is not used to set TOOLDIR, and TOOLDIR is not set in the environment, then nbmake will always be bootstrapped (rather than looking at nbmake's timestamp). This is because /bin/sh doesn't know how to get TOOLDIR from mk.conf without first having nbmake (...which lives in TOOLDIR). * Do a pass of "make obj" through src/tools before installing nbmake (so long as -o/MKOBJDIRS=no is not specified). This ensures that objdirs exist if they are desired, and paves the way for using build.sh to build all the src/tools without building everything else. * Add "-w" option, which allows the builder to specify where the nbmake wrapper shell script should be created. If not specified, $TOOLDIR/bin/nbmake-$MACHINE is still created as a default. * Print the values of DESTDIR and TOOLDIR after bootstrapping nbmake, for informational purposes. It should now be possible to type just "./build.sh" on a NetBSD-current host and get a new build in / for the appropriate architecture. However, building in-place like this has *not* been extensively tested yet, so be careful.
2001-10-31 22:59:43 +03:00
EOF
}
getmakevar()
{
# raw_getmakevar() doesn't work properly if $make hasn't yet been
# built, which can happen when running with the "-n" option.
# getmakevar() deals with this by emitting a literal '$'
Rework how build.sh functions, so that command line options set various parameters, and a list of "operations" defines what to do. The full usage is show below. Notes: `-b' has been deprecated (it always occurs now) `-d' is replaced by "distribution" `-R rel' onlys sets RELEASEDIR; use "release" to build a release `-k kern' has been replaced by "kernel=kern" `-i idir' has been replaced by "install=idir" -r now occurs before nbmake is rebuilt Add a copyright (long due!). Rework the code to (a KNF inspired) ShellNF. Use functions appropriately. Allow `nb' prefix to be easily changed to something else. Solve world peace (just kidding) This is part of the (never achievable) goal of attempting to make NetBSD easier to build... --8<-- new usage follows --8<-- Usage: build.sh [-EnorUu] [-a arch] [-B buildid] [-D dest] [-j njob] [-M obj] [-m mach] [-O obj] [-R release] [-T tools] [-V var=[value]] [-w wrapper] [operation [...] ] System build operations (all imply "obj" and "tools"): build Run "make build" distribution Run "make distribution" (includes etc/ files) release Run "make release" (includes kernels & distrib media) Other operations: obj Run "make obj" (default unless -o) tools Build and install tools kernel=conf Build kernel with config file `conf' install=idir Run "make installworld" to `idir' (useful after 'distribution' or 'release') Options: -a arch Set MACHINE_ARCH to arch (otherwise deduced from MACHINE) -B buildId Set BUILDID to buildId -D dest Set DESTDIR to dest -E Set "expert" mode; disables some DESTDIR checks -j njob Run up to njob jobs in parallel; see make(1) -M obj Set obj root directory to obj (sets MAKEOBJDIRPREFIX) -m mach Set MACHINE to mach (not required if NetBSD native) -n Show commands that would be executed, but do not execute them -O obj Set obj root directory to obj (sets a MAKEOBJDIR pattern) -o Set MKOBJDIRS=no (do not create objdirs at start of build) -R release Set RELEASEDIR to release -r Remove contents of TOOLDIR and DESTDIR before building -T tools Set TOOLDIR to tools. If unset, and TOOLDIR is not set in the environment, nbmake will be (re)built unconditionally. -U Set UNPRIVED -u Set UPDATE -V v=[val] Set variable `v' to `val' -w wrapper Create nbmake script as wrapper (default: ${TOOLDIR}/bin/nbmake-${MACHINE})
2003-01-23 19:24:08 +03:00
# followed by the variable name, instead of trying to find the
# variable's value.
#
if [ -x "${make}" ]; then
raw_getmakevar "$1"
else
echo "\$$1"
fi
}
setmakeenv()
{
eval "$1='$2'; export $1"
makeenv="${makeenv} $1"
}
unsetmakeenv()
{
eval "unset $1"
makeenv="${makeenv} $1"
}
resolvepath()
{
case "${OPTARG}" in
Rework how build.sh functions, so that command line options set various parameters, and a list of "operations" defines what to do. The full usage is show below. Notes: `-b' has been deprecated (it always occurs now) `-d' is replaced by "distribution" `-R rel' onlys sets RELEASEDIR; use "release" to build a release `-k kern' has been replaced by "kernel=kern" `-i idir' has been replaced by "install=idir" -r now occurs before nbmake is rebuilt Add a copyright (long due!). Rework the code to (a KNF inspired) ShellNF. Use functions appropriately. Allow `nb' prefix to be easily changed to something else. Solve world peace (just kidding) This is part of the (never achievable) goal of attempting to make NetBSD easier to build... --8<-- new usage follows --8<-- Usage: build.sh [-EnorUu] [-a arch] [-B buildid] [-D dest] [-j njob] [-M obj] [-m mach] [-O obj] [-R release] [-T tools] [-V var=[value]] [-w wrapper] [operation [...] ] System build operations (all imply "obj" and "tools"): build Run "make build" distribution Run "make distribution" (includes etc/ files) release Run "make release" (includes kernels & distrib media) Other operations: obj Run "make obj" (default unless -o) tools Build and install tools kernel=conf Build kernel with config file `conf' install=idir Run "make installworld" to `idir' (useful after 'distribution' or 'release') Options: -a arch Set MACHINE_ARCH to arch (otherwise deduced from MACHINE) -B buildId Set BUILDID to buildId -D dest Set DESTDIR to dest -E Set "expert" mode; disables some DESTDIR checks -j njob Run up to njob jobs in parallel; see make(1) -M obj Set obj root directory to obj (sets MAKEOBJDIRPREFIX) -m mach Set MACHINE to mach (not required if NetBSD native) -n Show commands that would be executed, but do not execute them -O obj Set obj root directory to obj (sets a MAKEOBJDIR pattern) -o Set MKOBJDIRS=no (do not create objdirs at start of build) -R release Set RELEASEDIR to release -r Remove contents of TOOLDIR and DESTDIR before building -T tools Set TOOLDIR to tools. If unset, and TOOLDIR is not set in the environment, nbmake will be (re)built unconditionally. -U Set UNPRIVED -u Set UPDATE -V v=[val] Set variable `v' to `val' -w wrapper Create nbmake script as wrapper (default: ${TOOLDIR}/bin/nbmake-${MACHINE})
2003-01-23 19:24:08 +03:00
/*)
;;
*)
OPTARG="${TOP}/${OPTARG}"
Rework how build.sh functions, so that command line options set various parameters, and a list of "operations" defines what to do. The full usage is show below. Notes: `-b' has been deprecated (it always occurs now) `-d' is replaced by "distribution" `-R rel' onlys sets RELEASEDIR; use "release" to build a release `-k kern' has been replaced by "kernel=kern" `-i idir' has been replaced by "install=idir" -r now occurs before nbmake is rebuilt Add a copyright (long due!). Rework the code to (a KNF inspired) ShellNF. Use functions appropriately. Allow `nb' prefix to be easily changed to something else. Solve world peace (just kidding) This is part of the (never achievable) goal of attempting to make NetBSD easier to build... --8<-- new usage follows --8<-- Usage: build.sh [-EnorUu] [-a arch] [-B buildid] [-D dest] [-j njob] [-M obj] [-m mach] [-O obj] [-R release] [-T tools] [-V var=[value]] [-w wrapper] [operation [...] ] System build operations (all imply "obj" and "tools"): build Run "make build" distribution Run "make distribution" (includes etc/ files) release Run "make release" (includes kernels & distrib media) Other operations: obj Run "make obj" (default unless -o) tools Build and install tools kernel=conf Build kernel with config file `conf' install=idir Run "make installworld" to `idir' (useful after 'distribution' or 'release') Options: -a arch Set MACHINE_ARCH to arch (otherwise deduced from MACHINE) -B buildId Set BUILDID to buildId -D dest Set DESTDIR to dest -E Set "expert" mode; disables some DESTDIR checks -j njob Run up to njob jobs in parallel; see make(1) -M obj Set obj root directory to obj (sets MAKEOBJDIRPREFIX) -m mach Set MACHINE to mach (not required if NetBSD native) -n Show commands that would be executed, but do not execute them -O obj Set obj root directory to obj (sets a MAKEOBJDIR pattern) -o Set MKOBJDIRS=no (do not create objdirs at start of build) -R release Set RELEASEDIR to release -r Remove contents of TOOLDIR and DESTDIR before building -T tools Set TOOLDIR to tools. If unset, and TOOLDIR is not set in the environment, nbmake will be (re)built unconditionally. -U Set UNPRIVED -u Set UPDATE -V v=[val] Set variable `v' to `val' -w wrapper Create nbmake script as wrapper (default: ${TOOLDIR}/bin/nbmake-${MACHINE})
2003-01-23 19:24:08 +03:00
;;
esac
}
usage()
{
Rework how build.sh functions, so that command line options set various parameters, and a list of "operations" defines what to do. The full usage is show below. Notes: `-b' has been deprecated (it always occurs now) `-d' is replaced by "distribution" `-R rel' onlys sets RELEASEDIR; use "release" to build a release `-k kern' has been replaced by "kernel=kern" `-i idir' has been replaced by "install=idir" -r now occurs before nbmake is rebuilt Add a copyright (long due!). Rework the code to (a KNF inspired) ShellNF. Use functions appropriately. Allow `nb' prefix to be easily changed to something else. Solve world peace (just kidding) This is part of the (never achievable) goal of attempting to make NetBSD easier to build... --8<-- new usage follows --8<-- Usage: build.sh [-EnorUu] [-a arch] [-B buildid] [-D dest] [-j njob] [-M obj] [-m mach] [-O obj] [-R release] [-T tools] [-V var=[value]] [-w wrapper] [operation [...] ] System build operations (all imply "obj" and "tools"): build Run "make build" distribution Run "make distribution" (includes etc/ files) release Run "make release" (includes kernels & distrib media) Other operations: obj Run "make obj" (default unless -o) tools Build and install tools kernel=conf Build kernel with config file `conf' install=idir Run "make installworld" to `idir' (useful after 'distribution' or 'release') Options: -a arch Set MACHINE_ARCH to arch (otherwise deduced from MACHINE) -B buildId Set BUILDID to buildId -D dest Set DESTDIR to dest -E Set "expert" mode; disables some DESTDIR checks -j njob Run up to njob jobs in parallel; see make(1) -M obj Set obj root directory to obj (sets MAKEOBJDIRPREFIX) -m mach Set MACHINE to mach (not required if NetBSD native) -n Show commands that would be executed, but do not execute them -O obj Set obj root directory to obj (sets a MAKEOBJDIR pattern) -o Set MKOBJDIRS=no (do not create objdirs at start of build) -R release Set RELEASEDIR to release -r Remove contents of TOOLDIR and DESTDIR before building -T tools Set TOOLDIR to tools. If unset, and TOOLDIR is not set in the environment, nbmake will be (re)built unconditionally. -U Set UNPRIVED -u Set UPDATE -V v=[val] Set variable `v' to `val' -w wrapper Create nbmake script as wrapper (default: ${TOOLDIR}/bin/nbmake-${MACHINE})
2003-01-23 19:24:08 +03:00
if [ -n "$*" ]; then
echo ""
echo "${progname}: $*"
fi
cat <<_usage_
Rework how build.sh functions, so that command line options set various parameters, and a list of "operations" defines what to do. The full usage is show below. Notes: `-b' has been deprecated (it always occurs now) `-d' is replaced by "distribution" `-R rel' onlys sets RELEASEDIR; use "release" to build a release `-k kern' has been replaced by "kernel=kern" `-i idir' has been replaced by "install=idir" -r now occurs before nbmake is rebuilt Add a copyright (long due!). Rework the code to (a KNF inspired) ShellNF. Use functions appropriately. Allow `nb' prefix to be easily changed to something else. Solve world peace (just kidding) This is part of the (never achievable) goal of attempting to make NetBSD easier to build... --8<-- new usage follows --8<-- Usage: build.sh [-EnorUu] [-a arch] [-B buildid] [-D dest] [-j njob] [-M obj] [-m mach] [-O obj] [-R release] [-T tools] [-V var=[value]] [-w wrapper] [operation [...] ] System build operations (all imply "obj" and "tools"): build Run "make build" distribution Run "make distribution" (includes etc/ files) release Run "make release" (includes kernels & distrib media) Other operations: obj Run "make obj" (default unless -o) tools Build and install tools kernel=conf Build kernel with config file `conf' install=idir Run "make installworld" to `idir' (useful after 'distribution' or 'release') Options: -a arch Set MACHINE_ARCH to arch (otherwise deduced from MACHINE) -B buildId Set BUILDID to buildId -D dest Set DESTDIR to dest -E Set "expert" mode; disables some DESTDIR checks -j njob Run up to njob jobs in parallel; see make(1) -M obj Set obj root directory to obj (sets MAKEOBJDIRPREFIX) -m mach Set MACHINE to mach (not required if NetBSD native) -n Show commands that would be executed, but do not execute them -O obj Set obj root directory to obj (sets a MAKEOBJDIR pattern) -o Set MKOBJDIRS=no (do not create objdirs at start of build) -R release Set RELEASEDIR to release -r Remove contents of TOOLDIR and DESTDIR before building -T tools Set TOOLDIR to tools. If unset, and TOOLDIR is not set in the environment, nbmake will be (re)built unconditionally. -U Set UNPRIVED -u Set UPDATE -V v=[val] Set variable `v' to `val' -w wrapper Create nbmake script as wrapper (default: ${TOOLDIR}/bin/nbmake-${MACHINE})
2003-01-23 19:24:08 +03:00
Usage: ${progname} [-EnorUu] [-a arch] [-B buildid] [-D dest] [-j njob] [-M obj]
[-m mach] [-O obj] [-R release] [-T tools] [-V var=[value]]
[-w wrapper] [-Z var] operation [...]
Rework how build.sh functions, so that command line options set various parameters, and a list of "operations" defines what to do. The full usage is show below. Notes: `-b' has been deprecated (it always occurs now) `-d' is replaced by "distribution" `-R rel' onlys sets RELEASEDIR; use "release" to build a release `-k kern' has been replaced by "kernel=kern" `-i idir' has been replaced by "install=idir" -r now occurs before nbmake is rebuilt Add a copyright (long due!). Rework the code to (a KNF inspired) ShellNF. Use functions appropriately. Allow `nb' prefix to be easily changed to something else. Solve world peace (just kidding) This is part of the (never achievable) goal of attempting to make NetBSD easier to build... --8<-- new usage follows --8<-- Usage: build.sh [-EnorUu] [-a arch] [-B buildid] [-D dest] [-j njob] [-M obj] [-m mach] [-O obj] [-R release] [-T tools] [-V var=[value]] [-w wrapper] [operation [...] ] System build operations (all imply "obj" and "tools"): build Run "make build" distribution Run "make distribution" (includes etc/ files) release Run "make release" (includes kernels & distrib media) Other operations: obj Run "make obj" (default unless -o) tools Build and install tools kernel=conf Build kernel with config file `conf' install=idir Run "make installworld" to `idir' (useful after 'distribution' or 'release') Options: -a arch Set MACHINE_ARCH to arch (otherwise deduced from MACHINE) -B buildId Set BUILDID to buildId -D dest Set DESTDIR to dest -E Set "expert" mode; disables some DESTDIR checks -j njob Run up to njob jobs in parallel; see make(1) -M obj Set obj root directory to obj (sets MAKEOBJDIRPREFIX) -m mach Set MACHINE to mach (not required if NetBSD native) -n Show commands that would be executed, but do not execute them -O obj Set obj root directory to obj (sets a MAKEOBJDIR pattern) -o Set MKOBJDIRS=no (do not create objdirs at start of build) -R release Set RELEASEDIR to release -r Remove contents of TOOLDIR and DESTDIR before building -T tools Set TOOLDIR to tools. If unset, and TOOLDIR is not set in the environment, nbmake will be (re)built unconditionally. -U Set UNPRIVED -u Set UPDATE -V v=[val] Set variable `v' to `val' -w wrapper Create nbmake script as wrapper (default: ${TOOLDIR}/bin/nbmake-${MACHINE})
2003-01-23 19:24:08 +03:00
Build operations (all imply "obj" and "tools"):
build Run "make build"
distribution Run "make distribution" (includes DESTDIR/etc/ files)
release Run "make release" (includes kernels & distrib media)
Rework how build.sh functions, so that command line options set various parameters, and a list of "operations" defines what to do. The full usage is show below. Notes: `-b' has been deprecated (it always occurs now) `-d' is replaced by "distribution" `-R rel' onlys sets RELEASEDIR; use "release" to build a release `-k kern' has been replaced by "kernel=kern" `-i idir' has been replaced by "install=idir" -r now occurs before nbmake is rebuilt Add a copyright (long due!). Rework the code to (a KNF inspired) ShellNF. Use functions appropriately. Allow `nb' prefix to be easily changed to something else. Solve world peace (just kidding) This is part of the (never achievable) goal of attempting to make NetBSD easier to build... --8<-- new usage follows --8<-- Usage: build.sh [-EnorUu] [-a arch] [-B buildid] [-D dest] [-j njob] [-M obj] [-m mach] [-O obj] [-R release] [-T tools] [-V var=[value]] [-w wrapper] [operation [...] ] System build operations (all imply "obj" and "tools"): build Run "make build" distribution Run "make distribution" (includes etc/ files) release Run "make release" (includes kernels & distrib media) Other operations: obj Run "make obj" (default unless -o) tools Build and install tools kernel=conf Build kernel with config file `conf' install=idir Run "make installworld" to `idir' (useful after 'distribution' or 'release') Options: -a arch Set MACHINE_ARCH to arch (otherwise deduced from MACHINE) -B buildId Set BUILDID to buildId -D dest Set DESTDIR to dest -E Set "expert" mode; disables some DESTDIR checks -j njob Run up to njob jobs in parallel; see make(1) -M obj Set obj root directory to obj (sets MAKEOBJDIRPREFIX) -m mach Set MACHINE to mach (not required if NetBSD native) -n Show commands that would be executed, but do not execute them -O obj Set obj root directory to obj (sets a MAKEOBJDIR pattern) -o Set MKOBJDIRS=no (do not create objdirs at start of build) -R release Set RELEASEDIR to release -r Remove contents of TOOLDIR and DESTDIR before building -T tools Set TOOLDIR to tools. If unset, and TOOLDIR is not set in the environment, nbmake will be (re)built unconditionally. -U Set UNPRIVED -u Set UPDATE -V v=[val] Set variable `v' to `val' -w wrapper Create nbmake script as wrapper (default: ${TOOLDIR}/bin/nbmake-${MACHINE})
2003-01-23 19:24:08 +03:00
Other operations:
help Show this message (and exit)
makewrapper Create ${toolprefix}make-\${MACHINE} wrapper and ${toolprefix}make.
(Always done)
obj Run "make obj" (default unless -o is used)
tools Build and install tools
install=idir Run "make installworld" to \`idir'
(useful after 'distribution' or 'release')
kernel=conf Build kernel with config file \`conf'
releasekernel=conf Install kernel built by kernel=conf to RELEASEDIR
sets Create binary sets in RELEASEDIR/MACHINE/binary/sets
sourcesets Create source sets in RELEASEDIR/source/sets
2003-07-16 17:21:47 +04:00
params Display various make(1) parameters
Rework how build.sh functions, so that command line options set various parameters, and a list of "operations" defines what to do. The full usage is show below. Notes: `-b' has been deprecated (it always occurs now) `-d' is replaced by "distribution" `-R rel' onlys sets RELEASEDIR; use "release" to build a release `-k kern' has been replaced by "kernel=kern" `-i idir' has been replaced by "install=idir" -r now occurs before nbmake is rebuilt Add a copyright (long due!). Rework the code to (a KNF inspired) ShellNF. Use functions appropriately. Allow `nb' prefix to be easily changed to something else. Solve world peace (just kidding) This is part of the (never achievable) goal of attempting to make NetBSD easier to build... --8<-- new usage follows --8<-- Usage: build.sh [-EnorUu] [-a arch] [-B buildid] [-D dest] [-j njob] [-M obj] [-m mach] [-O obj] [-R release] [-T tools] [-V var=[value]] [-w wrapper] [operation [...] ] System build operations (all imply "obj" and "tools"): build Run "make build" distribution Run "make distribution" (includes etc/ files) release Run "make release" (includes kernels & distrib media) Other operations: obj Run "make obj" (default unless -o) tools Build and install tools kernel=conf Build kernel with config file `conf' install=idir Run "make installworld" to `idir' (useful after 'distribution' or 'release') Options: -a arch Set MACHINE_ARCH to arch (otherwise deduced from MACHINE) -B buildId Set BUILDID to buildId -D dest Set DESTDIR to dest -E Set "expert" mode; disables some DESTDIR checks -j njob Run up to njob jobs in parallel; see make(1) -M obj Set obj root directory to obj (sets MAKEOBJDIRPREFIX) -m mach Set MACHINE to mach (not required if NetBSD native) -n Show commands that would be executed, but do not execute them -O obj Set obj root directory to obj (sets a MAKEOBJDIR pattern) -o Set MKOBJDIRS=no (do not create objdirs at start of build) -R release Set RELEASEDIR to release -r Remove contents of TOOLDIR and DESTDIR before building -T tools Set TOOLDIR to tools. If unset, and TOOLDIR is not set in the environment, nbmake will be (re)built unconditionally. -U Set UNPRIVED -u Set UPDATE -V v=[val] Set variable `v' to `val' -w wrapper Create nbmake script as wrapper (default: ${TOOLDIR}/bin/nbmake-${MACHINE})
2003-01-23 19:24:08 +03:00
Options:
-a arch Set MACHINE_ARCH to arch (otherwise deduced from MACHINE)
-B buildId Set BUILDID to buildId
-D dest Set DESTDIR to dest. (Default: destdir.MACHINE)
-E Set "expert" mode; disables various safety checks.
Should not be used without expert knowledge of the build system
-j njob Run up to njob jobs in parallel; see make(1)
-M obj Set obj root directory to obj (sets MAKEOBJDIRPREFIX)
Unsets MAKEOBJDIR.
-m mach Set MACHINE to mach (not required if NetBSD native)
-n Show commands that would be executed, but do not execute them
-O obj Set obj root directory to obj (sets a MAKEOBJDIR pattern).
Unsets MAKEOBJDIRPREFIX.
-o Set MKOBJDIRS=no (do not create objdirs at start of build)
-R release Set RELEASEDIR to release. (Default: releasedir)
-r Remove contents of TOOLDIR and DESTDIR before building
-T tools Set TOOLDIR to tools. If unset, and TOOLDIR is not set in
the environment, ${toolprefix}make will be (re)built unconditionally
-U Set MKUNPRIVED=yes (build without requiring root privileges;
install from an UNPRIVED build with proper file permissions)
-u Set MKUPDATE=yes (do not run "make clean" first).
Without this, everything is rebuilt, including the tools.
-V v=[val] Set variable \`v' to \`val'
-w wrapper Create ${toolprefix}make script as wrapper
(Default: \${TOOLDIR}/bin/${toolprefix}make-\${MACHINE})
-Z v Unset ("zap") variable \`v'
_usage_
exit 1
}
Rework how build.sh functions, so that command line options set various parameters, and a list of "operations" defines what to do. The full usage is show below. Notes: `-b' has been deprecated (it always occurs now) `-d' is replaced by "distribution" `-R rel' onlys sets RELEASEDIR; use "release" to build a release `-k kern' has been replaced by "kernel=kern" `-i idir' has been replaced by "install=idir" -r now occurs before nbmake is rebuilt Add a copyright (long due!). Rework the code to (a KNF inspired) ShellNF. Use functions appropriately. Allow `nb' prefix to be easily changed to something else. Solve world peace (just kidding) This is part of the (never achievable) goal of attempting to make NetBSD easier to build... --8<-- new usage follows --8<-- Usage: build.sh [-EnorUu] [-a arch] [-B buildid] [-D dest] [-j njob] [-M obj] [-m mach] [-O obj] [-R release] [-T tools] [-V var=[value]] [-w wrapper] [operation [...] ] System build operations (all imply "obj" and "tools"): build Run "make build" distribution Run "make distribution" (includes etc/ files) release Run "make release" (includes kernels & distrib media) Other operations: obj Run "make obj" (default unless -o) tools Build and install tools kernel=conf Build kernel with config file `conf' install=idir Run "make installworld" to `idir' (useful after 'distribution' or 'release') Options: -a arch Set MACHINE_ARCH to arch (otherwise deduced from MACHINE) -B buildId Set BUILDID to buildId -D dest Set DESTDIR to dest -E Set "expert" mode; disables some DESTDIR checks -j njob Run up to njob jobs in parallel; see make(1) -M obj Set obj root directory to obj (sets MAKEOBJDIRPREFIX) -m mach Set MACHINE to mach (not required if NetBSD native) -n Show commands that would be executed, but do not execute them -O obj Set obj root directory to obj (sets a MAKEOBJDIR pattern) -o Set MKOBJDIRS=no (do not create objdirs at start of build) -R release Set RELEASEDIR to release -r Remove contents of TOOLDIR and DESTDIR before building -T tools Set TOOLDIR to tools. If unset, and TOOLDIR is not set in the environment, nbmake will be (re)built unconditionally. -U Set UNPRIVED -u Set UPDATE -V v=[val] Set variable `v' to `val' -w wrapper Create nbmake script as wrapper (default: ${TOOLDIR}/bin/nbmake-${MACHINE})
2003-01-23 19:24:08 +03:00
parseoptions()
{
opts='a:B:bD:dEhi:j:k:M:m:nO:oR:rT:tUuV:w:Z:'
Rework how build.sh functions, so that command line options set various parameters, and a list of "operations" defines what to do. The full usage is show below. Notes: `-b' has been deprecated (it always occurs now) `-d' is replaced by "distribution" `-R rel' onlys sets RELEASEDIR; use "release" to build a release `-k kern' has been replaced by "kernel=kern" `-i idir' has been replaced by "install=idir" -r now occurs before nbmake is rebuilt Add a copyright (long due!). Rework the code to (a KNF inspired) ShellNF. Use functions appropriately. Allow `nb' prefix to be easily changed to something else. Solve world peace (just kidding) This is part of the (never achievable) goal of attempting to make NetBSD easier to build... --8<-- new usage follows --8<-- Usage: build.sh [-EnorUu] [-a arch] [-B buildid] [-D dest] [-j njob] [-M obj] [-m mach] [-O obj] [-R release] [-T tools] [-V var=[value]] [-w wrapper] [operation [...] ] System build operations (all imply "obj" and "tools"): build Run "make build" distribution Run "make distribution" (includes etc/ files) release Run "make release" (includes kernels & distrib media) Other operations: obj Run "make obj" (default unless -o) tools Build and install tools kernel=conf Build kernel with config file `conf' install=idir Run "make installworld" to `idir' (useful after 'distribution' or 'release') Options: -a arch Set MACHINE_ARCH to arch (otherwise deduced from MACHINE) -B buildId Set BUILDID to buildId -D dest Set DESTDIR to dest -E Set "expert" mode; disables some DESTDIR checks -j njob Run up to njob jobs in parallel; see make(1) -M obj Set obj root directory to obj (sets MAKEOBJDIRPREFIX) -m mach Set MACHINE to mach (not required if NetBSD native) -n Show commands that would be executed, but do not execute them -O obj Set obj root directory to obj (sets a MAKEOBJDIR pattern) -o Set MKOBJDIRS=no (do not create objdirs at start of build) -R release Set RELEASEDIR to release -r Remove contents of TOOLDIR and DESTDIR before building -T tools Set TOOLDIR to tools. If unset, and TOOLDIR is not set in the environment, nbmake will be (re)built unconditionally. -U Set UNPRIVED -u Set UPDATE -V v=[val] Set variable `v' to `val' -w wrapper Create nbmake script as wrapper (default: ${TOOLDIR}/bin/nbmake-${MACHINE})
2003-01-23 19:24:08 +03:00
opt_a=no
if type getopts >/dev/null 2>&1; then
# Use POSIX getopts.
#
getoptcmd='getopts ${opts} opt && opt=-${opt}'
Rework how build.sh functions, so that command line options set various parameters, and a list of "operations" defines what to do. The full usage is show below. Notes: `-b' has been deprecated (it always occurs now) `-d' is replaced by "distribution" `-R rel' onlys sets RELEASEDIR; use "release" to build a release `-k kern' has been replaced by "kernel=kern" `-i idir' has been replaced by "install=idir" -r now occurs before nbmake is rebuilt Add a copyright (long due!). Rework the code to (a KNF inspired) ShellNF. Use functions appropriately. Allow `nb' prefix to be easily changed to something else. Solve world peace (just kidding) This is part of the (never achievable) goal of attempting to make NetBSD easier to build... --8<-- new usage follows --8<-- Usage: build.sh [-EnorUu] [-a arch] [-B buildid] [-D dest] [-j njob] [-M obj] [-m mach] [-O obj] [-R release] [-T tools] [-V var=[value]] [-w wrapper] [operation [...] ] System build operations (all imply "obj" and "tools"): build Run "make build" distribution Run "make distribution" (includes etc/ files) release Run "make release" (includes kernels & distrib media) Other operations: obj Run "make obj" (default unless -o) tools Build and install tools kernel=conf Build kernel with config file `conf' install=idir Run "make installworld" to `idir' (useful after 'distribution' or 'release') Options: -a arch Set MACHINE_ARCH to arch (otherwise deduced from MACHINE) -B buildId Set BUILDID to buildId -D dest Set DESTDIR to dest -E Set "expert" mode; disables some DESTDIR checks -j njob Run up to njob jobs in parallel; see make(1) -M obj Set obj root directory to obj (sets MAKEOBJDIRPREFIX) -m mach Set MACHINE to mach (not required if NetBSD native) -n Show commands that would be executed, but do not execute them -O obj Set obj root directory to obj (sets a MAKEOBJDIR pattern) -o Set MKOBJDIRS=no (do not create objdirs at start of build) -R release Set RELEASEDIR to release -r Remove contents of TOOLDIR and DESTDIR before building -T tools Set TOOLDIR to tools. If unset, and TOOLDIR is not set in the environment, nbmake will be (re)built unconditionally. -U Set UNPRIVED -u Set UPDATE -V v=[val] Set variable `v' to `val' -w wrapper Create nbmake script as wrapper (default: ${TOOLDIR}/bin/nbmake-${MACHINE})
2003-01-23 19:24:08 +03:00
optargcmd=':'
optremcmd='shift $((${OPTIND} -1))'
Rework how build.sh functions, so that command line options set various parameters, and a list of "operations" defines what to do. The full usage is show below. Notes: `-b' has been deprecated (it always occurs now) `-d' is replaced by "distribution" `-R rel' onlys sets RELEASEDIR; use "release" to build a release `-k kern' has been replaced by "kernel=kern" `-i idir' has been replaced by "install=idir" -r now occurs before nbmake is rebuilt Add a copyright (long due!). Rework the code to (a KNF inspired) ShellNF. Use functions appropriately. Allow `nb' prefix to be easily changed to something else. Solve world peace (just kidding) This is part of the (never achievable) goal of attempting to make NetBSD easier to build... --8<-- new usage follows --8<-- Usage: build.sh [-EnorUu] [-a arch] [-B buildid] [-D dest] [-j njob] [-M obj] [-m mach] [-O obj] [-R release] [-T tools] [-V var=[value]] [-w wrapper] [operation [...] ] System build operations (all imply "obj" and "tools"): build Run "make build" distribution Run "make distribution" (includes etc/ files) release Run "make release" (includes kernels & distrib media) Other operations: obj Run "make obj" (default unless -o) tools Build and install tools kernel=conf Build kernel with config file `conf' install=idir Run "make installworld" to `idir' (useful after 'distribution' or 'release') Options: -a arch Set MACHINE_ARCH to arch (otherwise deduced from MACHINE) -B buildId Set BUILDID to buildId -D dest Set DESTDIR to dest -E Set "expert" mode; disables some DESTDIR checks -j njob Run up to njob jobs in parallel; see make(1) -M obj Set obj root directory to obj (sets MAKEOBJDIRPREFIX) -m mach Set MACHINE to mach (not required if NetBSD native) -n Show commands that would be executed, but do not execute them -O obj Set obj root directory to obj (sets a MAKEOBJDIR pattern) -o Set MKOBJDIRS=no (do not create objdirs at start of build) -R release Set RELEASEDIR to release -r Remove contents of TOOLDIR and DESTDIR before building -T tools Set TOOLDIR to tools. If unset, and TOOLDIR is not set in the environment, nbmake will be (re)built unconditionally. -U Set UNPRIVED -u Set UPDATE -V v=[val] Set variable `v' to `val' -w wrapper Create nbmake script as wrapper (default: ${TOOLDIR}/bin/nbmake-${MACHINE})
2003-01-23 19:24:08 +03:00
else
type getopt >/dev/null 2>&1 ||
bomb "/bin/sh shell is too old; try ksh or bash"
Rework how build.sh functions, so that command line options set various parameters, and a list of "operations" defines what to do. The full usage is show below. Notes: `-b' has been deprecated (it always occurs now) `-d' is replaced by "distribution" `-R rel' onlys sets RELEASEDIR; use "release" to build a release `-k kern' has been replaced by "kernel=kern" `-i idir' has been replaced by "install=idir" -r now occurs before nbmake is rebuilt Add a copyright (long due!). Rework the code to (a KNF inspired) ShellNF. Use functions appropriately. Allow `nb' prefix to be easily changed to something else. Solve world peace (just kidding) This is part of the (never achievable) goal of attempting to make NetBSD easier to build... --8<-- new usage follows --8<-- Usage: build.sh [-EnorUu] [-a arch] [-B buildid] [-D dest] [-j njob] [-M obj] [-m mach] [-O obj] [-R release] [-T tools] [-V var=[value]] [-w wrapper] [operation [...] ] System build operations (all imply "obj" and "tools"): build Run "make build" distribution Run "make distribution" (includes etc/ files) release Run "make release" (includes kernels & distrib media) Other operations: obj Run "make obj" (default unless -o) tools Build and install tools kernel=conf Build kernel with config file `conf' install=idir Run "make installworld" to `idir' (useful after 'distribution' or 'release') Options: -a arch Set MACHINE_ARCH to arch (otherwise deduced from MACHINE) -B buildId Set BUILDID to buildId -D dest Set DESTDIR to dest -E Set "expert" mode; disables some DESTDIR checks -j njob Run up to njob jobs in parallel; see make(1) -M obj Set obj root directory to obj (sets MAKEOBJDIRPREFIX) -m mach Set MACHINE to mach (not required if NetBSD native) -n Show commands that would be executed, but do not execute them -O obj Set obj root directory to obj (sets a MAKEOBJDIR pattern) -o Set MKOBJDIRS=no (do not create objdirs at start of build) -R release Set RELEASEDIR to release -r Remove contents of TOOLDIR and DESTDIR before building -T tools Set TOOLDIR to tools. If unset, and TOOLDIR is not set in the environment, nbmake will be (re)built unconditionally. -U Set UNPRIVED -u Set UPDATE -V v=[val] Set variable `v' to `val' -w wrapper Create nbmake script as wrapper (default: ${TOOLDIR}/bin/nbmake-${MACHINE})
2003-01-23 19:24:08 +03:00
# Use old-style getopt(1) (doesn't handle whitespace in args).
#
args="$(getopt ${opts} $*)"
Rework how build.sh functions, so that command line options set various parameters, and a list of "operations" defines what to do. The full usage is show below. Notes: `-b' has been deprecated (it always occurs now) `-d' is replaced by "distribution" `-R rel' onlys sets RELEASEDIR; use "release" to build a release `-k kern' has been replaced by "kernel=kern" `-i idir' has been replaced by "install=idir" -r now occurs before nbmake is rebuilt Add a copyright (long due!). Rework the code to (a KNF inspired) ShellNF. Use functions appropriately. Allow `nb' prefix to be easily changed to something else. Solve world peace (just kidding) This is part of the (never achievable) goal of attempting to make NetBSD easier to build... --8<-- new usage follows --8<-- Usage: build.sh [-EnorUu] [-a arch] [-B buildid] [-D dest] [-j njob] [-M obj] [-m mach] [-O obj] [-R release] [-T tools] [-V var=[value]] [-w wrapper] [operation [...] ] System build operations (all imply "obj" and "tools"): build Run "make build" distribution Run "make distribution" (includes etc/ files) release Run "make release" (includes kernels & distrib media) Other operations: obj Run "make obj" (default unless -o) tools Build and install tools kernel=conf Build kernel with config file `conf' install=idir Run "make installworld" to `idir' (useful after 'distribution' or 'release') Options: -a arch Set MACHINE_ARCH to arch (otherwise deduced from MACHINE) -B buildId Set BUILDID to buildId -D dest Set DESTDIR to dest -E Set "expert" mode; disables some DESTDIR checks -j njob Run up to njob jobs in parallel; see make(1) -M obj Set obj root directory to obj (sets MAKEOBJDIRPREFIX) -m mach Set MACHINE to mach (not required if NetBSD native) -n Show commands that would be executed, but do not execute them -O obj Set obj root directory to obj (sets a MAKEOBJDIR pattern) -o Set MKOBJDIRS=no (do not create objdirs at start of build) -R release Set RELEASEDIR to release -r Remove contents of TOOLDIR and DESTDIR before building -T tools Set TOOLDIR to tools. If unset, and TOOLDIR is not set in the environment, nbmake will be (re)built unconditionally. -U Set UNPRIVED -u Set UPDATE -V v=[val] Set variable `v' to `val' -w wrapper Create nbmake script as wrapper (default: ${TOOLDIR}/bin/nbmake-${MACHINE})
2003-01-23 19:24:08 +03:00
[ $? = 0 ] || usage
set -- ${args}
Rework how build.sh functions, so that command line options set various parameters, and a list of "operations" defines what to do. The full usage is show below. Notes: `-b' has been deprecated (it always occurs now) `-d' is replaced by "distribution" `-R rel' onlys sets RELEASEDIR; use "release" to build a release `-k kern' has been replaced by "kernel=kern" `-i idir' has been replaced by "install=idir" -r now occurs before nbmake is rebuilt Add a copyright (long due!). Rework the code to (a KNF inspired) ShellNF. Use functions appropriately. Allow `nb' prefix to be easily changed to something else. Solve world peace (just kidding) This is part of the (never achievable) goal of attempting to make NetBSD easier to build... --8<-- new usage follows --8<-- Usage: build.sh [-EnorUu] [-a arch] [-B buildid] [-D dest] [-j njob] [-M obj] [-m mach] [-O obj] [-R release] [-T tools] [-V var=[value]] [-w wrapper] [operation [...] ] System build operations (all imply "obj" and "tools"): build Run "make build" distribution Run "make distribution" (includes etc/ files) release Run "make release" (includes kernels & distrib media) Other operations: obj Run "make obj" (default unless -o) tools Build and install tools kernel=conf Build kernel with config file `conf' install=idir Run "make installworld" to `idir' (useful after 'distribution' or 'release') Options: -a arch Set MACHINE_ARCH to arch (otherwise deduced from MACHINE) -B buildId Set BUILDID to buildId -D dest Set DESTDIR to dest -E Set "expert" mode; disables some DESTDIR checks -j njob Run up to njob jobs in parallel; see make(1) -M obj Set obj root directory to obj (sets MAKEOBJDIRPREFIX) -m mach Set MACHINE to mach (not required if NetBSD native) -n Show commands that would be executed, but do not execute them -O obj Set obj root directory to obj (sets a MAKEOBJDIR pattern) -o Set MKOBJDIRS=no (do not create objdirs at start of build) -R release Set RELEASEDIR to release -r Remove contents of TOOLDIR and DESTDIR before building -T tools Set TOOLDIR to tools. If unset, and TOOLDIR is not set in the environment, nbmake will be (re)built unconditionally. -U Set UNPRIVED -u Set UPDATE -V v=[val] Set variable `v' to `val' -w wrapper Create nbmake script as wrapper (default: ${TOOLDIR}/bin/nbmake-${MACHINE})
2003-01-23 19:24:08 +03:00
getoptcmd='[ $# -gt 0 ] && opt="$1" && shift'
optargcmd='OPTARG="$1"; shift'
optremcmd=':'
fi
Rework how build.sh functions, so that command line options set various parameters, and a list of "operations" defines what to do. The full usage is show below. Notes: `-b' has been deprecated (it always occurs now) `-d' is replaced by "distribution" `-R rel' onlys sets RELEASEDIR; use "release" to build a release `-k kern' has been replaced by "kernel=kern" `-i idir' has been replaced by "install=idir" -r now occurs before nbmake is rebuilt Add a copyright (long due!). Rework the code to (a KNF inspired) ShellNF. Use functions appropriately. Allow `nb' prefix to be easily changed to something else. Solve world peace (just kidding) This is part of the (never achievable) goal of attempting to make NetBSD easier to build... --8<-- new usage follows --8<-- Usage: build.sh [-EnorUu] [-a arch] [-B buildid] [-D dest] [-j njob] [-M obj] [-m mach] [-O obj] [-R release] [-T tools] [-V var=[value]] [-w wrapper] [operation [...] ] System build operations (all imply "obj" and "tools"): build Run "make build" distribution Run "make distribution" (includes etc/ files) release Run "make release" (includes kernels & distrib media) Other operations: obj Run "make obj" (default unless -o) tools Build and install tools kernel=conf Build kernel with config file `conf' install=idir Run "make installworld" to `idir' (useful after 'distribution' or 'release') Options: -a arch Set MACHINE_ARCH to arch (otherwise deduced from MACHINE) -B buildId Set BUILDID to buildId -D dest Set DESTDIR to dest -E Set "expert" mode; disables some DESTDIR checks -j njob Run up to njob jobs in parallel; see make(1) -M obj Set obj root directory to obj (sets MAKEOBJDIRPREFIX) -m mach Set MACHINE to mach (not required if NetBSD native) -n Show commands that would be executed, but do not execute them -O obj Set obj root directory to obj (sets a MAKEOBJDIR pattern) -o Set MKOBJDIRS=no (do not create objdirs at start of build) -R release Set RELEASEDIR to release -r Remove contents of TOOLDIR and DESTDIR before building -T tools Set TOOLDIR to tools. If unset, and TOOLDIR is not set in the environment, nbmake will be (re)built unconditionally. -U Set UNPRIVED -u Set UPDATE -V v=[val] Set variable `v' to `val' -w wrapper Create nbmake script as wrapper (default: ${TOOLDIR}/bin/nbmake-${MACHINE})
2003-01-23 19:24:08 +03:00
# Parse command line options.
#
while eval ${getoptcmd}; do
case ${opt} in
Rework how build.sh functions, so that command line options set various parameters, and a list of "operations" defines what to do. The full usage is show below. Notes: `-b' has been deprecated (it always occurs now) `-d' is replaced by "distribution" `-R rel' onlys sets RELEASEDIR; use "release" to build a release `-k kern' has been replaced by "kernel=kern" `-i idir' has been replaced by "install=idir" -r now occurs before nbmake is rebuilt Add a copyright (long due!). Rework the code to (a KNF inspired) ShellNF. Use functions appropriately. Allow `nb' prefix to be easily changed to something else. Solve world peace (just kidding) This is part of the (never achievable) goal of attempting to make NetBSD easier to build... --8<-- new usage follows --8<-- Usage: build.sh [-EnorUu] [-a arch] [-B buildid] [-D dest] [-j njob] [-M obj] [-m mach] [-O obj] [-R release] [-T tools] [-V var=[value]] [-w wrapper] [operation [...] ] System build operations (all imply "obj" and "tools"): build Run "make build" distribution Run "make distribution" (includes etc/ files) release Run "make release" (includes kernels & distrib media) Other operations: obj Run "make obj" (default unless -o) tools Build and install tools kernel=conf Build kernel with config file `conf' install=idir Run "make installworld" to `idir' (useful after 'distribution' or 'release') Options: -a arch Set MACHINE_ARCH to arch (otherwise deduced from MACHINE) -B buildId Set BUILDID to buildId -D dest Set DESTDIR to dest -E Set "expert" mode; disables some DESTDIR checks -j njob Run up to njob jobs in parallel; see make(1) -M obj Set obj root directory to obj (sets MAKEOBJDIRPREFIX) -m mach Set MACHINE to mach (not required if NetBSD native) -n Show commands that would be executed, but do not execute them -O obj Set obj root directory to obj (sets a MAKEOBJDIR pattern) -o Set MKOBJDIRS=no (do not create objdirs at start of build) -R release Set RELEASEDIR to release -r Remove contents of TOOLDIR and DESTDIR before building -T tools Set TOOLDIR to tools. If unset, and TOOLDIR is not set in the environment, nbmake will be (re)built unconditionally. -U Set UNPRIVED -u Set UPDATE -V v=[val] Set variable `v' to `val' -w wrapper Create nbmake script as wrapper (default: ${TOOLDIR}/bin/nbmake-${MACHINE})
2003-01-23 19:24:08 +03:00
-a)
eval ${optargcmd}
MACHINE_ARCH=${OPTARG}
Rework how build.sh functions, so that command line options set various parameters, and a list of "operations" defines what to do. The full usage is show below. Notes: `-b' has been deprecated (it always occurs now) `-d' is replaced by "distribution" `-R rel' onlys sets RELEASEDIR; use "release" to build a release `-k kern' has been replaced by "kernel=kern" `-i idir' has been replaced by "install=idir" -r now occurs before nbmake is rebuilt Add a copyright (long due!). Rework the code to (a KNF inspired) ShellNF. Use functions appropriately. Allow `nb' prefix to be easily changed to something else. Solve world peace (just kidding) This is part of the (never achievable) goal of attempting to make NetBSD easier to build... --8<-- new usage follows --8<-- Usage: build.sh [-EnorUu] [-a arch] [-B buildid] [-D dest] [-j njob] [-M obj] [-m mach] [-O obj] [-R release] [-T tools] [-V var=[value]] [-w wrapper] [operation [...] ] System build operations (all imply "obj" and "tools"): build Run "make build" distribution Run "make distribution" (includes etc/ files) release Run "make release" (includes kernels & distrib media) Other operations: obj Run "make obj" (default unless -o) tools Build and install tools kernel=conf Build kernel with config file `conf' install=idir Run "make installworld" to `idir' (useful after 'distribution' or 'release') Options: -a arch Set MACHINE_ARCH to arch (otherwise deduced from MACHINE) -B buildId Set BUILDID to buildId -D dest Set DESTDIR to dest -E Set "expert" mode; disables some DESTDIR checks -j njob Run up to njob jobs in parallel; see make(1) -M obj Set obj root directory to obj (sets MAKEOBJDIRPREFIX) -m mach Set MACHINE to mach (not required if NetBSD native) -n Show commands that would be executed, but do not execute them -O obj Set obj root directory to obj (sets a MAKEOBJDIR pattern) -o Set MKOBJDIRS=no (do not create objdirs at start of build) -R release Set RELEASEDIR to release -r Remove contents of TOOLDIR and DESTDIR before building -T tools Set TOOLDIR to tools. If unset, and TOOLDIR is not set in the environment, nbmake will be (re)built unconditionally. -U Set UNPRIVED -u Set UPDATE -V v=[val] Set variable `v' to `val' -w wrapper Create nbmake script as wrapper (default: ${TOOLDIR}/bin/nbmake-${MACHINE})
2003-01-23 19:24:08 +03:00
opt_a=yes
;;
Rework how build.sh functions, so that command line options set various parameters, and a list of "operations" defines what to do. The full usage is show below. Notes: `-b' has been deprecated (it always occurs now) `-d' is replaced by "distribution" `-R rel' onlys sets RELEASEDIR; use "release" to build a release `-k kern' has been replaced by "kernel=kern" `-i idir' has been replaced by "install=idir" -r now occurs before nbmake is rebuilt Add a copyright (long due!). Rework the code to (a KNF inspired) ShellNF. Use functions appropriately. Allow `nb' prefix to be easily changed to something else. Solve world peace (just kidding) This is part of the (never achievable) goal of attempting to make NetBSD easier to build... --8<-- new usage follows --8<-- Usage: build.sh [-EnorUu] [-a arch] [-B buildid] [-D dest] [-j njob] [-M obj] [-m mach] [-O obj] [-R release] [-T tools] [-V var=[value]] [-w wrapper] [operation [...] ] System build operations (all imply "obj" and "tools"): build Run "make build" distribution Run "make distribution" (includes etc/ files) release Run "make release" (includes kernels & distrib media) Other operations: obj Run "make obj" (default unless -o) tools Build and install tools kernel=conf Build kernel with config file `conf' install=idir Run "make installworld" to `idir' (useful after 'distribution' or 'release') Options: -a arch Set MACHINE_ARCH to arch (otherwise deduced from MACHINE) -B buildId Set BUILDID to buildId -D dest Set DESTDIR to dest -E Set "expert" mode; disables some DESTDIR checks -j njob Run up to njob jobs in parallel; see make(1) -M obj Set obj root directory to obj (sets MAKEOBJDIRPREFIX) -m mach Set MACHINE to mach (not required if NetBSD native) -n Show commands that would be executed, but do not execute them -O obj Set obj root directory to obj (sets a MAKEOBJDIR pattern) -o Set MKOBJDIRS=no (do not create objdirs at start of build) -R release Set RELEASEDIR to release -r Remove contents of TOOLDIR and DESTDIR before building -T tools Set TOOLDIR to tools. If unset, and TOOLDIR is not set in the environment, nbmake will be (re)built unconditionally. -U Set UNPRIVED -u Set UPDATE -V v=[val] Set variable `v' to `val' -w wrapper Create nbmake script as wrapper (default: ${TOOLDIR}/bin/nbmake-${MACHINE})
2003-01-23 19:24:08 +03:00
-B)
eval ${optargcmd}
BUILDID=${OPTARG}
Rework how build.sh functions, so that command line options set various parameters, and a list of "operations" defines what to do. The full usage is show below. Notes: `-b' has been deprecated (it always occurs now) `-d' is replaced by "distribution" `-R rel' onlys sets RELEASEDIR; use "release" to build a release `-k kern' has been replaced by "kernel=kern" `-i idir' has been replaced by "install=idir" -r now occurs before nbmake is rebuilt Add a copyright (long due!). Rework the code to (a KNF inspired) ShellNF. Use functions appropriately. Allow `nb' prefix to be easily changed to something else. Solve world peace (just kidding) This is part of the (never achievable) goal of attempting to make NetBSD easier to build... --8<-- new usage follows --8<-- Usage: build.sh [-EnorUu] [-a arch] [-B buildid] [-D dest] [-j njob] [-M obj] [-m mach] [-O obj] [-R release] [-T tools] [-V var=[value]] [-w wrapper] [operation [...] ] System build operations (all imply "obj" and "tools"): build Run "make build" distribution Run "make distribution" (includes etc/ files) release Run "make release" (includes kernels & distrib media) Other operations: obj Run "make obj" (default unless -o) tools Build and install tools kernel=conf Build kernel with config file `conf' install=idir Run "make installworld" to `idir' (useful after 'distribution' or 'release') Options: -a arch Set MACHINE_ARCH to arch (otherwise deduced from MACHINE) -B buildId Set BUILDID to buildId -D dest Set DESTDIR to dest -E Set "expert" mode; disables some DESTDIR checks -j njob Run up to njob jobs in parallel; see make(1) -M obj Set obj root directory to obj (sets MAKEOBJDIRPREFIX) -m mach Set MACHINE to mach (not required if NetBSD native) -n Show commands that would be executed, but do not execute them -O obj Set obj root directory to obj (sets a MAKEOBJDIR pattern) -o Set MKOBJDIRS=no (do not create objdirs at start of build) -R release Set RELEASEDIR to release -r Remove contents of TOOLDIR and DESTDIR before building -T tools Set TOOLDIR to tools. If unset, and TOOLDIR is not set in the environment, nbmake will be (re)built unconditionally. -U Set UNPRIVED -u Set UPDATE -V v=[val] Set variable `v' to `val' -w wrapper Create nbmake script as wrapper (default: ${TOOLDIR}/bin/nbmake-${MACHINE})
2003-01-23 19:24:08 +03:00
;;
Rework how build.sh functions, so that command line options set various parameters, and a list of "operations" defines what to do. The full usage is show below. Notes: `-b' has been deprecated (it always occurs now) `-d' is replaced by "distribution" `-R rel' onlys sets RELEASEDIR; use "release" to build a release `-k kern' has been replaced by "kernel=kern" `-i idir' has been replaced by "install=idir" -r now occurs before nbmake is rebuilt Add a copyright (long due!). Rework the code to (a KNF inspired) ShellNF. Use functions appropriately. Allow `nb' prefix to be easily changed to something else. Solve world peace (just kidding) This is part of the (never achievable) goal of attempting to make NetBSD easier to build... --8<-- new usage follows --8<-- Usage: build.sh [-EnorUu] [-a arch] [-B buildid] [-D dest] [-j njob] [-M obj] [-m mach] [-O obj] [-R release] [-T tools] [-V var=[value]] [-w wrapper] [operation [...] ] System build operations (all imply "obj" and "tools"): build Run "make build" distribution Run "make distribution" (includes etc/ files) release Run "make release" (includes kernels & distrib media) Other operations: obj Run "make obj" (default unless -o) tools Build and install tools kernel=conf Build kernel with config file `conf' install=idir Run "make installworld" to `idir' (useful after 'distribution' or 'release') Options: -a arch Set MACHINE_ARCH to arch (otherwise deduced from MACHINE) -B buildId Set BUILDID to buildId -D dest Set DESTDIR to dest -E Set "expert" mode; disables some DESTDIR checks -j njob Run up to njob jobs in parallel; see make(1) -M obj Set obj root directory to obj (sets MAKEOBJDIRPREFIX) -m mach Set MACHINE to mach (not required if NetBSD native) -n Show commands that would be executed, but do not execute them -O obj Set obj root directory to obj (sets a MAKEOBJDIR pattern) -o Set MKOBJDIRS=no (do not create objdirs at start of build) -R release Set RELEASEDIR to release -r Remove contents of TOOLDIR and DESTDIR before building -T tools Set TOOLDIR to tools. If unset, and TOOLDIR is not set in the environment, nbmake will be (re)built unconditionally. -U Set UNPRIVED -u Set UPDATE -V v=[val] Set variable `v' to `val' -w wrapper Create nbmake script as wrapper (default: ${TOOLDIR}/bin/nbmake-${MACHINE})
2003-01-23 19:24:08 +03:00
-b)
usage "'-b' has been replaced by 'makewrapper'"
Rework how build.sh functions, so that command line options set various parameters, and a list of "operations" defines what to do. The full usage is show below. Notes: `-b' has been deprecated (it always occurs now) `-d' is replaced by "distribution" `-R rel' onlys sets RELEASEDIR; use "release" to build a release `-k kern' has been replaced by "kernel=kern" `-i idir' has been replaced by "install=idir" -r now occurs before nbmake is rebuilt Add a copyright (long due!). Rework the code to (a KNF inspired) ShellNF. Use functions appropriately. Allow `nb' prefix to be easily changed to something else. Solve world peace (just kidding) This is part of the (never achievable) goal of attempting to make NetBSD easier to build... --8<-- new usage follows --8<-- Usage: build.sh [-EnorUu] [-a arch] [-B buildid] [-D dest] [-j njob] [-M obj] [-m mach] [-O obj] [-R release] [-T tools] [-V var=[value]] [-w wrapper] [operation [...] ] System build operations (all imply "obj" and "tools"): build Run "make build" distribution Run "make distribution" (includes etc/ files) release Run "make release" (includes kernels & distrib media) Other operations: obj Run "make obj" (default unless -o) tools Build and install tools kernel=conf Build kernel with config file `conf' install=idir Run "make installworld" to `idir' (useful after 'distribution' or 'release') Options: -a arch Set MACHINE_ARCH to arch (otherwise deduced from MACHINE) -B buildId Set BUILDID to buildId -D dest Set DESTDIR to dest -E Set "expert" mode; disables some DESTDIR checks -j njob Run up to njob jobs in parallel; see make(1) -M obj Set obj root directory to obj (sets MAKEOBJDIRPREFIX) -m mach Set MACHINE to mach (not required if NetBSD native) -n Show commands that would be executed, but do not execute them -O obj Set obj root directory to obj (sets a MAKEOBJDIR pattern) -o Set MKOBJDIRS=no (do not create objdirs at start of build) -R release Set RELEASEDIR to release -r Remove contents of TOOLDIR and DESTDIR before building -T tools Set TOOLDIR to tools. If unset, and TOOLDIR is not set in the environment, nbmake will be (re)built unconditionally. -U Set UNPRIVED -u Set UPDATE -V v=[val] Set variable `v' to `val' -w wrapper Create nbmake script as wrapper (default: ${TOOLDIR}/bin/nbmake-${MACHINE})
2003-01-23 19:24:08 +03:00
;;
Rework how build.sh functions, so that command line options set various parameters, and a list of "operations" defines what to do. The full usage is show below. Notes: `-b' has been deprecated (it always occurs now) `-d' is replaced by "distribution" `-R rel' onlys sets RELEASEDIR; use "release" to build a release `-k kern' has been replaced by "kernel=kern" `-i idir' has been replaced by "install=idir" -r now occurs before nbmake is rebuilt Add a copyright (long due!). Rework the code to (a KNF inspired) ShellNF. Use functions appropriately. Allow `nb' prefix to be easily changed to something else. Solve world peace (just kidding) This is part of the (never achievable) goal of attempting to make NetBSD easier to build... --8<-- new usage follows --8<-- Usage: build.sh [-EnorUu] [-a arch] [-B buildid] [-D dest] [-j njob] [-M obj] [-m mach] [-O obj] [-R release] [-T tools] [-V var=[value]] [-w wrapper] [operation [...] ] System build operations (all imply "obj" and "tools"): build Run "make build" distribution Run "make distribution" (includes etc/ files) release Run "make release" (includes kernels & distrib media) Other operations: obj Run "make obj" (default unless -o) tools Build and install tools kernel=conf Build kernel with config file `conf' install=idir Run "make installworld" to `idir' (useful after 'distribution' or 'release') Options: -a arch Set MACHINE_ARCH to arch (otherwise deduced from MACHINE) -B buildId Set BUILDID to buildId -D dest Set DESTDIR to dest -E Set "expert" mode; disables some DESTDIR checks -j njob Run up to njob jobs in parallel; see make(1) -M obj Set obj root directory to obj (sets MAKEOBJDIRPREFIX) -m mach Set MACHINE to mach (not required if NetBSD native) -n Show commands that would be executed, but do not execute them -O obj Set obj root directory to obj (sets a MAKEOBJDIR pattern) -o Set MKOBJDIRS=no (do not create objdirs at start of build) -R release Set RELEASEDIR to release -r Remove contents of TOOLDIR and DESTDIR before building -T tools Set TOOLDIR to tools. If unset, and TOOLDIR is not set in the environment, nbmake will be (re)built unconditionally. -U Set UNPRIVED -u Set UPDATE -V v=[val] Set variable `v' to `val' -w wrapper Create nbmake script as wrapper (default: ${TOOLDIR}/bin/nbmake-${MACHINE})
2003-01-23 19:24:08 +03:00
-D)
eval ${optargcmd}; resolvepath
setmakeenv DESTDIR "${OPTARG}"
Rework how build.sh functions, so that command line options set various parameters, and a list of "operations" defines what to do. The full usage is show below. Notes: `-b' has been deprecated (it always occurs now) `-d' is replaced by "distribution" `-R rel' onlys sets RELEASEDIR; use "release" to build a release `-k kern' has been replaced by "kernel=kern" `-i idir' has been replaced by "install=idir" -r now occurs before nbmake is rebuilt Add a copyright (long due!). Rework the code to (a KNF inspired) ShellNF. Use functions appropriately. Allow `nb' prefix to be easily changed to something else. Solve world peace (just kidding) This is part of the (never achievable) goal of attempting to make NetBSD easier to build... --8<-- new usage follows --8<-- Usage: build.sh [-EnorUu] [-a arch] [-B buildid] [-D dest] [-j njob] [-M obj] [-m mach] [-O obj] [-R release] [-T tools] [-V var=[value]] [-w wrapper] [operation [...] ] System build operations (all imply "obj" and "tools"): build Run "make build" distribution Run "make distribution" (includes etc/ files) release Run "make release" (includes kernels & distrib media) Other operations: obj Run "make obj" (default unless -o) tools Build and install tools kernel=conf Build kernel with config file `conf' install=idir Run "make installworld" to `idir' (useful after 'distribution' or 'release') Options: -a arch Set MACHINE_ARCH to arch (otherwise deduced from MACHINE) -B buildId Set BUILDID to buildId -D dest Set DESTDIR to dest -E Set "expert" mode; disables some DESTDIR checks -j njob Run up to njob jobs in parallel; see make(1) -M obj Set obj root directory to obj (sets MAKEOBJDIRPREFIX) -m mach Set MACHINE to mach (not required if NetBSD native) -n Show commands that would be executed, but do not execute them -O obj Set obj root directory to obj (sets a MAKEOBJDIR pattern) -o Set MKOBJDIRS=no (do not create objdirs at start of build) -R release Set RELEASEDIR to release -r Remove contents of TOOLDIR and DESTDIR before building -T tools Set TOOLDIR to tools. If unset, and TOOLDIR is not set in the environment, nbmake will be (re)built unconditionally. -U Set UNPRIVED -u Set UPDATE -V v=[val] Set variable `v' to `val' -w wrapper Create nbmake script as wrapper (default: ${TOOLDIR}/bin/nbmake-${MACHINE})
2003-01-23 19:24:08 +03:00
;;
Rework how build.sh functions, so that command line options set various parameters, and a list of "operations" defines what to do. The full usage is show below. Notes: `-b' has been deprecated (it always occurs now) `-d' is replaced by "distribution" `-R rel' onlys sets RELEASEDIR; use "release" to build a release `-k kern' has been replaced by "kernel=kern" `-i idir' has been replaced by "install=idir" -r now occurs before nbmake is rebuilt Add a copyright (long due!). Rework the code to (a KNF inspired) ShellNF. Use functions appropriately. Allow `nb' prefix to be easily changed to something else. Solve world peace (just kidding) This is part of the (never achievable) goal of attempting to make NetBSD easier to build... --8<-- new usage follows --8<-- Usage: build.sh [-EnorUu] [-a arch] [-B buildid] [-D dest] [-j njob] [-M obj] [-m mach] [-O obj] [-R release] [-T tools] [-V var=[value]] [-w wrapper] [operation [...] ] System build operations (all imply "obj" and "tools"): build Run "make build" distribution Run "make distribution" (includes etc/ files) release Run "make release" (includes kernels & distrib media) Other operations: obj Run "make obj" (default unless -o) tools Build and install tools kernel=conf Build kernel with config file `conf' install=idir Run "make installworld" to `idir' (useful after 'distribution' or 'release') Options: -a arch Set MACHINE_ARCH to arch (otherwise deduced from MACHINE) -B buildId Set BUILDID to buildId -D dest Set DESTDIR to dest -E Set "expert" mode; disables some DESTDIR checks -j njob Run up to njob jobs in parallel; see make(1) -M obj Set obj root directory to obj (sets MAKEOBJDIRPREFIX) -m mach Set MACHINE to mach (not required if NetBSD native) -n Show commands that would be executed, but do not execute them -O obj Set obj root directory to obj (sets a MAKEOBJDIR pattern) -o Set MKOBJDIRS=no (do not create objdirs at start of build) -R release Set RELEASEDIR to release -r Remove contents of TOOLDIR and DESTDIR before building -T tools Set TOOLDIR to tools. If unset, and TOOLDIR is not set in the environment, nbmake will be (re)built unconditionally. -U Set UNPRIVED -u Set UPDATE -V v=[val] Set variable `v' to `val' -w wrapper Create nbmake script as wrapper (default: ${TOOLDIR}/bin/nbmake-${MACHINE})
2003-01-23 19:24:08 +03:00
-d)
usage "'-d' has been replaced by 'distribution'"
;;
Rework how build.sh functions, so that command line options set various parameters, and a list of "operations" defines what to do. The full usage is show below. Notes: `-b' has been deprecated (it always occurs now) `-d' is replaced by "distribution" `-R rel' onlys sets RELEASEDIR; use "release" to build a release `-k kern' has been replaced by "kernel=kern" `-i idir' has been replaced by "install=idir" -r now occurs before nbmake is rebuilt Add a copyright (long due!). Rework the code to (a KNF inspired) ShellNF. Use functions appropriately. Allow `nb' prefix to be easily changed to something else. Solve world peace (just kidding) This is part of the (never achievable) goal of attempting to make NetBSD easier to build... --8<-- new usage follows --8<-- Usage: build.sh [-EnorUu] [-a arch] [-B buildid] [-D dest] [-j njob] [-M obj] [-m mach] [-O obj] [-R release] [-T tools] [-V var=[value]] [-w wrapper] [operation [...] ] System build operations (all imply "obj" and "tools"): build Run "make build" distribution Run "make distribution" (includes etc/ files) release Run "make release" (includes kernels & distrib media) Other operations: obj Run "make obj" (default unless -o) tools Build and install tools kernel=conf Build kernel with config file `conf' install=idir Run "make installworld" to `idir' (useful after 'distribution' or 'release') Options: -a arch Set MACHINE_ARCH to arch (otherwise deduced from MACHINE) -B buildId Set BUILDID to buildId -D dest Set DESTDIR to dest -E Set "expert" mode; disables some DESTDIR checks -j njob Run up to njob jobs in parallel; see make(1) -M obj Set obj root directory to obj (sets MAKEOBJDIRPREFIX) -m mach Set MACHINE to mach (not required if NetBSD native) -n Show commands that would be executed, but do not execute them -O obj Set obj root directory to obj (sets a MAKEOBJDIR pattern) -o Set MKOBJDIRS=no (do not create objdirs at start of build) -R release Set RELEASEDIR to release -r Remove contents of TOOLDIR and DESTDIR before building -T tools Set TOOLDIR to tools. If unset, and TOOLDIR is not set in the environment, nbmake will be (re)built unconditionally. -U Set UNPRIVED -u Set UPDATE -V v=[val] Set variable `v' to `val' -w wrapper Create nbmake script as wrapper (default: ${TOOLDIR}/bin/nbmake-${MACHINE})
2003-01-23 19:24:08 +03:00
-E)
do_expertmode=true
;;
Rework how build.sh functions, so that command line options set various parameters, and a list of "operations" defines what to do. The full usage is show below. Notes: `-b' has been deprecated (it always occurs now) `-d' is replaced by "distribution" `-R rel' onlys sets RELEASEDIR; use "release" to build a release `-k kern' has been replaced by "kernel=kern" `-i idir' has been replaced by "install=idir" -r now occurs before nbmake is rebuilt Add a copyright (long due!). Rework the code to (a KNF inspired) ShellNF. Use functions appropriately. Allow `nb' prefix to be easily changed to something else. Solve world peace (just kidding) This is part of the (never achievable) goal of attempting to make NetBSD easier to build... --8<-- new usage follows --8<-- Usage: build.sh [-EnorUu] [-a arch] [-B buildid] [-D dest] [-j njob] [-M obj] [-m mach] [-O obj] [-R release] [-T tools] [-V var=[value]] [-w wrapper] [operation [...] ] System build operations (all imply "obj" and "tools"): build Run "make build" distribution Run "make distribution" (includes etc/ files) release Run "make release" (includes kernels & distrib media) Other operations: obj Run "make obj" (default unless -o) tools Build and install tools kernel=conf Build kernel with config file `conf' install=idir Run "make installworld" to `idir' (useful after 'distribution' or 'release') Options: -a arch Set MACHINE_ARCH to arch (otherwise deduced from MACHINE) -B buildId Set BUILDID to buildId -D dest Set DESTDIR to dest -E Set "expert" mode; disables some DESTDIR checks -j njob Run up to njob jobs in parallel; see make(1) -M obj Set obj root directory to obj (sets MAKEOBJDIRPREFIX) -m mach Set MACHINE to mach (not required if NetBSD native) -n Show commands that would be executed, but do not execute them -O obj Set obj root directory to obj (sets a MAKEOBJDIR pattern) -o Set MKOBJDIRS=no (do not create objdirs at start of build) -R release Set RELEASEDIR to release -r Remove contents of TOOLDIR and DESTDIR before building -T tools Set TOOLDIR to tools. If unset, and TOOLDIR is not set in the environment, nbmake will be (re)built unconditionally. -U Set UNPRIVED -u Set UPDATE -V v=[val] Set variable `v' to `val' -w wrapper Create nbmake script as wrapper (default: ${TOOLDIR}/bin/nbmake-${MACHINE})
2003-01-23 19:24:08 +03:00
-i)
usage "'-i idir' has been replaced by 'install=idir'"
;;
Rework how build.sh functions, so that command line options set various parameters, and a list of "operations" defines what to do. The full usage is show below. Notes: `-b' has been deprecated (it always occurs now) `-d' is replaced by "distribution" `-R rel' onlys sets RELEASEDIR; use "release" to build a release `-k kern' has been replaced by "kernel=kern" `-i idir' has been replaced by "install=idir" -r now occurs before nbmake is rebuilt Add a copyright (long due!). Rework the code to (a KNF inspired) ShellNF. Use functions appropriately. Allow `nb' prefix to be easily changed to something else. Solve world peace (just kidding) This is part of the (never achievable) goal of attempting to make NetBSD easier to build... --8<-- new usage follows --8<-- Usage: build.sh [-EnorUu] [-a arch] [-B buildid] [-D dest] [-j njob] [-M obj] [-m mach] [-O obj] [-R release] [-T tools] [-V var=[value]] [-w wrapper] [operation [...] ] System build operations (all imply "obj" and "tools"): build Run "make build" distribution Run "make distribution" (includes etc/ files) release Run "make release" (includes kernels & distrib media) Other operations: obj Run "make obj" (default unless -o) tools Build and install tools kernel=conf Build kernel with config file `conf' install=idir Run "make installworld" to `idir' (useful after 'distribution' or 'release') Options: -a arch Set MACHINE_ARCH to arch (otherwise deduced from MACHINE) -B buildId Set BUILDID to buildId -D dest Set DESTDIR to dest -E Set "expert" mode; disables some DESTDIR checks -j njob Run up to njob jobs in parallel; see make(1) -M obj Set obj root directory to obj (sets MAKEOBJDIRPREFIX) -m mach Set MACHINE to mach (not required if NetBSD native) -n Show commands that would be executed, but do not execute them -O obj Set obj root directory to obj (sets a MAKEOBJDIR pattern) -o Set MKOBJDIRS=no (do not create objdirs at start of build) -R release Set RELEASEDIR to release -r Remove contents of TOOLDIR and DESTDIR before building -T tools Set TOOLDIR to tools. If unset, and TOOLDIR is not set in the environment, nbmake will be (re)built unconditionally. -U Set UNPRIVED -u Set UPDATE -V v=[val] Set variable `v' to `val' -w wrapper Create nbmake script as wrapper (default: ${TOOLDIR}/bin/nbmake-${MACHINE})
2003-01-23 19:24:08 +03:00
-j)
eval ${optargcmd}
parallel="-j ${OPTARG}"
Rework how build.sh functions, so that command line options set various parameters, and a list of "operations" defines what to do. The full usage is show below. Notes: `-b' has been deprecated (it always occurs now) `-d' is replaced by "distribution" `-R rel' onlys sets RELEASEDIR; use "release" to build a release `-k kern' has been replaced by "kernel=kern" `-i idir' has been replaced by "install=idir" -r now occurs before nbmake is rebuilt Add a copyright (long due!). Rework the code to (a KNF inspired) ShellNF. Use functions appropriately. Allow `nb' prefix to be easily changed to something else. Solve world peace (just kidding) This is part of the (never achievable) goal of attempting to make NetBSD easier to build... --8<-- new usage follows --8<-- Usage: build.sh [-EnorUu] [-a arch] [-B buildid] [-D dest] [-j njob] [-M obj] [-m mach] [-O obj] [-R release] [-T tools] [-V var=[value]] [-w wrapper] [operation [...] ] System build operations (all imply "obj" and "tools"): build Run "make build" distribution Run "make distribution" (includes etc/ files) release Run "make release" (includes kernels & distrib media) Other operations: obj Run "make obj" (default unless -o) tools Build and install tools kernel=conf Build kernel with config file `conf' install=idir Run "make installworld" to `idir' (useful after 'distribution' or 'release') Options: -a arch Set MACHINE_ARCH to arch (otherwise deduced from MACHINE) -B buildId Set BUILDID to buildId -D dest Set DESTDIR to dest -E Set "expert" mode; disables some DESTDIR checks -j njob Run up to njob jobs in parallel; see make(1) -M obj Set obj root directory to obj (sets MAKEOBJDIRPREFIX) -m mach Set MACHINE to mach (not required if NetBSD native) -n Show commands that would be executed, but do not execute them -O obj Set obj root directory to obj (sets a MAKEOBJDIR pattern) -o Set MKOBJDIRS=no (do not create objdirs at start of build) -R release Set RELEASEDIR to release -r Remove contents of TOOLDIR and DESTDIR before building -T tools Set TOOLDIR to tools. If unset, and TOOLDIR is not set in the environment, nbmake will be (re)built unconditionally. -U Set UNPRIVED -u Set UPDATE -V v=[val] Set variable `v' to `val' -w wrapper Create nbmake script as wrapper (default: ${TOOLDIR}/bin/nbmake-${MACHINE})
2003-01-23 19:24:08 +03:00
;;
Rework how build.sh functions, so that command line options set various parameters, and a list of "operations" defines what to do. The full usage is show below. Notes: `-b' has been deprecated (it always occurs now) `-d' is replaced by "distribution" `-R rel' onlys sets RELEASEDIR; use "release" to build a release `-k kern' has been replaced by "kernel=kern" `-i idir' has been replaced by "install=idir" -r now occurs before nbmake is rebuilt Add a copyright (long due!). Rework the code to (a KNF inspired) ShellNF. Use functions appropriately. Allow `nb' prefix to be easily changed to something else. Solve world peace (just kidding) This is part of the (never achievable) goal of attempting to make NetBSD easier to build... --8<-- new usage follows --8<-- Usage: build.sh [-EnorUu] [-a arch] [-B buildid] [-D dest] [-j njob] [-M obj] [-m mach] [-O obj] [-R release] [-T tools] [-V var=[value]] [-w wrapper] [operation [...] ] System build operations (all imply "obj" and "tools"): build Run "make build" distribution Run "make distribution" (includes etc/ files) release Run "make release" (includes kernels & distrib media) Other operations: obj Run "make obj" (default unless -o) tools Build and install tools kernel=conf Build kernel with config file `conf' install=idir Run "make installworld" to `idir' (useful after 'distribution' or 'release') Options: -a arch Set MACHINE_ARCH to arch (otherwise deduced from MACHINE) -B buildId Set BUILDID to buildId -D dest Set DESTDIR to dest -E Set "expert" mode; disables some DESTDIR checks -j njob Run up to njob jobs in parallel; see make(1) -M obj Set obj root directory to obj (sets MAKEOBJDIRPREFIX) -m mach Set MACHINE to mach (not required if NetBSD native) -n Show commands that would be executed, but do not execute them -O obj Set obj root directory to obj (sets a MAKEOBJDIR pattern) -o Set MKOBJDIRS=no (do not create objdirs at start of build) -R release Set RELEASEDIR to release -r Remove contents of TOOLDIR and DESTDIR before building -T tools Set TOOLDIR to tools. If unset, and TOOLDIR is not set in the environment, nbmake will be (re)built unconditionally. -U Set UNPRIVED -u Set UPDATE -V v=[val] Set variable `v' to `val' -w wrapper Create nbmake script as wrapper (default: ${TOOLDIR}/bin/nbmake-${MACHINE})
2003-01-23 19:24:08 +03:00
-k)
usage "'-k conf' has been replaced by 'kernel=conf'"
;;
Rework how build.sh functions, so that command line options set various parameters, and a list of "operations" defines what to do. The full usage is show below. Notes: `-b' has been deprecated (it always occurs now) `-d' is replaced by "distribution" `-R rel' onlys sets RELEASEDIR; use "release" to build a release `-k kern' has been replaced by "kernel=kern" `-i idir' has been replaced by "install=idir" -r now occurs before nbmake is rebuilt Add a copyright (long due!). Rework the code to (a KNF inspired) ShellNF. Use functions appropriately. Allow `nb' prefix to be easily changed to something else. Solve world peace (just kidding) This is part of the (never achievable) goal of attempting to make NetBSD easier to build... --8<-- new usage follows --8<-- Usage: build.sh [-EnorUu] [-a arch] [-B buildid] [-D dest] [-j njob] [-M obj] [-m mach] [-O obj] [-R release] [-T tools] [-V var=[value]] [-w wrapper] [operation [...] ] System build operations (all imply "obj" and "tools"): build Run "make build" distribution Run "make distribution" (includes etc/ files) release Run "make release" (includes kernels & distrib media) Other operations: obj Run "make obj" (default unless -o) tools Build and install tools kernel=conf Build kernel with config file `conf' install=idir Run "make installworld" to `idir' (useful after 'distribution' or 'release') Options: -a arch Set MACHINE_ARCH to arch (otherwise deduced from MACHINE) -B buildId Set BUILDID to buildId -D dest Set DESTDIR to dest -E Set "expert" mode; disables some DESTDIR checks -j njob Run up to njob jobs in parallel; see make(1) -M obj Set obj root directory to obj (sets MAKEOBJDIRPREFIX) -m mach Set MACHINE to mach (not required if NetBSD native) -n Show commands that would be executed, but do not execute them -O obj Set obj root directory to obj (sets a MAKEOBJDIR pattern) -o Set MKOBJDIRS=no (do not create objdirs at start of build) -R release Set RELEASEDIR to release -r Remove contents of TOOLDIR and DESTDIR before building -T tools Set TOOLDIR to tools. If unset, and TOOLDIR is not set in the environment, nbmake will be (re)built unconditionally. -U Set UNPRIVED -u Set UPDATE -V v=[val] Set variable `v' to `val' -w wrapper Create nbmake script as wrapper (default: ${TOOLDIR}/bin/nbmake-${MACHINE})
2003-01-23 19:24:08 +03:00
-M)
eval ${optargcmd}; resolvepath
makeobjdir="${OPTARG}"
unsetmakeenv MAKEOBJDIR
setmakeenv MAKEOBJDIRPREFIX "${OPTARG}"
Rework how build.sh functions, so that command line options set various parameters, and a list of "operations" defines what to do. The full usage is show below. Notes: `-b' has been deprecated (it always occurs now) `-d' is replaced by "distribution" `-R rel' onlys sets RELEASEDIR; use "release" to build a release `-k kern' has been replaced by "kernel=kern" `-i idir' has been replaced by "install=idir" -r now occurs before nbmake is rebuilt Add a copyright (long due!). Rework the code to (a KNF inspired) ShellNF. Use functions appropriately. Allow `nb' prefix to be easily changed to something else. Solve world peace (just kidding) This is part of the (never achievable) goal of attempting to make NetBSD easier to build... --8<-- new usage follows --8<-- Usage: build.sh [-EnorUu] [-a arch] [-B buildid] [-D dest] [-j njob] [-M obj] [-m mach] [-O obj] [-R release] [-T tools] [-V var=[value]] [-w wrapper] [operation [...] ] System build operations (all imply "obj" and "tools"): build Run "make build" distribution Run "make distribution" (includes etc/ files) release Run "make release" (includes kernels & distrib media) Other operations: obj Run "make obj" (default unless -o) tools Build and install tools kernel=conf Build kernel with config file `conf' install=idir Run "make installworld" to `idir' (useful after 'distribution' or 'release') Options: -a arch Set MACHINE_ARCH to arch (otherwise deduced from MACHINE) -B buildId Set BUILDID to buildId -D dest Set DESTDIR to dest -E Set "expert" mode; disables some DESTDIR checks -j njob Run up to njob jobs in parallel; see make(1) -M obj Set obj root directory to obj (sets MAKEOBJDIRPREFIX) -m mach Set MACHINE to mach (not required if NetBSD native) -n Show commands that would be executed, but do not execute them -O obj Set obj root directory to obj (sets a MAKEOBJDIR pattern) -o Set MKOBJDIRS=no (do not create objdirs at start of build) -R release Set RELEASEDIR to release -r Remove contents of TOOLDIR and DESTDIR before building -T tools Set TOOLDIR to tools. If unset, and TOOLDIR is not set in the environment, nbmake will be (re)built unconditionally. -U Set UNPRIVED -u Set UPDATE -V v=[val] Set variable `v' to `val' -w wrapper Create nbmake script as wrapper (default: ${TOOLDIR}/bin/nbmake-${MACHINE})
2003-01-23 19:24:08 +03:00
;;
Rework how build.sh functions, so that command line options set various parameters, and a list of "operations" defines what to do. The full usage is show below. Notes: `-b' has been deprecated (it always occurs now) `-d' is replaced by "distribution" `-R rel' onlys sets RELEASEDIR; use "release" to build a release `-k kern' has been replaced by "kernel=kern" `-i idir' has been replaced by "install=idir" -r now occurs before nbmake is rebuilt Add a copyright (long due!). Rework the code to (a KNF inspired) ShellNF. Use functions appropriately. Allow `nb' prefix to be easily changed to something else. Solve world peace (just kidding) This is part of the (never achievable) goal of attempting to make NetBSD easier to build... --8<-- new usage follows --8<-- Usage: build.sh [-EnorUu] [-a arch] [-B buildid] [-D dest] [-j njob] [-M obj] [-m mach] [-O obj] [-R release] [-T tools] [-V var=[value]] [-w wrapper] [operation [...] ] System build operations (all imply "obj" and "tools"): build Run "make build" distribution Run "make distribution" (includes etc/ files) release Run "make release" (includes kernels & distrib media) Other operations: obj Run "make obj" (default unless -o) tools Build and install tools kernel=conf Build kernel with config file `conf' install=idir Run "make installworld" to `idir' (useful after 'distribution' or 'release') Options: -a arch Set MACHINE_ARCH to arch (otherwise deduced from MACHINE) -B buildId Set BUILDID to buildId -D dest Set DESTDIR to dest -E Set "expert" mode; disables some DESTDIR checks -j njob Run up to njob jobs in parallel; see make(1) -M obj Set obj root directory to obj (sets MAKEOBJDIRPREFIX) -m mach Set MACHINE to mach (not required if NetBSD native) -n Show commands that would be executed, but do not execute them -O obj Set obj root directory to obj (sets a MAKEOBJDIR pattern) -o Set MKOBJDIRS=no (do not create objdirs at start of build) -R release Set RELEASEDIR to release -r Remove contents of TOOLDIR and DESTDIR before building -T tools Set TOOLDIR to tools. If unset, and TOOLDIR is not set in the environment, nbmake will be (re)built unconditionally. -U Set UNPRIVED -u Set UPDATE -V v=[val] Set variable `v' to `val' -w wrapper Create nbmake script as wrapper (default: ${TOOLDIR}/bin/nbmake-${MACHINE})
2003-01-23 19:24:08 +03:00
# -m overrides MACHINE_ARCH unless "-a" is specified
-m)
eval ${optargcmd}
MACHINE="${OPTARG}"
[ "${opt_a}" != "yes" ] && getarch
Rework how build.sh functions, so that command line options set various parameters, and a list of "operations" defines what to do. The full usage is show below. Notes: `-b' has been deprecated (it always occurs now) `-d' is replaced by "distribution" `-R rel' onlys sets RELEASEDIR; use "release" to build a release `-k kern' has been replaced by "kernel=kern" `-i idir' has been replaced by "install=idir" -r now occurs before nbmake is rebuilt Add a copyright (long due!). Rework the code to (a KNF inspired) ShellNF. Use functions appropriately. Allow `nb' prefix to be easily changed to something else. Solve world peace (just kidding) This is part of the (never achievable) goal of attempting to make NetBSD easier to build... --8<-- new usage follows --8<-- Usage: build.sh [-EnorUu] [-a arch] [-B buildid] [-D dest] [-j njob] [-M obj] [-m mach] [-O obj] [-R release] [-T tools] [-V var=[value]] [-w wrapper] [operation [...] ] System build operations (all imply "obj" and "tools"): build Run "make build" distribution Run "make distribution" (includes etc/ files) release Run "make release" (includes kernels & distrib media) Other operations: obj Run "make obj" (default unless -o) tools Build and install tools kernel=conf Build kernel with config file `conf' install=idir Run "make installworld" to `idir' (useful after 'distribution' or 'release') Options: -a arch Set MACHINE_ARCH to arch (otherwise deduced from MACHINE) -B buildId Set BUILDID to buildId -D dest Set DESTDIR to dest -E Set "expert" mode; disables some DESTDIR checks -j njob Run up to njob jobs in parallel; see make(1) -M obj Set obj root directory to obj (sets MAKEOBJDIRPREFIX) -m mach Set MACHINE to mach (not required if NetBSD native) -n Show commands that would be executed, but do not execute them -O obj Set obj root directory to obj (sets a MAKEOBJDIR pattern) -o Set MKOBJDIRS=no (do not create objdirs at start of build) -R release Set RELEASEDIR to release -r Remove contents of TOOLDIR and DESTDIR before building -T tools Set TOOLDIR to tools. If unset, and TOOLDIR is not set in the environment, nbmake will be (re)built unconditionally. -U Set UNPRIVED -u Set UPDATE -V v=[val] Set variable `v' to `val' -w wrapper Create nbmake script as wrapper (default: ${TOOLDIR}/bin/nbmake-${MACHINE})
2003-01-23 19:24:08 +03:00
;;
Rework how build.sh functions, so that command line options set various parameters, and a list of "operations" defines what to do. The full usage is show below. Notes: `-b' has been deprecated (it always occurs now) `-d' is replaced by "distribution" `-R rel' onlys sets RELEASEDIR; use "release" to build a release `-k kern' has been replaced by "kernel=kern" `-i idir' has been replaced by "install=idir" -r now occurs before nbmake is rebuilt Add a copyright (long due!). Rework the code to (a KNF inspired) ShellNF. Use functions appropriately. Allow `nb' prefix to be easily changed to something else. Solve world peace (just kidding) This is part of the (never achievable) goal of attempting to make NetBSD easier to build... --8<-- new usage follows --8<-- Usage: build.sh [-EnorUu] [-a arch] [-B buildid] [-D dest] [-j njob] [-M obj] [-m mach] [-O obj] [-R release] [-T tools] [-V var=[value]] [-w wrapper] [operation [...] ] System build operations (all imply "obj" and "tools"): build Run "make build" distribution Run "make distribution" (includes etc/ files) release Run "make release" (includes kernels & distrib media) Other operations: obj Run "make obj" (default unless -o) tools Build and install tools kernel=conf Build kernel with config file `conf' install=idir Run "make installworld" to `idir' (useful after 'distribution' or 'release') Options: -a arch Set MACHINE_ARCH to arch (otherwise deduced from MACHINE) -B buildId Set BUILDID to buildId -D dest Set DESTDIR to dest -E Set "expert" mode; disables some DESTDIR checks -j njob Run up to njob jobs in parallel; see make(1) -M obj Set obj root directory to obj (sets MAKEOBJDIRPREFIX) -m mach Set MACHINE to mach (not required if NetBSD native) -n Show commands that would be executed, but do not execute them -O obj Set obj root directory to obj (sets a MAKEOBJDIR pattern) -o Set MKOBJDIRS=no (do not create objdirs at start of build) -R release Set RELEASEDIR to release -r Remove contents of TOOLDIR and DESTDIR before building -T tools Set TOOLDIR to tools. If unset, and TOOLDIR is not set in the environment, nbmake will be (re)built unconditionally. -U Set UNPRIVED -u Set UPDATE -V v=[val] Set variable `v' to `val' -w wrapper Create nbmake script as wrapper (default: ${TOOLDIR}/bin/nbmake-${MACHINE})
2003-01-23 19:24:08 +03:00
-n)
runcmd=echo
;;
Rework how build.sh functions, so that command line options set various parameters, and a list of "operations" defines what to do. The full usage is show below. Notes: `-b' has been deprecated (it always occurs now) `-d' is replaced by "distribution" `-R rel' onlys sets RELEASEDIR; use "release" to build a release `-k kern' has been replaced by "kernel=kern" `-i idir' has been replaced by "install=idir" -r now occurs before nbmake is rebuilt Add a copyright (long due!). Rework the code to (a KNF inspired) ShellNF. Use functions appropriately. Allow `nb' prefix to be easily changed to something else. Solve world peace (just kidding) This is part of the (never achievable) goal of attempting to make NetBSD easier to build... --8<-- new usage follows --8<-- Usage: build.sh [-EnorUu] [-a arch] [-B buildid] [-D dest] [-j njob] [-M obj] [-m mach] [-O obj] [-R release] [-T tools] [-V var=[value]] [-w wrapper] [operation [...] ] System build operations (all imply "obj" and "tools"): build Run "make build" distribution Run "make distribution" (includes etc/ files) release Run "make release" (includes kernels & distrib media) Other operations: obj Run "make obj" (default unless -o) tools Build and install tools kernel=conf Build kernel with config file `conf' install=idir Run "make installworld" to `idir' (useful after 'distribution' or 'release') Options: -a arch Set MACHINE_ARCH to arch (otherwise deduced from MACHINE) -B buildId Set BUILDID to buildId -D dest Set DESTDIR to dest -E Set "expert" mode; disables some DESTDIR checks -j njob Run up to njob jobs in parallel; see make(1) -M obj Set obj root directory to obj (sets MAKEOBJDIRPREFIX) -m mach Set MACHINE to mach (not required if NetBSD native) -n Show commands that would be executed, but do not execute them -O obj Set obj root directory to obj (sets a MAKEOBJDIR pattern) -o Set MKOBJDIRS=no (do not create objdirs at start of build) -R release Set RELEASEDIR to release -r Remove contents of TOOLDIR and DESTDIR before building -T tools Set TOOLDIR to tools. If unset, and TOOLDIR is not set in the environment, nbmake will be (re)built unconditionally. -U Set UNPRIVED -u Set UPDATE -V v=[val] Set variable `v' to `val' -w wrapper Create nbmake script as wrapper (default: ${TOOLDIR}/bin/nbmake-${MACHINE})
2003-01-23 19:24:08 +03:00
-O)
eval ${optargcmd}; resolvepath
makeobjdir="${OPTARG}"
unsetmakeenv MAKEOBJDIRPREFIX
setmakeenv MAKEOBJDIR "\${.CURDIR:C,^$TOP,$OPTARG,}"
Rework how build.sh functions, so that command line options set various parameters, and a list of "operations" defines what to do. The full usage is show below. Notes: `-b' has been deprecated (it always occurs now) `-d' is replaced by "distribution" `-R rel' onlys sets RELEASEDIR; use "release" to build a release `-k kern' has been replaced by "kernel=kern" `-i idir' has been replaced by "install=idir" -r now occurs before nbmake is rebuilt Add a copyright (long due!). Rework the code to (a KNF inspired) ShellNF. Use functions appropriately. Allow `nb' prefix to be easily changed to something else. Solve world peace (just kidding) This is part of the (never achievable) goal of attempting to make NetBSD easier to build... --8<-- new usage follows --8<-- Usage: build.sh [-EnorUu] [-a arch] [-B buildid] [-D dest] [-j njob] [-M obj] [-m mach] [-O obj] [-R release] [-T tools] [-V var=[value]] [-w wrapper] [operation [...] ] System build operations (all imply "obj" and "tools"): build Run "make build" distribution Run "make distribution" (includes etc/ files) release Run "make release" (includes kernels & distrib media) Other operations: obj Run "make obj" (default unless -o) tools Build and install tools kernel=conf Build kernel with config file `conf' install=idir Run "make installworld" to `idir' (useful after 'distribution' or 'release') Options: -a arch Set MACHINE_ARCH to arch (otherwise deduced from MACHINE) -B buildId Set BUILDID to buildId -D dest Set DESTDIR to dest -E Set "expert" mode; disables some DESTDIR checks -j njob Run up to njob jobs in parallel; see make(1) -M obj Set obj root directory to obj (sets MAKEOBJDIRPREFIX) -m mach Set MACHINE to mach (not required if NetBSD native) -n Show commands that would be executed, but do not execute them -O obj Set obj root directory to obj (sets a MAKEOBJDIR pattern) -o Set MKOBJDIRS=no (do not create objdirs at start of build) -R release Set RELEASEDIR to release -r Remove contents of TOOLDIR and DESTDIR before building -T tools Set TOOLDIR to tools. If unset, and TOOLDIR is not set in the environment, nbmake will be (re)built unconditionally. -U Set UNPRIVED -u Set UPDATE -V v=[val] Set variable `v' to `val' -w wrapper Create nbmake script as wrapper (default: ${TOOLDIR}/bin/nbmake-${MACHINE})
2003-01-23 19:24:08 +03:00
;;
Rework how build.sh functions, so that command line options set various parameters, and a list of "operations" defines what to do. The full usage is show below. Notes: `-b' has been deprecated (it always occurs now) `-d' is replaced by "distribution" `-R rel' onlys sets RELEASEDIR; use "release" to build a release `-k kern' has been replaced by "kernel=kern" `-i idir' has been replaced by "install=idir" -r now occurs before nbmake is rebuilt Add a copyright (long due!). Rework the code to (a KNF inspired) ShellNF. Use functions appropriately. Allow `nb' prefix to be easily changed to something else. Solve world peace (just kidding) This is part of the (never achievable) goal of attempting to make NetBSD easier to build... --8<-- new usage follows --8<-- Usage: build.sh [-EnorUu] [-a arch] [-B buildid] [-D dest] [-j njob] [-M obj] [-m mach] [-O obj] [-R release] [-T tools] [-V var=[value]] [-w wrapper] [operation [...] ] System build operations (all imply "obj" and "tools"): build Run "make build" distribution Run "make distribution" (includes etc/ files) release Run "make release" (includes kernels & distrib media) Other operations: obj Run "make obj" (default unless -o) tools Build and install tools kernel=conf Build kernel with config file `conf' install=idir Run "make installworld" to `idir' (useful after 'distribution' or 'release') Options: -a arch Set MACHINE_ARCH to arch (otherwise deduced from MACHINE) -B buildId Set BUILDID to buildId -D dest Set DESTDIR to dest -E Set "expert" mode; disables some DESTDIR checks -j njob Run up to njob jobs in parallel; see make(1) -M obj Set obj root directory to obj (sets MAKEOBJDIRPREFIX) -m mach Set MACHINE to mach (not required if NetBSD native) -n Show commands that would be executed, but do not execute them -O obj Set obj root directory to obj (sets a MAKEOBJDIR pattern) -o Set MKOBJDIRS=no (do not create objdirs at start of build) -R release Set RELEASEDIR to release -r Remove contents of TOOLDIR and DESTDIR before building -T tools Set TOOLDIR to tools. If unset, and TOOLDIR is not set in the environment, nbmake will be (re)built unconditionally. -U Set UNPRIVED -u Set UPDATE -V v=[val] Set variable `v' to `val' -w wrapper Create nbmake script as wrapper (default: ${TOOLDIR}/bin/nbmake-${MACHINE})
2003-01-23 19:24:08 +03:00
-o)
MKOBJDIRS=no
;;
Rework how build.sh functions, so that command line options set various parameters, and a list of "operations" defines what to do. The full usage is show below. Notes: `-b' has been deprecated (it always occurs now) `-d' is replaced by "distribution" `-R rel' onlys sets RELEASEDIR; use "release" to build a release `-k kern' has been replaced by "kernel=kern" `-i idir' has been replaced by "install=idir" -r now occurs before nbmake is rebuilt Add a copyright (long due!). Rework the code to (a KNF inspired) ShellNF. Use functions appropriately. Allow `nb' prefix to be easily changed to something else. Solve world peace (just kidding) This is part of the (never achievable) goal of attempting to make NetBSD easier to build... --8<-- new usage follows --8<-- Usage: build.sh [-EnorUu] [-a arch] [-B buildid] [-D dest] [-j njob] [-M obj] [-m mach] [-O obj] [-R release] [-T tools] [-V var=[value]] [-w wrapper] [operation [...] ] System build operations (all imply "obj" and "tools"): build Run "make build" distribution Run "make distribution" (includes etc/ files) release Run "make release" (includes kernels & distrib media) Other operations: obj Run "make obj" (default unless -o) tools Build and install tools kernel=conf Build kernel with config file `conf' install=idir Run "make installworld" to `idir' (useful after 'distribution' or 'release') Options: -a arch Set MACHINE_ARCH to arch (otherwise deduced from MACHINE) -B buildId Set BUILDID to buildId -D dest Set DESTDIR to dest -E Set "expert" mode; disables some DESTDIR checks -j njob Run up to njob jobs in parallel; see make(1) -M obj Set obj root directory to obj (sets MAKEOBJDIRPREFIX) -m mach Set MACHINE to mach (not required if NetBSD native) -n Show commands that would be executed, but do not execute them -O obj Set obj root directory to obj (sets a MAKEOBJDIR pattern) -o Set MKOBJDIRS=no (do not create objdirs at start of build) -R release Set RELEASEDIR to release -r Remove contents of TOOLDIR and DESTDIR before building -T tools Set TOOLDIR to tools. If unset, and TOOLDIR is not set in the environment, nbmake will be (re)built unconditionally. -U Set UNPRIVED -u Set UPDATE -V v=[val] Set variable `v' to `val' -w wrapper Create nbmake script as wrapper (default: ${TOOLDIR}/bin/nbmake-${MACHINE})
2003-01-23 19:24:08 +03:00
-R)
eval ${optargcmd}; resolvepath
setmakeenv RELEASEDIR "${OPTARG}"
Rework how build.sh functions, so that command line options set various parameters, and a list of "operations" defines what to do. The full usage is show below. Notes: `-b' has been deprecated (it always occurs now) `-d' is replaced by "distribution" `-R rel' onlys sets RELEASEDIR; use "release" to build a release `-k kern' has been replaced by "kernel=kern" `-i idir' has been replaced by "install=idir" -r now occurs before nbmake is rebuilt Add a copyright (long due!). Rework the code to (a KNF inspired) ShellNF. Use functions appropriately. Allow `nb' prefix to be easily changed to something else. Solve world peace (just kidding) This is part of the (never achievable) goal of attempting to make NetBSD easier to build... --8<-- new usage follows --8<-- Usage: build.sh [-EnorUu] [-a arch] [-B buildid] [-D dest] [-j njob] [-M obj] [-m mach] [-O obj] [-R release] [-T tools] [-V var=[value]] [-w wrapper] [operation [...] ] System build operations (all imply "obj" and "tools"): build Run "make build" distribution Run "make distribution" (includes etc/ files) release Run "make release" (includes kernels & distrib media) Other operations: obj Run "make obj" (default unless -o) tools Build and install tools kernel=conf Build kernel with config file `conf' install=idir Run "make installworld" to `idir' (useful after 'distribution' or 'release') Options: -a arch Set MACHINE_ARCH to arch (otherwise deduced from MACHINE) -B buildId Set BUILDID to buildId -D dest Set DESTDIR to dest -E Set "expert" mode; disables some DESTDIR checks -j njob Run up to njob jobs in parallel; see make(1) -M obj Set obj root directory to obj (sets MAKEOBJDIRPREFIX) -m mach Set MACHINE to mach (not required if NetBSD native) -n Show commands that would be executed, but do not execute them -O obj Set obj root directory to obj (sets a MAKEOBJDIR pattern) -o Set MKOBJDIRS=no (do not create objdirs at start of build) -R release Set RELEASEDIR to release -r Remove contents of TOOLDIR and DESTDIR before building -T tools Set TOOLDIR to tools. If unset, and TOOLDIR is not set in the environment, nbmake will be (re)built unconditionally. -U Set UNPRIVED -u Set UPDATE -V v=[val] Set variable `v' to `val' -w wrapper Create nbmake script as wrapper (default: ${TOOLDIR}/bin/nbmake-${MACHINE})
2003-01-23 19:24:08 +03:00
;;
Rework how build.sh functions, so that command line options set various parameters, and a list of "operations" defines what to do. The full usage is show below. Notes: `-b' has been deprecated (it always occurs now) `-d' is replaced by "distribution" `-R rel' onlys sets RELEASEDIR; use "release" to build a release `-k kern' has been replaced by "kernel=kern" `-i idir' has been replaced by "install=idir" -r now occurs before nbmake is rebuilt Add a copyright (long due!). Rework the code to (a KNF inspired) ShellNF. Use functions appropriately. Allow `nb' prefix to be easily changed to something else. Solve world peace (just kidding) This is part of the (never achievable) goal of attempting to make NetBSD easier to build... --8<-- new usage follows --8<-- Usage: build.sh [-EnorUu] [-a arch] [-B buildid] [-D dest] [-j njob] [-M obj] [-m mach] [-O obj] [-R release] [-T tools] [-V var=[value]] [-w wrapper] [operation [...] ] System build operations (all imply "obj" and "tools"): build Run "make build" distribution Run "make distribution" (includes etc/ files) release Run "make release" (includes kernels & distrib media) Other operations: obj Run "make obj" (default unless -o) tools Build and install tools kernel=conf Build kernel with config file `conf' install=idir Run "make installworld" to `idir' (useful after 'distribution' or 'release') Options: -a arch Set MACHINE_ARCH to arch (otherwise deduced from MACHINE) -B buildId Set BUILDID to buildId -D dest Set DESTDIR to dest -E Set "expert" mode; disables some DESTDIR checks -j njob Run up to njob jobs in parallel; see make(1) -M obj Set obj root directory to obj (sets MAKEOBJDIRPREFIX) -m mach Set MACHINE to mach (not required if NetBSD native) -n Show commands that would be executed, but do not execute them -O obj Set obj root directory to obj (sets a MAKEOBJDIR pattern) -o Set MKOBJDIRS=no (do not create objdirs at start of build) -R release Set RELEASEDIR to release -r Remove contents of TOOLDIR and DESTDIR before building -T tools Set TOOLDIR to tools. If unset, and TOOLDIR is not set in the environment, nbmake will be (re)built unconditionally. -U Set UNPRIVED -u Set UPDATE -V v=[val] Set variable `v' to `val' -w wrapper Create nbmake script as wrapper (default: ${TOOLDIR}/bin/nbmake-${MACHINE})
2003-01-23 19:24:08 +03:00
-r)
do_removedirs=true
do_rebuildmake=true
;;
Rework how build.sh functions, so that command line options set various parameters, and a list of "operations" defines what to do. The full usage is show below. Notes: `-b' has been deprecated (it always occurs now) `-d' is replaced by "distribution" `-R rel' onlys sets RELEASEDIR; use "release" to build a release `-k kern' has been replaced by "kernel=kern" `-i idir' has been replaced by "install=idir" -r now occurs before nbmake is rebuilt Add a copyright (long due!). Rework the code to (a KNF inspired) ShellNF. Use functions appropriately. Allow `nb' prefix to be easily changed to something else. Solve world peace (just kidding) This is part of the (never achievable) goal of attempting to make NetBSD easier to build... --8<-- new usage follows --8<-- Usage: build.sh [-EnorUu] [-a arch] [-B buildid] [-D dest] [-j njob] [-M obj] [-m mach] [-O obj] [-R release] [-T tools] [-V var=[value]] [-w wrapper] [operation [...] ] System build operations (all imply "obj" and "tools"): build Run "make build" distribution Run "make distribution" (includes etc/ files) release Run "make release" (includes kernels & distrib media) Other operations: obj Run "make obj" (default unless -o) tools Build and install tools kernel=conf Build kernel with config file `conf' install=idir Run "make installworld" to `idir' (useful after 'distribution' or 'release') Options: -a arch Set MACHINE_ARCH to arch (otherwise deduced from MACHINE) -B buildId Set BUILDID to buildId -D dest Set DESTDIR to dest -E Set "expert" mode; disables some DESTDIR checks -j njob Run up to njob jobs in parallel; see make(1) -M obj Set obj root directory to obj (sets MAKEOBJDIRPREFIX) -m mach Set MACHINE to mach (not required if NetBSD native) -n Show commands that would be executed, but do not execute them -O obj Set obj root directory to obj (sets a MAKEOBJDIR pattern) -o Set MKOBJDIRS=no (do not create objdirs at start of build) -R release Set RELEASEDIR to release -r Remove contents of TOOLDIR and DESTDIR before building -T tools Set TOOLDIR to tools. If unset, and TOOLDIR is not set in the environment, nbmake will be (re)built unconditionally. -U Set UNPRIVED -u Set UPDATE -V v=[val] Set variable `v' to `val' -w wrapper Create nbmake script as wrapper (default: ${TOOLDIR}/bin/nbmake-${MACHINE})
2003-01-23 19:24:08 +03:00
-T)
eval ${optargcmd}; resolvepath
TOOLDIR="${OPTARG}"
Rework how build.sh functions, so that command line options set various parameters, and a list of "operations" defines what to do. The full usage is show below. Notes: `-b' has been deprecated (it always occurs now) `-d' is replaced by "distribution" `-R rel' onlys sets RELEASEDIR; use "release" to build a release `-k kern' has been replaced by "kernel=kern" `-i idir' has been replaced by "install=idir" -r now occurs before nbmake is rebuilt Add a copyright (long due!). Rework the code to (a KNF inspired) ShellNF. Use functions appropriately. Allow `nb' prefix to be easily changed to something else. Solve world peace (just kidding) This is part of the (never achievable) goal of attempting to make NetBSD easier to build... --8<-- new usage follows --8<-- Usage: build.sh [-EnorUu] [-a arch] [-B buildid] [-D dest] [-j njob] [-M obj] [-m mach] [-O obj] [-R release] [-T tools] [-V var=[value]] [-w wrapper] [operation [...] ] System build operations (all imply "obj" and "tools"): build Run "make build" distribution Run "make distribution" (includes etc/ files) release Run "make release" (includes kernels & distrib media) Other operations: obj Run "make obj" (default unless -o) tools Build and install tools kernel=conf Build kernel with config file `conf' install=idir Run "make installworld" to `idir' (useful after 'distribution' or 'release') Options: -a arch Set MACHINE_ARCH to arch (otherwise deduced from MACHINE) -B buildId Set BUILDID to buildId -D dest Set DESTDIR to dest -E Set "expert" mode; disables some DESTDIR checks -j njob Run up to njob jobs in parallel; see make(1) -M obj Set obj root directory to obj (sets MAKEOBJDIRPREFIX) -m mach Set MACHINE to mach (not required if NetBSD native) -n Show commands that would be executed, but do not execute them -O obj Set obj root directory to obj (sets a MAKEOBJDIR pattern) -o Set MKOBJDIRS=no (do not create objdirs at start of build) -R release Set RELEASEDIR to release -r Remove contents of TOOLDIR and DESTDIR before building -T tools Set TOOLDIR to tools. If unset, and TOOLDIR is not set in the environment, nbmake will be (re)built unconditionally. -U Set UNPRIVED -u Set UPDATE -V v=[val] Set variable `v' to `val' -w wrapper Create nbmake script as wrapper (default: ${TOOLDIR}/bin/nbmake-${MACHINE})
2003-01-23 19:24:08 +03:00
export TOOLDIR
;;
Rework how build.sh functions, so that command line options set various parameters, and a list of "operations" defines what to do. The full usage is show below. Notes: `-b' has been deprecated (it always occurs now) `-d' is replaced by "distribution" `-R rel' onlys sets RELEASEDIR; use "release" to build a release `-k kern' has been replaced by "kernel=kern" `-i idir' has been replaced by "install=idir" -r now occurs before nbmake is rebuilt Add a copyright (long due!). Rework the code to (a KNF inspired) ShellNF. Use functions appropriately. Allow `nb' prefix to be easily changed to something else. Solve world peace (just kidding) This is part of the (never achievable) goal of attempting to make NetBSD easier to build... --8<-- new usage follows --8<-- Usage: build.sh [-EnorUu] [-a arch] [-B buildid] [-D dest] [-j njob] [-M obj] [-m mach] [-O obj] [-R release] [-T tools] [-V var=[value]] [-w wrapper] [operation [...] ] System build operations (all imply "obj" and "tools"): build Run "make build" distribution Run "make distribution" (includes etc/ files) release Run "make release" (includes kernels & distrib media) Other operations: obj Run "make obj" (default unless -o) tools Build and install tools kernel=conf Build kernel with config file `conf' install=idir Run "make installworld" to `idir' (useful after 'distribution' or 'release') Options: -a arch Set MACHINE_ARCH to arch (otherwise deduced from MACHINE) -B buildId Set BUILDID to buildId -D dest Set DESTDIR to dest -E Set "expert" mode; disables some DESTDIR checks -j njob Run up to njob jobs in parallel; see make(1) -M obj Set obj root directory to obj (sets MAKEOBJDIRPREFIX) -m mach Set MACHINE to mach (not required if NetBSD native) -n Show commands that would be executed, but do not execute them -O obj Set obj root directory to obj (sets a MAKEOBJDIR pattern) -o Set MKOBJDIRS=no (do not create objdirs at start of build) -R release Set RELEASEDIR to release -r Remove contents of TOOLDIR and DESTDIR before building -T tools Set TOOLDIR to tools. If unset, and TOOLDIR is not set in the environment, nbmake will be (re)built unconditionally. -U Set UNPRIVED -u Set UPDATE -V v=[val] Set variable `v' to `val' -w wrapper Create nbmake script as wrapper (default: ${TOOLDIR}/bin/nbmake-${MACHINE})
2003-01-23 19:24:08 +03:00
-t)
usage "'-t' has been replaced by 'tools'"
;;
Rework how build.sh functions, so that command line options set various parameters, and a list of "operations" defines what to do. The full usage is show below. Notes: `-b' has been deprecated (it always occurs now) `-d' is replaced by "distribution" `-R rel' onlys sets RELEASEDIR; use "release" to build a release `-k kern' has been replaced by "kernel=kern" `-i idir' has been replaced by "install=idir" -r now occurs before nbmake is rebuilt Add a copyright (long due!). Rework the code to (a KNF inspired) ShellNF. Use functions appropriately. Allow `nb' prefix to be easily changed to something else. Solve world peace (just kidding) This is part of the (never achievable) goal of attempting to make NetBSD easier to build... --8<-- new usage follows --8<-- Usage: build.sh [-EnorUu] [-a arch] [-B buildid] [-D dest] [-j njob] [-M obj] [-m mach] [-O obj] [-R release] [-T tools] [-V var=[value]] [-w wrapper] [operation [...] ] System build operations (all imply "obj" and "tools"): build Run "make build" distribution Run "make distribution" (includes etc/ files) release Run "make release" (includes kernels & distrib media) Other operations: obj Run "make obj" (default unless -o) tools Build and install tools kernel=conf Build kernel with config file `conf' install=idir Run "make installworld" to `idir' (useful after 'distribution' or 'release') Options: -a arch Set MACHINE_ARCH to arch (otherwise deduced from MACHINE) -B buildId Set BUILDID to buildId -D dest Set DESTDIR to dest -E Set "expert" mode; disables some DESTDIR checks -j njob Run up to njob jobs in parallel; see make(1) -M obj Set obj root directory to obj (sets MAKEOBJDIRPREFIX) -m mach Set MACHINE to mach (not required if NetBSD native) -n Show commands that would be executed, but do not execute them -O obj Set obj root directory to obj (sets a MAKEOBJDIR pattern) -o Set MKOBJDIRS=no (do not create objdirs at start of build) -R release Set RELEASEDIR to release -r Remove contents of TOOLDIR and DESTDIR before building -T tools Set TOOLDIR to tools. If unset, and TOOLDIR is not set in the environment, nbmake will be (re)built unconditionally. -U Set UNPRIVED -u Set UPDATE -V v=[val] Set variable `v' to `val' -w wrapper Create nbmake script as wrapper (default: ${TOOLDIR}/bin/nbmake-${MACHINE})
2003-01-23 19:24:08 +03:00
-U)
setmakeenv MKUNPRIVED yes
Rework how build.sh functions, so that command line options set various parameters, and a list of "operations" defines what to do. The full usage is show below. Notes: `-b' has been deprecated (it always occurs now) `-d' is replaced by "distribution" `-R rel' onlys sets RELEASEDIR; use "release" to build a release `-k kern' has been replaced by "kernel=kern" `-i idir' has been replaced by "install=idir" -r now occurs before nbmake is rebuilt Add a copyright (long due!). Rework the code to (a KNF inspired) ShellNF. Use functions appropriately. Allow `nb' prefix to be easily changed to something else. Solve world peace (just kidding) This is part of the (never achievable) goal of attempting to make NetBSD easier to build... --8<-- new usage follows --8<-- Usage: build.sh [-EnorUu] [-a arch] [-B buildid] [-D dest] [-j njob] [-M obj] [-m mach] [-O obj] [-R release] [-T tools] [-V var=[value]] [-w wrapper] [operation [...] ] System build operations (all imply "obj" and "tools"): build Run "make build" distribution Run "make distribution" (includes etc/ files) release Run "make release" (includes kernels & distrib media) Other operations: obj Run "make obj" (default unless -o) tools Build and install tools kernel=conf Build kernel with config file `conf' install=idir Run "make installworld" to `idir' (useful after 'distribution' or 'release') Options: -a arch Set MACHINE_ARCH to arch (otherwise deduced from MACHINE) -B buildId Set BUILDID to buildId -D dest Set DESTDIR to dest -E Set "expert" mode; disables some DESTDIR checks -j njob Run up to njob jobs in parallel; see make(1) -M obj Set obj root directory to obj (sets MAKEOBJDIRPREFIX) -m mach Set MACHINE to mach (not required if NetBSD native) -n Show commands that would be executed, but do not execute them -O obj Set obj root directory to obj (sets a MAKEOBJDIR pattern) -o Set MKOBJDIRS=no (do not create objdirs at start of build) -R release Set RELEASEDIR to release -r Remove contents of TOOLDIR and DESTDIR before building -T tools Set TOOLDIR to tools. If unset, and TOOLDIR is not set in the environment, nbmake will be (re)built unconditionally. -U Set UNPRIVED -u Set UPDATE -V v=[val] Set variable `v' to `val' -w wrapper Create nbmake script as wrapper (default: ${TOOLDIR}/bin/nbmake-${MACHINE})
2003-01-23 19:24:08 +03:00
;;
2002-02-27 16:55:28 +03:00
Rework how build.sh functions, so that command line options set various parameters, and a list of "operations" defines what to do. The full usage is show below. Notes: `-b' has been deprecated (it always occurs now) `-d' is replaced by "distribution" `-R rel' onlys sets RELEASEDIR; use "release" to build a release `-k kern' has been replaced by "kernel=kern" `-i idir' has been replaced by "install=idir" -r now occurs before nbmake is rebuilt Add a copyright (long due!). Rework the code to (a KNF inspired) ShellNF. Use functions appropriately. Allow `nb' prefix to be easily changed to something else. Solve world peace (just kidding) This is part of the (never achievable) goal of attempting to make NetBSD easier to build... --8<-- new usage follows --8<-- Usage: build.sh [-EnorUu] [-a arch] [-B buildid] [-D dest] [-j njob] [-M obj] [-m mach] [-O obj] [-R release] [-T tools] [-V var=[value]] [-w wrapper] [operation [...] ] System build operations (all imply "obj" and "tools"): build Run "make build" distribution Run "make distribution" (includes etc/ files) release Run "make release" (includes kernels & distrib media) Other operations: obj Run "make obj" (default unless -o) tools Build and install tools kernel=conf Build kernel with config file `conf' install=idir Run "make installworld" to `idir' (useful after 'distribution' or 'release') Options: -a arch Set MACHINE_ARCH to arch (otherwise deduced from MACHINE) -B buildId Set BUILDID to buildId -D dest Set DESTDIR to dest -E Set "expert" mode; disables some DESTDIR checks -j njob Run up to njob jobs in parallel; see make(1) -M obj Set obj root directory to obj (sets MAKEOBJDIRPREFIX) -m mach Set MACHINE to mach (not required if NetBSD native) -n Show commands that would be executed, but do not execute them -O obj Set obj root directory to obj (sets a MAKEOBJDIR pattern) -o Set MKOBJDIRS=no (do not create objdirs at start of build) -R release Set RELEASEDIR to release -r Remove contents of TOOLDIR and DESTDIR before building -T tools Set TOOLDIR to tools. If unset, and TOOLDIR is not set in the environment, nbmake will be (re)built unconditionally. -U Set UNPRIVED -u Set UPDATE -V v=[val] Set variable `v' to `val' -w wrapper Create nbmake script as wrapper (default: ${TOOLDIR}/bin/nbmake-${MACHINE})
2003-01-23 19:24:08 +03:00
-u)
setmakeenv MKUPDATE yes
Rework how build.sh functions, so that command line options set various parameters, and a list of "operations" defines what to do. The full usage is show below. Notes: `-b' has been deprecated (it always occurs now) `-d' is replaced by "distribution" `-R rel' onlys sets RELEASEDIR; use "release" to build a release `-k kern' has been replaced by "kernel=kern" `-i idir' has been replaced by "install=idir" -r now occurs before nbmake is rebuilt Add a copyright (long due!). Rework the code to (a KNF inspired) ShellNF. Use functions appropriately. Allow `nb' prefix to be easily changed to something else. Solve world peace (just kidding) This is part of the (never achievable) goal of attempting to make NetBSD easier to build... --8<-- new usage follows --8<-- Usage: build.sh [-EnorUu] [-a arch] [-B buildid] [-D dest] [-j njob] [-M obj] [-m mach] [-O obj] [-R release] [-T tools] [-V var=[value]] [-w wrapper] [operation [...] ] System build operations (all imply "obj" and "tools"): build Run "make build" distribution Run "make distribution" (includes etc/ files) release Run "make release" (includes kernels & distrib media) Other operations: obj Run "make obj" (default unless -o) tools Build and install tools kernel=conf Build kernel with config file `conf' install=idir Run "make installworld" to `idir' (useful after 'distribution' or 'release') Options: -a arch Set MACHINE_ARCH to arch (otherwise deduced from MACHINE) -B buildId Set BUILDID to buildId -D dest Set DESTDIR to dest -E Set "expert" mode; disables some DESTDIR checks -j njob Run up to njob jobs in parallel; see make(1) -M obj Set obj root directory to obj (sets MAKEOBJDIRPREFIX) -m mach Set MACHINE to mach (not required if NetBSD native) -n Show commands that would be executed, but do not execute them -O obj Set obj root directory to obj (sets a MAKEOBJDIR pattern) -o Set MKOBJDIRS=no (do not create objdirs at start of build) -R release Set RELEASEDIR to release -r Remove contents of TOOLDIR and DESTDIR before building -T tools Set TOOLDIR to tools. If unset, and TOOLDIR is not set in the environment, nbmake will be (re)built unconditionally. -U Set UNPRIVED -u Set UPDATE -V v=[val] Set variable `v' to `val' -w wrapper Create nbmake script as wrapper (default: ${TOOLDIR}/bin/nbmake-${MACHINE})
2003-01-23 19:24:08 +03:00
;;
Major cleanup and overhaul: * Allow MACHINE to be set automatically on NetBSD native builds. Require -m only if the host is not NetBSD. * Fail if DESTDIR is set to root (/) and the build is not NetBSD native, or the build is attempting a "make release" (option -R). * Warn the user if DESTDIR is set to root (/) that the kernel must be up to date, or else the build might hose the system. Also, do not remove DESTDIR on -r if it is set to root. * Fail if TOOLDIR is set to / or empty after checking with nbmake. * Allow DESTDIR and TOOLDIR to be set in mk.conf and/or by the new default from <bsd.own.mk>. Note that if -T is not used to set TOOLDIR, and TOOLDIR is not set in the environment, then nbmake will always be bootstrapped (rather than looking at nbmake's timestamp). This is because /bin/sh doesn't know how to get TOOLDIR from mk.conf without first having nbmake (...which lives in TOOLDIR). * Do a pass of "make obj" through src/tools before installing nbmake (so long as -o/MKOBJDIRS=no is not specified). This ensures that objdirs exist if they are desired, and paves the way for using build.sh to build all the src/tools without building everything else. * Add "-w" option, which allows the builder to specify where the nbmake wrapper shell script should be created. If not specified, $TOOLDIR/bin/nbmake-$MACHINE is still created as a default. * Print the values of DESTDIR and TOOLDIR after bootstrapping nbmake, for informational purposes. It should now be possible to type just "./build.sh" on a NetBSD-current host and get a new build in / for the appropriate architecture. However, building in-place like this has *not* been extensively tested yet, so be careful.
2001-10-31 22:59:43 +03:00
Rework how build.sh functions, so that command line options set various parameters, and a list of "operations" defines what to do. The full usage is show below. Notes: `-b' has been deprecated (it always occurs now) `-d' is replaced by "distribution" `-R rel' onlys sets RELEASEDIR; use "release" to build a release `-k kern' has been replaced by "kernel=kern" `-i idir' has been replaced by "install=idir" -r now occurs before nbmake is rebuilt Add a copyright (long due!). Rework the code to (a KNF inspired) ShellNF. Use functions appropriately. Allow `nb' prefix to be easily changed to something else. Solve world peace (just kidding) This is part of the (never achievable) goal of attempting to make NetBSD easier to build... --8<-- new usage follows --8<-- Usage: build.sh [-EnorUu] [-a arch] [-B buildid] [-D dest] [-j njob] [-M obj] [-m mach] [-O obj] [-R release] [-T tools] [-V var=[value]] [-w wrapper] [operation [...] ] System build operations (all imply "obj" and "tools"): build Run "make build" distribution Run "make distribution" (includes etc/ files) release Run "make release" (includes kernels & distrib media) Other operations: obj Run "make obj" (default unless -o) tools Build and install tools kernel=conf Build kernel with config file `conf' install=idir Run "make installworld" to `idir' (useful after 'distribution' or 'release') Options: -a arch Set MACHINE_ARCH to arch (otherwise deduced from MACHINE) -B buildId Set BUILDID to buildId -D dest Set DESTDIR to dest -E Set "expert" mode; disables some DESTDIR checks -j njob Run up to njob jobs in parallel; see make(1) -M obj Set obj root directory to obj (sets MAKEOBJDIRPREFIX) -m mach Set MACHINE to mach (not required if NetBSD native) -n Show commands that would be executed, but do not execute them -O obj Set obj root directory to obj (sets a MAKEOBJDIR pattern) -o Set MKOBJDIRS=no (do not create objdirs at start of build) -R release Set RELEASEDIR to release -r Remove contents of TOOLDIR and DESTDIR before building -T tools Set TOOLDIR to tools. If unset, and TOOLDIR is not set in the environment, nbmake will be (re)built unconditionally. -U Set UNPRIVED -u Set UPDATE -V v=[val] Set variable `v' to `val' -w wrapper Create nbmake script as wrapper (default: ${TOOLDIR}/bin/nbmake-${MACHINE})
2003-01-23 19:24:08 +03:00
-V)
eval ${optargcmd}
Rework how build.sh functions, so that command line options set various parameters, and a list of "operations" defines what to do. The full usage is show below. Notes: `-b' has been deprecated (it always occurs now) `-d' is replaced by "distribution" `-R rel' onlys sets RELEASEDIR; use "release" to build a release `-k kern' has been replaced by "kernel=kern" `-i idir' has been replaced by "install=idir" -r now occurs before nbmake is rebuilt Add a copyright (long due!). Rework the code to (a KNF inspired) ShellNF. Use functions appropriately. Allow `nb' prefix to be easily changed to something else. Solve world peace (just kidding) This is part of the (never achievable) goal of attempting to make NetBSD easier to build... --8<-- new usage follows --8<-- Usage: build.sh [-EnorUu] [-a arch] [-B buildid] [-D dest] [-j njob] [-M obj] [-m mach] [-O obj] [-R release] [-T tools] [-V var=[value]] [-w wrapper] [operation [...] ] System build operations (all imply "obj" and "tools"): build Run "make build" distribution Run "make distribution" (includes etc/ files) release Run "make release" (includes kernels & distrib media) Other operations: obj Run "make obj" (default unless -o) tools Build and install tools kernel=conf Build kernel with config file `conf' install=idir Run "make installworld" to `idir' (useful after 'distribution' or 'release') Options: -a arch Set MACHINE_ARCH to arch (otherwise deduced from MACHINE) -B buildId Set BUILDID to buildId -D dest Set DESTDIR to dest -E Set "expert" mode; disables some DESTDIR checks -j njob Run up to njob jobs in parallel; see make(1) -M obj Set obj root directory to obj (sets MAKEOBJDIRPREFIX) -m mach Set MACHINE to mach (not required if NetBSD native) -n Show commands that would be executed, but do not execute them -O obj Set obj root directory to obj (sets a MAKEOBJDIR pattern) -o Set MKOBJDIRS=no (do not create objdirs at start of build) -R release Set RELEASEDIR to release -r Remove contents of TOOLDIR and DESTDIR before building -T tools Set TOOLDIR to tools. If unset, and TOOLDIR is not set in the environment, nbmake will be (re)built unconditionally. -U Set UNPRIVED -u Set UPDATE -V v=[val] Set variable `v' to `val' -w wrapper Create nbmake script as wrapper (default: ${TOOLDIR}/bin/nbmake-${MACHINE})
2003-01-23 19:24:08 +03:00
case "${OPTARG}" in
# XXX: consider restricting which variables can be changed?
Rework how build.sh functions, so that command line options set various parameters, and a list of "operations" defines what to do. The full usage is show below. Notes: `-b' has been deprecated (it always occurs now) `-d' is replaced by "distribution" `-R rel' onlys sets RELEASEDIR; use "release" to build a release `-k kern' has been replaced by "kernel=kern" `-i idir' has been replaced by "install=idir" -r now occurs before nbmake is rebuilt Add a copyright (long due!). Rework the code to (a KNF inspired) ShellNF. Use functions appropriately. Allow `nb' prefix to be easily changed to something else. Solve world peace (just kidding) This is part of the (never achievable) goal of attempting to make NetBSD easier to build... --8<-- new usage follows --8<-- Usage: build.sh [-EnorUu] [-a arch] [-B buildid] [-D dest] [-j njob] [-M obj] [-m mach] [-O obj] [-R release] [-T tools] [-V var=[value]] [-w wrapper] [operation [...] ] System build operations (all imply "obj" and "tools"): build Run "make build" distribution Run "make distribution" (includes etc/ files) release Run "make release" (includes kernels & distrib media) Other operations: obj Run "make obj" (default unless -o) tools Build and install tools kernel=conf Build kernel with config file `conf' install=idir Run "make installworld" to `idir' (useful after 'distribution' or 'release') Options: -a arch Set MACHINE_ARCH to arch (otherwise deduced from MACHINE) -B buildId Set BUILDID to buildId -D dest Set DESTDIR to dest -E Set "expert" mode; disables some DESTDIR checks -j njob Run up to njob jobs in parallel; see make(1) -M obj Set obj root directory to obj (sets MAKEOBJDIRPREFIX) -m mach Set MACHINE to mach (not required if NetBSD native) -n Show commands that would be executed, but do not execute them -O obj Set obj root directory to obj (sets a MAKEOBJDIR pattern) -o Set MKOBJDIRS=no (do not create objdirs at start of build) -R release Set RELEASEDIR to release -r Remove contents of TOOLDIR and DESTDIR before building -T tools Set TOOLDIR to tools. If unset, and TOOLDIR is not set in the environment, nbmake will be (re)built unconditionally. -U Set UNPRIVED -u Set UPDATE -V v=[val] Set variable `v' to `val' -w wrapper Create nbmake script as wrapper (default: ${TOOLDIR}/bin/nbmake-${MACHINE})
2003-01-23 19:24:08 +03:00
[a-zA-Z_][a-zA-Z_0-9]*=*)
setmakeenv "${OPTARG%%=*}" "${OPTARG#*=}"
Rework how build.sh functions, so that command line options set various parameters, and a list of "operations" defines what to do. The full usage is show below. Notes: `-b' has been deprecated (it always occurs now) `-d' is replaced by "distribution" `-R rel' onlys sets RELEASEDIR; use "release" to build a release `-k kern' has been replaced by "kernel=kern" `-i idir' has been replaced by "install=idir" -r now occurs before nbmake is rebuilt Add a copyright (long due!). Rework the code to (a KNF inspired) ShellNF. Use functions appropriately. Allow `nb' prefix to be easily changed to something else. Solve world peace (just kidding) This is part of the (never achievable) goal of attempting to make NetBSD easier to build... --8<-- new usage follows --8<-- Usage: build.sh [-EnorUu] [-a arch] [-B buildid] [-D dest] [-j njob] [-M obj] [-m mach] [-O obj] [-R release] [-T tools] [-V var=[value]] [-w wrapper] [operation [...] ] System build operations (all imply "obj" and "tools"): build Run "make build" distribution Run "make distribution" (includes etc/ files) release Run "make release" (includes kernels & distrib media) Other operations: obj Run "make obj" (default unless -o) tools Build and install tools kernel=conf Build kernel with config file `conf' install=idir Run "make installworld" to `idir' (useful after 'distribution' or 'release') Options: -a arch Set MACHINE_ARCH to arch (otherwise deduced from MACHINE) -B buildId Set BUILDID to buildId -D dest Set DESTDIR to dest -E Set "expert" mode; disables some DESTDIR checks -j njob Run up to njob jobs in parallel; see make(1) -M obj Set obj root directory to obj (sets MAKEOBJDIRPREFIX) -m mach Set MACHINE to mach (not required if NetBSD native) -n Show commands that would be executed, but do not execute them -O obj Set obj root directory to obj (sets a MAKEOBJDIR pattern) -o Set MKOBJDIRS=no (do not create objdirs at start of build) -R release Set RELEASEDIR to release -r Remove contents of TOOLDIR and DESTDIR before building -T tools Set TOOLDIR to tools. If unset, and TOOLDIR is not set in the environment, nbmake will be (re)built unconditionally. -U Set UNPRIVED -u Set UPDATE -V v=[val] Set variable `v' to `val' -w wrapper Create nbmake script as wrapper (default: ${TOOLDIR}/bin/nbmake-${MACHINE})
2003-01-23 19:24:08 +03:00
;;
*)
usage "-V argument must be of the form 'var=[value]'"
;;
esac
;;
Rework how build.sh functions, so that command line options set various parameters, and a list of "operations" defines what to do. The full usage is show below. Notes: `-b' has been deprecated (it always occurs now) `-d' is replaced by "distribution" `-R rel' onlys sets RELEASEDIR; use "release" to build a release `-k kern' has been replaced by "kernel=kern" `-i idir' has been replaced by "install=idir" -r now occurs before nbmake is rebuilt Add a copyright (long due!). Rework the code to (a KNF inspired) ShellNF. Use functions appropriately. Allow `nb' prefix to be easily changed to something else. Solve world peace (just kidding) This is part of the (never achievable) goal of attempting to make NetBSD easier to build... --8<-- new usage follows --8<-- Usage: build.sh [-EnorUu] [-a arch] [-B buildid] [-D dest] [-j njob] [-M obj] [-m mach] [-O obj] [-R release] [-T tools] [-V var=[value]] [-w wrapper] [operation [...] ] System build operations (all imply "obj" and "tools"): build Run "make build" distribution Run "make distribution" (includes etc/ files) release Run "make release" (includes kernels & distrib media) Other operations: obj Run "make obj" (default unless -o) tools Build and install tools kernel=conf Build kernel with config file `conf' install=idir Run "make installworld" to `idir' (useful after 'distribution' or 'release') Options: -a arch Set MACHINE_ARCH to arch (otherwise deduced from MACHINE) -B buildId Set BUILDID to buildId -D dest Set DESTDIR to dest -E Set "expert" mode; disables some DESTDIR checks -j njob Run up to njob jobs in parallel; see make(1) -M obj Set obj root directory to obj (sets MAKEOBJDIRPREFIX) -m mach Set MACHINE to mach (not required if NetBSD native) -n Show commands that would be executed, but do not execute them -O obj Set obj root directory to obj (sets a MAKEOBJDIR pattern) -o Set MKOBJDIRS=no (do not create objdirs at start of build) -R release Set RELEASEDIR to release -r Remove contents of TOOLDIR and DESTDIR before building -T tools Set TOOLDIR to tools. If unset, and TOOLDIR is not set in the environment, nbmake will be (re)built unconditionally. -U Set UNPRIVED -u Set UPDATE -V v=[val] Set variable `v' to `val' -w wrapper Create nbmake script as wrapper (default: ${TOOLDIR}/bin/nbmake-${MACHINE})
2003-01-23 19:24:08 +03:00
-w)
eval ${optargcmd}; resolvepath
makewrapper="${OPTARG}"
Rework how build.sh functions, so that command line options set various parameters, and a list of "operations" defines what to do. The full usage is show below. Notes: `-b' has been deprecated (it always occurs now) `-d' is replaced by "distribution" `-R rel' onlys sets RELEASEDIR; use "release" to build a release `-k kern' has been replaced by "kernel=kern" `-i idir' has been replaced by "install=idir" -r now occurs before nbmake is rebuilt Add a copyright (long due!). Rework the code to (a KNF inspired) ShellNF. Use functions appropriately. Allow `nb' prefix to be easily changed to something else. Solve world peace (just kidding) This is part of the (never achievable) goal of attempting to make NetBSD easier to build... --8<-- new usage follows --8<-- Usage: build.sh [-EnorUu] [-a arch] [-B buildid] [-D dest] [-j njob] [-M obj] [-m mach] [-O obj] [-R release] [-T tools] [-V var=[value]] [-w wrapper] [operation [...] ] System build operations (all imply "obj" and "tools"): build Run "make build" distribution Run "make distribution" (includes etc/ files) release Run "make release" (includes kernels & distrib media) Other operations: obj Run "make obj" (default unless -o) tools Build and install tools kernel=conf Build kernel with config file `conf' install=idir Run "make installworld" to `idir' (useful after 'distribution' or 'release') Options: -a arch Set MACHINE_ARCH to arch (otherwise deduced from MACHINE) -B buildId Set BUILDID to buildId -D dest Set DESTDIR to dest -E Set "expert" mode; disables some DESTDIR checks -j njob Run up to njob jobs in parallel; see make(1) -M obj Set obj root directory to obj (sets MAKEOBJDIRPREFIX) -m mach Set MACHINE to mach (not required if NetBSD native) -n Show commands that would be executed, but do not execute them -O obj Set obj root directory to obj (sets a MAKEOBJDIR pattern) -o Set MKOBJDIRS=no (do not create objdirs at start of build) -R release Set RELEASEDIR to release -r Remove contents of TOOLDIR and DESTDIR before building -T tools Set TOOLDIR to tools. If unset, and TOOLDIR is not set in the environment, nbmake will be (re)built unconditionally. -U Set UNPRIVED -u Set UPDATE -V v=[val] Set variable `v' to `val' -w wrapper Create nbmake script as wrapper (default: ${TOOLDIR}/bin/nbmake-${MACHINE})
2003-01-23 19:24:08 +03:00
;;
-Z)
eval ${optargcmd}
# XXX: consider restricting which variables can be unset?
unsetmakeenv "${OPTARG}"
;;
Rework how build.sh functions, so that command line options set various parameters, and a list of "operations" defines what to do. The full usage is show below. Notes: `-b' has been deprecated (it always occurs now) `-d' is replaced by "distribution" `-R rel' onlys sets RELEASEDIR; use "release" to build a release `-k kern' has been replaced by "kernel=kern" `-i idir' has been replaced by "install=idir" -r now occurs before nbmake is rebuilt Add a copyright (long due!). Rework the code to (a KNF inspired) ShellNF. Use functions appropriately. Allow `nb' prefix to be easily changed to something else. Solve world peace (just kidding) This is part of the (never achievable) goal of attempting to make NetBSD easier to build... --8<-- new usage follows --8<-- Usage: build.sh [-EnorUu] [-a arch] [-B buildid] [-D dest] [-j njob] [-M obj] [-m mach] [-O obj] [-R release] [-T tools] [-V var=[value]] [-w wrapper] [operation [...] ] System build operations (all imply "obj" and "tools"): build Run "make build" distribution Run "make distribution" (includes etc/ files) release Run "make release" (includes kernels & distrib media) Other operations: obj Run "make obj" (default unless -o) tools Build and install tools kernel=conf Build kernel with config file `conf' install=idir Run "make installworld" to `idir' (useful after 'distribution' or 'release') Options: -a arch Set MACHINE_ARCH to arch (otherwise deduced from MACHINE) -B buildId Set BUILDID to buildId -D dest Set DESTDIR to dest -E Set "expert" mode; disables some DESTDIR checks -j njob Run up to njob jobs in parallel; see make(1) -M obj Set obj root directory to obj (sets MAKEOBJDIRPREFIX) -m mach Set MACHINE to mach (not required if NetBSD native) -n Show commands that would be executed, but do not execute them -O obj Set obj root directory to obj (sets a MAKEOBJDIR pattern) -o Set MKOBJDIRS=no (do not create objdirs at start of build) -R release Set RELEASEDIR to release -r Remove contents of TOOLDIR and DESTDIR before building -T tools Set TOOLDIR to tools. If unset, and TOOLDIR is not set in the environment, nbmake will be (re)built unconditionally. -U Set UNPRIVED -u Set UPDATE -V v=[val] Set variable `v' to `val' -w wrapper Create nbmake script as wrapper (default: ${TOOLDIR}/bin/nbmake-${MACHINE})
2003-01-23 19:24:08 +03:00
--)
break
;;
-'?'|-h)
usage
;;
esac
done
# Validate operations.
#
eval ${optremcmd}
Rework how build.sh functions, so that command line options set various parameters, and a list of "operations" defines what to do. The full usage is show below. Notes: `-b' has been deprecated (it always occurs now) `-d' is replaced by "distribution" `-R rel' onlys sets RELEASEDIR; use "release" to build a release `-k kern' has been replaced by "kernel=kern" `-i idir' has been replaced by "install=idir" -r now occurs before nbmake is rebuilt Add a copyright (long due!). Rework the code to (a KNF inspired) ShellNF. Use functions appropriately. Allow `nb' prefix to be easily changed to something else. Solve world peace (just kidding) This is part of the (never achievable) goal of attempting to make NetBSD easier to build... --8<-- new usage follows --8<-- Usage: build.sh [-EnorUu] [-a arch] [-B buildid] [-D dest] [-j njob] [-M obj] [-m mach] [-O obj] [-R release] [-T tools] [-V var=[value]] [-w wrapper] [operation [...] ] System build operations (all imply "obj" and "tools"): build Run "make build" distribution Run "make distribution" (includes etc/ files) release Run "make release" (includes kernels & distrib media) Other operations: obj Run "make obj" (default unless -o) tools Build and install tools kernel=conf Build kernel with config file `conf' install=idir Run "make installworld" to `idir' (useful after 'distribution' or 'release') Options: -a arch Set MACHINE_ARCH to arch (otherwise deduced from MACHINE) -B buildId Set BUILDID to buildId -D dest Set DESTDIR to dest -E Set "expert" mode; disables some DESTDIR checks -j njob Run up to njob jobs in parallel; see make(1) -M obj Set obj root directory to obj (sets MAKEOBJDIRPREFIX) -m mach Set MACHINE to mach (not required if NetBSD native) -n Show commands that would be executed, but do not execute them -O obj Set obj root directory to obj (sets a MAKEOBJDIR pattern) -o Set MKOBJDIRS=no (do not create objdirs at start of build) -R release Set RELEASEDIR to release -r Remove contents of TOOLDIR and DESTDIR before building -T tools Set TOOLDIR to tools. If unset, and TOOLDIR is not set in the environment, nbmake will be (re)built unconditionally. -U Set UNPRIVED -u Set UPDATE -V v=[val] Set variable `v' to `val' -w wrapper Create nbmake script as wrapper (default: ${TOOLDIR}/bin/nbmake-${MACHINE})
2003-01-23 19:24:08 +03:00
while [ $# -gt 0 ]; do
op=$1; shift
operations="${operations} ${op}"
Rework how build.sh functions, so that command line options set various parameters, and a list of "operations" defines what to do. The full usage is show below. Notes: `-b' has been deprecated (it always occurs now) `-d' is replaced by "distribution" `-R rel' onlys sets RELEASEDIR; use "release" to build a release `-k kern' has been replaced by "kernel=kern" `-i idir' has been replaced by "install=idir" -r now occurs before nbmake is rebuilt Add a copyright (long due!). Rework the code to (a KNF inspired) ShellNF. Use functions appropriately. Allow `nb' prefix to be easily changed to something else. Solve world peace (just kidding) This is part of the (never achievable) goal of attempting to make NetBSD easier to build... --8<-- new usage follows --8<-- Usage: build.sh [-EnorUu] [-a arch] [-B buildid] [-D dest] [-j njob] [-M obj] [-m mach] [-O obj] [-R release] [-T tools] [-V var=[value]] [-w wrapper] [operation [...] ] System build operations (all imply "obj" and "tools"): build Run "make build" distribution Run "make distribution" (includes etc/ files) release Run "make release" (includes kernels & distrib media) Other operations: obj Run "make obj" (default unless -o) tools Build and install tools kernel=conf Build kernel with config file `conf' install=idir Run "make installworld" to `idir' (useful after 'distribution' or 'release') Options: -a arch Set MACHINE_ARCH to arch (otherwise deduced from MACHINE) -B buildId Set BUILDID to buildId -D dest Set DESTDIR to dest -E Set "expert" mode; disables some DESTDIR checks -j njob Run up to njob jobs in parallel; see make(1) -M obj Set obj root directory to obj (sets MAKEOBJDIRPREFIX) -m mach Set MACHINE to mach (not required if NetBSD native) -n Show commands that would be executed, but do not execute them -O obj Set obj root directory to obj (sets a MAKEOBJDIR pattern) -o Set MKOBJDIRS=no (do not create objdirs at start of build) -R release Set RELEASEDIR to release -r Remove contents of TOOLDIR and DESTDIR before building -T tools Set TOOLDIR to tools. If unset, and TOOLDIR is not set in the environment, nbmake will be (re)built unconditionally. -U Set UNPRIVED -u Set UPDATE -V v=[val] Set variable `v' to `val' -w wrapper Create nbmake script as wrapper (default: ${TOOLDIR}/bin/nbmake-${MACHINE})
2003-01-23 19:24:08 +03:00
case "${op}" in
Rework how build.sh functions, so that command line options set various parameters, and a list of "operations" defines what to do. The full usage is show below. Notes: `-b' has been deprecated (it always occurs now) `-d' is replaced by "distribution" `-R rel' onlys sets RELEASEDIR; use "release" to build a release `-k kern' has been replaced by "kernel=kern" `-i idir' has been replaced by "install=idir" -r now occurs before nbmake is rebuilt Add a copyright (long due!). Rework the code to (a KNF inspired) ShellNF. Use functions appropriately. Allow `nb' prefix to be easily changed to something else. Solve world peace (just kidding) This is part of the (never achievable) goal of attempting to make NetBSD easier to build... --8<-- new usage follows --8<-- Usage: build.sh [-EnorUu] [-a arch] [-B buildid] [-D dest] [-j njob] [-M obj] [-m mach] [-O obj] [-R release] [-T tools] [-V var=[value]] [-w wrapper] [operation [...] ] System build operations (all imply "obj" and "tools"): build Run "make build" distribution Run "make distribution" (includes etc/ files) release Run "make release" (includes kernels & distrib media) Other operations: obj Run "make obj" (default unless -o) tools Build and install tools kernel=conf Build kernel with config file `conf' install=idir Run "make installworld" to `idir' (useful after 'distribution' or 'release') Options: -a arch Set MACHINE_ARCH to arch (otherwise deduced from MACHINE) -B buildId Set BUILDID to buildId -D dest Set DESTDIR to dest -E Set "expert" mode; disables some DESTDIR checks -j njob Run up to njob jobs in parallel; see make(1) -M obj Set obj root directory to obj (sets MAKEOBJDIRPREFIX) -m mach Set MACHINE to mach (not required if NetBSD native) -n Show commands that would be executed, but do not execute them -O obj Set obj root directory to obj (sets a MAKEOBJDIR pattern) -o Set MKOBJDIRS=no (do not create objdirs at start of build) -R release Set RELEASEDIR to release -r Remove contents of TOOLDIR and DESTDIR before building -T tools Set TOOLDIR to tools. If unset, and TOOLDIR is not set in the environment, nbmake will be (re)built unconditionally. -U Set UNPRIVED -u Set UPDATE -V v=[val] Set variable `v' to `val' -w wrapper Create nbmake script as wrapper (default: ${TOOLDIR}/bin/nbmake-${MACHINE})
2003-01-23 19:24:08 +03:00
help)
usage
;;
2003-07-16 17:21:47 +04:00
makewrapper|obj|tools|build|distribution|release|sets|sourcesets|params)
Rework how build.sh functions, so that command line options set various parameters, and a list of "operations" defines what to do. The full usage is show below. Notes: `-b' has been deprecated (it always occurs now) `-d' is replaced by "distribution" `-R rel' onlys sets RELEASEDIR; use "release" to build a release `-k kern' has been replaced by "kernel=kern" `-i idir' has been replaced by "install=idir" -r now occurs before nbmake is rebuilt Add a copyright (long due!). Rework the code to (a KNF inspired) ShellNF. Use functions appropriately. Allow `nb' prefix to be easily changed to something else. Solve world peace (just kidding) This is part of the (never achievable) goal of attempting to make NetBSD easier to build... --8<-- new usage follows --8<-- Usage: build.sh [-EnorUu] [-a arch] [-B buildid] [-D dest] [-j njob] [-M obj] [-m mach] [-O obj] [-R release] [-T tools] [-V var=[value]] [-w wrapper] [operation [...] ] System build operations (all imply "obj" and "tools"): build Run "make build" distribution Run "make distribution" (includes etc/ files) release Run "make release" (includes kernels & distrib media) Other operations: obj Run "make obj" (default unless -o) tools Build and install tools kernel=conf Build kernel with config file `conf' install=idir Run "make installworld" to `idir' (useful after 'distribution' or 'release') Options: -a arch Set MACHINE_ARCH to arch (otherwise deduced from MACHINE) -B buildId Set BUILDID to buildId -D dest Set DESTDIR to dest -E Set "expert" mode; disables some DESTDIR checks -j njob Run up to njob jobs in parallel; see make(1) -M obj Set obj root directory to obj (sets MAKEOBJDIRPREFIX) -m mach Set MACHINE to mach (not required if NetBSD native) -n Show commands that would be executed, but do not execute them -O obj Set obj root directory to obj (sets a MAKEOBJDIR pattern) -o Set MKOBJDIRS=no (do not create objdirs at start of build) -R release Set RELEASEDIR to release -r Remove contents of TOOLDIR and DESTDIR before building -T tools Set TOOLDIR to tools. If unset, and TOOLDIR is not set in the environment, nbmake will be (re)built unconditionally. -U Set UNPRIVED -u Set UPDATE -V v=[val] Set variable `v' to `val' -w wrapper Create nbmake script as wrapper (default: ${TOOLDIR}/bin/nbmake-${MACHINE})
2003-01-23 19:24:08 +03:00
;;
kernel=*|releasekernel=*)
Rework how build.sh functions, so that command line options set various parameters, and a list of "operations" defines what to do. The full usage is show below. Notes: `-b' has been deprecated (it always occurs now) `-d' is replaced by "distribution" `-R rel' onlys sets RELEASEDIR; use "release" to build a release `-k kern' has been replaced by "kernel=kern" `-i idir' has been replaced by "install=idir" -r now occurs before nbmake is rebuilt Add a copyright (long due!). Rework the code to (a KNF inspired) ShellNF. Use functions appropriately. Allow `nb' prefix to be easily changed to something else. Solve world peace (just kidding) This is part of the (never achievable) goal of attempting to make NetBSD easier to build... --8<-- new usage follows --8<-- Usage: build.sh [-EnorUu] [-a arch] [-B buildid] [-D dest] [-j njob] [-M obj] [-m mach] [-O obj] [-R release] [-T tools] [-V var=[value]] [-w wrapper] [operation [...] ] System build operations (all imply "obj" and "tools"): build Run "make build" distribution Run "make distribution" (includes etc/ files) release Run "make release" (includes kernels & distrib media) Other operations: obj Run "make obj" (default unless -o) tools Build and install tools kernel=conf Build kernel with config file `conf' install=idir Run "make installworld" to `idir' (useful after 'distribution' or 'release') Options: -a arch Set MACHINE_ARCH to arch (otherwise deduced from MACHINE) -B buildId Set BUILDID to buildId -D dest Set DESTDIR to dest -E Set "expert" mode; disables some DESTDIR checks -j njob Run up to njob jobs in parallel; see make(1) -M obj Set obj root directory to obj (sets MAKEOBJDIRPREFIX) -m mach Set MACHINE to mach (not required if NetBSD native) -n Show commands that would be executed, but do not execute them -O obj Set obj root directory to obj (sets a MAKEOBJDIR pattern) -o Set MKOBJDIRS=no (do not create objdirs at start of build) -R release Set RELEASEDIR to release -r Remove contents of TOOLDIR and DESTDIR before building -T tools Set TOOLDIR to tools. If unset, and TOOLDIR is not set in the environment, nbmake will be (re)built unconditionally. -U Set UNPRIVED -u Set UPDATE -V v=[val] Set variable `v' to `val' -w wrapper Create nbmake script as wrapper (default: ${TOOLDIR}/bin/nbmake-${MACHINE})
2003-01-23 19:24:08 +03:00
arg=${op#*=}
op=${op%%=*}
[ -n "${arg}" ] ||
bomb "Must supply a kernel name with \`${op}=...'"
Rework how build.sh functions, so that command line options set various parameters, and a list of "operations" defines what to do. The full usage is show below. Notes: `-b' has been deprecated (it always occurs now) `-d' is replaced by "distribution" `-R rel' onlys sets RELEASEDIR; use "release" to build a release `-k kern' has been replaced by "kernel=kern" `-i idir' has been replaced by "install=idir" -r now occurs before nbmake is rebuilt Add a copyright (long due!). Rework the code to (a KNF inspired) ShellNF. Use functions appropriately. Allow `nb' prefix to be easily changed to something else. Solve world peace (just kidding) This is part of the (never achievable) goal of attempting to make NetBSD easier to build... --8<-- new usage follows --8<-- Usage: build.sh [-EnorUu] [-a arch] [-B buildid] [-D dest] [-j njob] [-M obj] [-m mach] [-O obj] [-R release] [-T tools] [-V var=[value]] [-w wrapper] [operation [...] ] System build operations (all imply "obj" and "tools"): build Run "make build" distribution Run "make distribution" (includes etc/ files) release Run "make release" (includes kernels & distrib media) Other operations: obj Run "make obj" (default unless -o) tools Build and install tools kernel=conf Build kernel with config file `conf' install=idir Run "make installworld" to `idir' (useful after 'distribution' or 'release') Options: -a arch Set MACHINE_ARCH to arch (otherwise deduced from MACHINE) -B buildId Set BUILDID to buildId -D dest Set DESTDIR to dest -E Set "expert" mode; disables some DESTDIR checks -j njob Run up to njob jobs in parallel; see make(1) -M obj Set obj root directory to obj (sets MAKEOBJDIRPREFIX) -m mach Set MACHINE to mach (not required if NetBSD native) -n Show commands that would be executed, but do not execute them -O obj Set obj root directory to obj (sets a MAKEOBJDIR pattern) -o Set MKOBJDIRS=no (do not create objdirs at start of build) -R release Set RELEASEDIR to release -r Remove contents of TOOLDIR and DESTDIR before building -T tools Set TOOLDIR to tools. If unset, and TOOLDIR is not set in the environment, nbmake will be (re)built unconditionally. -U Set UNPRIVED -u Set UPDATE -V v=[val] Set variable `v' to `val' -w wrapper Create nbmake script as wrapper (default: ${TOOLDIR}/bin/nbmake-${MACHINE})
2003-01-23 19:24:08 +03:00
;;
install=*)
arg=${op#*=}
op=${op%%=*}
[ -n "${arg}" ] ||
bomb "Must supply a directory with \`install=...'"
Rework how build.sh functions, so that command line options set various parameters, and a list of "operations" defines what to do. The full usage is show below. Notes: `-b' has been deprecated (it always occurs now) `-d' is replaced by "distribution" `-R rel' onlys sets RELEASEDIR; use "release" to build a release `-k kern' has been replaced by "kernel=kern" `-i idir' has been replaced by "install=idir" -r now occurs before nbmake is rebuilt Add a copyright (long due!). Rework the code to (a KNF inspired) ShellNF. Use functions appropriately. Allow `nb' prefix to be easily changed to something else. Solve world peace (just kidding) This is part of the (never achievable) goal of attempting to make NetBSD easier to build... --8<-- new usage follows --8<-- Usage: build.sh [-EnorUu] [-a arch] [-B buildid] [-D dest] [-j njob] [-M obj] [-m mach] [-O obj] [-R release] [-T tools] [-V var=[value]] [-w wrapper] [operation [...] ] System build operations (all imply "obj" and "tools"): build Run "make build" distribution Run "make distribution" (includes etc/ files) release Run "make release" (includes kernels & distrib media) Other operations: obj Run "make obj" (default unless -o) tools Build and install tools kernel=conf Build kernel with config file `conf' install=idir Run "make installworld" to `idir' (useful after 'distribution' or 'release') Options: -a arch Set MACHINE_ARCH to arch (otherwise deduced from MACHINE) -B buildId Set BUILDID to buildId -D dest Set DESTDIR to dest -E Set "expert" mode; disables some DESTDIR checks -j njob Run up to njob jobs in parallel; see make(1) -M obj Set obj root directory to obj (sets MAKEOBJDIRPREFIX) -m mach Set MACHINE to mach (not required if NetBSD native) -n Show commands that would be executed, but do not execute them -O obj Set obj root directory to obj (sets a MAKEOBJDIR pattern) -o Set MKOBJDIRS=no (do not create objdirs at start of build) -R release Set RELEASEDIR to release -r Remove contents of TOOLDIR and DESTDIR before building -T tools Set TOOLDIR to tools. If unset, and TOOLDIR is not set in the environment, nbmake will be (re)built unconditionally. -U Set UNPRIVED -u Set UPDATE -V v=[val] Set variable `v' to `val' -w wrapper Create nbmake script as wrapper (default: ${TOOLDIR}/bin/nbmake-${MACHINE})
2003-01-23 19:24:08 +03:00
;;
*)
Rework how build.sh functions, so that command line options set various parameters, and a list of "operations" defines what to do. The full usage is show below. Notes: `-b' has been deprecated (it always occurs now) `-d' is replaced by "distribution" `-R rel' onlys sets RELEASEDIR; use "release" to build a release `-k kern' has been replaced by "kernel=kern" `-i idir' has been replaced by "install=idir" -r now occurs before nbmake is rebuilt Add a copyright (long due!). Rework the code to (a KNF inspired) ShellNF. Use functions appropriately. Allow `nb' prefix to be easily changed to something else. Solve world peace (just kidding) This is part of the (never achievable) goal of attempting to make NetBSD easier to build... --8<-- new usage follows --8<-- Usage: build.sh [-EnorUu] [-a arch] [-B buildid] [-D dest] [-j njob] [-M obj] [-m mach] [-O obj] [-R release] [-T tools] [-V var=[value]] [-w wrapper] [operation [...] ] System build operations (all imply "obj" and "tools"): build Run "make build" distribution Run "make distribution" (includes etc/ files) release Run "make release" (includes kernels & distrib media) Other operations: obj Run "make obj" (default unless -o) tools Build and install tools kernel=conf Build kernel with config file `conf' install=idir Run "make installworld" to `idir' (useful after 'distribution' or 'release') Options: -a arch Set MACHINE_ARCH to arch (otherwise deduced from MACHINE) -B buildId Set BUILDID to buildId -D dest Set DESTDIR to dest -E Set "expert" mode; disables some DESTDIR checks -j njob Run up to njob jobs in parallel; see make(1) -M obj Set obj root directory to obj (sets MAKEOBJDIRPREFIX) -m mach Set MACHINE to mach (not required if NetBSD native) -n Show commands that would be executed, but do not execute them -O obj Set obj root directory to obj (sets a MAKEOBJDIR pattern) -o Set MKOBJDIRS=no (do not create objdirs at start of build) -R release Set RELEASEDIR to release -r Remove contents of TOOLDIR and DESTDIR before building -T tools Set TOOLDIR to tools. If unset, and TOOLDIR is not set in the environment, nbmake will be (re)built unconditionally. -U Set UNPRIVED -u Set UPDATE -V v=[val] Set variable `v' to `val' -w wrapper Create nbmake script as wrapper (default: ${TOOLDIR}/bin/nbmake-${MACHINE})
2003-01-23 19:24:08 +03:00
usage "Unknown operation \`${op}'"
;;
esac
eval do_${op}=true
Rework how build.sh functions, so that command line options set various parameters, and a list of "operations" defines what to do. The full usage is show below. Notes: `-b' has been deprecated (it always occurs now) `-d' is replaced by "distribution" `-R rel' onlys sets RELEASEDIR; use "release" to build a release `-k kern' has been replaced by "kernel=kern" `-i idir' has been replaced by "install=idir" -r now occurs before nbmake is rebuilt Add a copyright (long due!). Rework the code to (a KNF inspired) ShellNF. Use functions appropriately. Allow `nb' prefix to be easily changed to something else. Solve world peace (just kidding) This is part of the (never achievable) goal of attempting to make NetBSD easier to build... --8<-- new usage follows --8<-- Usage: build.sh [-EnorUu] [-a arch] [-B buildid] [-D dest] [-j njob] [-M obj] [-m mach] [-O obj] [-R release] [-T tools] [-V var=[value]] [-w wrapper] [operation [...] ] System build operations (all imply "obj" and "tools"): build Run "make build" distribution Run "make distribution" (includes etc/ files) release Run "make release" (includes kernels & distrib media) Other operations: obj Run "make obj" (default unless -o) tools Build and install tools kernel=conf Build kernel with config file `conf' install=idir Run "make installworld" to `idir' (useful after 'distribution' or 'release') Options: -a arch Set MACHINE_ARCH to arch (otherwise deduced from MACHINE) -B buildId Set BUILDID to buildId -D dest Set DESTDIR to dest -E Set "expert" mode; disables some DESTDIR checks -j njob Run up to njob jobs in parallel; see make(1) -M obj Set obj root directory to obj (sets MAKEOBJDIRPREFIX) -m mach Set MACHINE to mach (not required if NetBSD native) -n Show commands that would be executed, but do not execute them -O obj Set obj root directory to obj (sets a MAKEOBJDIR pattern) -o Set MKOBJDIRS=no (do not create objdirs at start of build) -R release Set RELEASEDIR to release -r Remove contents of TOOLDIR and DESTDIR before building -T tools Set TOOLDIR to tools. If unset, and TOOLDIR is not set in the environment, nbmake will be (re)built unconditionally. -U Set UNPRIVED -u Set UPDATE -V v=[val] Set variable `v' to `val' -w wrapper Create nbmake script as wrapper (default: ${TOOLDIR}/bin/nbmake-${MACHINE})
2003-01-23 19:24:08 +03:00
done
[ -n "${operations}" ] || usage "Missing operation to perform."
Rework how build.sh functions, so that command line options set various parameters, and a list of "operations" defines what to do. The full usage is show below. Notes: `-b' has been deprecated (it always occurs now) `-d' is replaced by "distribution" `-R rel' onlys sets RELEASEDIR; use "release" to build a release `-k kern' has been replaced by "kernel=kern" `-i idir' has been replaced by "install=idir" -r now occurs before nbmake is rebuilt Add a copyright (long due!). Rework the code to (a KNF inspired) ShellNF. Use functions appropriately. Allow `nb' prefix to be easily changed to something else. Solve world peace (just kidding) This is part of the (never achievable) goal of attempting to make NetBSD easier to build... --8<-- new usage follows --8<-- Usage: build.sh [-EnorUu] [-a arch] [-B buildid] [-D dest] [-j njob] [-M obj] [-m mach] [-O obj] [-R release] [-T tools] [-V var=[value]] [-w wrapper] [operation [...] ] System build operations (all imply "obj" and "tools"): build Run "make build" distribution Run "make distribution" (includes etc/ files) release Run "make release" (includes kernels & distrib media) Other operations: obj Run "make obj" (default unless -o) tools Build and install tools kernel=conf Build kernel with config file `conf' install=idir Run "make installworld" to `idir' (useful after 'distribution' or 'release') Options: -a arch Set MACHINE_ARCH to arch (otherwise deduced from MACHINE) -B buildId Set BUILDID to buildId -D dest Set DESTDIR to dest -E Set "expert" mode; disables some DESTDIR checks -j njob Run up to njob jobs in parallel; see make(1) -M obj Set obj root directory to obj (sets MAKEOBJDIRPREFIX) -m mach Set MACHINE to mach (not required if NetBSD native) -n Show commands that would be executed, but do not execute them -O obj Set obj root directory to obj (sets a MAKEOBJDIR pattern) -o Set MKOBJDIRS=no (do not create objdirs at start of build) -R release Set RELEASEDIR to release -r Remove contents of TOOLDIR and DESTDIR before building -T tools Set TOOLDIR to tools. If unset, and TOOLDIR is not set in the environment, nbmake will be (re)built unconditionally. -U Set UNPRIVED -u Set UPDATE -V v=[val] Set variable `v' to `val' -w wrapper Create nbmake script as wrapper (default: ${TOOLDIR}/bin/nbmake-${MACHINE})
2003-01-23 19:24:08 +03:00
# Set up MACHINE*. On a NetBSD host, these are allowed to be unset.
#
if [ -z "${MACHINE}" ]; then
[ "${uname_s}" = "NetBSD" ] ||
bomb "MACHINE must be set, or -m must be used, for cross builds."
Rework how build.sh functions, so that command line options set various parameters, and a list of "operations" defines what to do. The full usage is show below. Notes: `-b' has been deprecated (it always occurs now) `-d' is replaced by "distribution" `-R rel' onlys sets RELEASEDIR; use "release" to build a release `-k kern' has been replaced by "kernel=kern" `-i idir' has been replaced by "install=idir" -r now occurs before nbmake is rebuilt Add a copyright (long due!). Rework the code to (a KNF inspired) ShellNF. Use functions appropriately. Allow `nb' prefix to be easily changed to something else. Solve world peace (just kidding) This is part of the (never achievable) goal of attempting to make NetBSD easier to build... --8<-- new usage follows --8<-- Usage: build.sh [-EnorUu] [-a arch] [-B buildid] [-D dest] [-j njob] [-M obj] [-m mach] [-O obj] [-R release] [-T tools] [-V var=[value]] [-w wrapper] [operation [...] ] System build operations (all imply "obj" and "tools"): build Run "make build" distribution Run "make distribution" (includes etc/ files) release Run "make release" (includes kernels & distrib media) Other operations: obj Run "make obj" (default unless -o) tools Build and install tools kernel=conf Build kernel with config file `conf' install=idir Run "make installworld" to `idir' (useful after 'distribution' or 'release') Options: -a arch Set MACHINE_ARCH to arch (otherwise deduced from MACHINE) -B buildId Set BUILDID to buildId -D dest Set DESTDIR to dest -E Set "expert" mode; disables some DESTDIR checks -j njob Run up to njob jobs in parallel; see make(1) -M obj Set obj root directory to obj (sets MAKEOBJDIRPREFIX) -m mach Set MACHINE to mach (not required if NetBSD native) -n Show commands that would be executed, but do not execute them -O obj Set obj root directory to obj (sets a MAKEOBJDIR pattern) -o Set MKOBJDIRS=no (do not create objdirs at start of build) -R release Set RELEASEDIR to release -r Remove contents of TOOLDIR and DESTDIR before building -T tools Set TOOLDIR to tools. If unset, and TOOLDIR is not set in the environment, nbmake will be (re)built unconditionally. -U Set UNPRIVED -u Set UPDATE -V v=[val] Set variable `v' to `val' -w wrapper Create nbmake script as wrapper (default: ${TOOLDIR}/bin/nbmake-${MACHINE})
2003-01-23 19:24:08 +03:00
MACHINE=${uname_m}
fi
[ -n "${MACHINE_ARCH}" ] || getarch
Rework how build.sh functions, so that command line options set various parameters, and a list of "operations" defines what to do. The full usage is show below. Notes: `-b' has been deprecated (it always occurs now) `-d' is replaced by "distribution" `-R rel' onlys sets RELEASEDIR; use "release" to build a release `-k kern' has been replaced by "kernel=kern" `-i idir' has been replaced by "install=idir" -r now occurs before nbmake is rebuilt Add a copyright (long due!). Rework the code to (a KNF inspired) ShellNF. Use functions appropriately. Allow `nb' prefix to be easily changed to something else. Solve world peace (just kidding) This is part of the (never achievable) goal of attempting to make NetBSD easier to build... --8<-- new usage follows --8<-- Usage: build.sh [-EnorUu] [-a arch] [-B buildid] [-D dest] [-j njob] [-M obj] [-m mach] [-O obj] [-R release] [-T tools] [-V var=[value]] [-w wrapper] [operation [...] ] System build operations (all imply "obj" and "tools"): build Run "make build" distribution Run "make distribution" (includes etc/ files) release Run "make release" (includes kernels & distrib media) Other operations: obj Run "make obj" (default unless -o) tools Build and install tools kernel=conf Build kernel with config file `conf' install=idir Run "make installworld" to `idir' (useful after 'distribution' or 'release') Options: -a arch Set MACHINE_ARCH to arch (otherwise deduced from MACHINE) -B buildId Set BUILDID to buildId -D dest Set DESTDIR to dest -E Set "expert" mode; disables some DESTDIR checks -j njob Run up to njob jobs in parallel; see make(1) -M obj Set obj root directory to obj (sets MAKEOBJDIRPREFIX) -m mach Set MACHINE to mach (not required if NetBSD native) -n Show commands that would be executed, but do not execute them -O obj Set obj root directory to obj (sets a MAKEOBJDIR pattern) -o Set MKOBJDIRS=no (do not create objdirs at start of build) -R release Set RELEASEDIR to release -r Remove contents of TOOLDIR and DESTDIR before building -T tools Set TOOLDIR to tools. If unset, and TOOLDIR is not set in the environment, nbmake will be (re)built unconditionally. -U Set UNPRIVED -u Set UPDATE -V v=[val] Set variable `v' to `val' -w wrapper Create nbmake script as wrapper (default: ${TOOLDIR}/bin/nbmake-${MACHINE})
2003-01-23 19:24:08 +03:00
validatearch
Rework how build.sh functions, so that command line options set various parameters, and a list of "operations" defines what to do. The full usage is show below. Notes: `-b' has been deprecated (it always occurs now) `-d' is replaced by "distribution" `-R rel' onlys sets RELEASEDIR; use "release" to build a release `-k kern' has been replaced by "kernel=kern" `-i idir' has been replaced by "install=idir" -r now occurs before nbmake is rebuilt Add a copyright (long due!). Rework the code to (a KNF inspired) ShellNF. Use functions appropriately. Allow `nb' prefix to be easily changed to something else. Solve world peace (just kidding) This is part of the (never achievable) goal of attempting to make NetBSD easier to build... --8<-- new usage follows --8<-- Usage: build.sh [-EnorUu] [-a arch] [-B buildid] [-D dest] [-j njob] [-M obj] [-m mach] [-O obj] [-R release] [-T tools] [-V var=[value]] [-w wrapper] [operation [...] ] System build operations (all imply "obj" and "tools"): build Run "make build" distribution Run "make distribution" (includes etc/ files) release Run "make release" (includes kernels & distrib media) Other operations: obj Run "make obj" (default unless -o) tools Build and install tools kernel=conf Build kernel with config file `conf' install=idir Run "make installworld" to `idir' (useful after 'distribution' or 'release') Options: -a arch Set MACHINE_ARCH to arch (otherwise deduced from MACHINE) -B buildId Set BUILDID to buildId -D dest Set DESTDIR to dest -E Set "expert" mode; disables some DESTDIR checks -j njob Run up to njob jobs in parallel; see make(1) -M obj Set obj root directory to obj (sets MAKEOBJDIRPREFIX) -m mach Set MACHINE to mach (not required if NetBSD native) -n Show commands that would be executed, but do not execute them -O obj Set obj root directory to obj (sets a MAKEOBJDIR pattern) -o Set MKOBJDIRS=no (do not create objdirs at start of build) -R release Set RELEASEDIR to release -r Remove contents of TOOLDIR and DESTDIR before building -T tools Set TOOLDIR to tools. If unset, and TOOLDIR is not set in the environment, nbmake will be (re)built unconditionally. -U Set UNPRIVED -u Set UPDATE -V v=[val] Set variable `v' to `val' -w wrapper Create nbmake script as wrapper (default: ${TOOLDIR}/bin/nbmake-${MACHINE})
2003-01-23 19:24:08 +03:00
# Set up default make(1) environment.
#
setmakeenv LC_ALL C
makeenv="${makeenv} TOOLDIR MACHINE MACHINE_ARCH MAKEFLAGS"
[ -z "${BUILDID}" ] || makeenv="${makeenv} BUILDID"
MAKEFLAGS="-de -m ${TOP}/share/mk ${MAKEFLAGS} MKOBJDIRS=${MKOBJDIRS-yes}"
Rework how build.sh functions, so that command line options set various parameters, and a list of "operations" defines what to do. The full usage is show below. Notes: `-b' has been deprecated (it always occurs now) `-d' is replaced by "distribution" `-R rel' onlys sets RELEASEDIR; use "release" to build a release `-k kern' has been replaced by "kernel=kern" `-i idir' has been replaced by "install=idir" -r now occurs before nbmake is rebuilt Add a copyright (long due!). Rework the code to (a KNF inspired) ShellNF. Use functions appropriately. Allow `nb' prefix to be easily changed to something else. Solve world peace (just kidding) This is part of the (never achievable) goal of attempting to make NetBSD easier to build... --8<-- new usage follows --8<-- Usage: build.sh [-EnorUu] [-a arch] [-B buildid] [-D dest] [-j njob] [-M obj] [-m mach] [-O obj] [-R release] [-T tools] [-V var=[value]] [-w wrapper] [operation [...] ] System build operations (all imply "obj" and "tools"): build Run "make build" distribution Run "make distribution" (includes etc/ files) release Run "make release" (includes kernels & distrib media) Other operations: obj Run "make obj" (default unless -o) tools Build and install tools kernel=conf Build kernel with config file `conf' install=idir Run "make installworld" to `idir' (useful after 'distribution' or 'release') Options: -a arch Set MACHINE_ARCH to arch (otherwise deduced from MACHINE) -B buildId Set BUILDID to buildId -D dest Set DESTDIR to dest -E Set "expert" mode; disables some DESTDIR checks -j njob Run up to njob jobs in parallel; see make(1) -M obj Set obj root directory to obj (sets MAKEOBJDIRPREFIX) -m mach Set MACHINE to mach (not required if NetBSD native) -n Show commands that would be executed, but do not execute them -O obj Set obj root directory to obj (sets a MAKEOBJDIR pattern) -o Set MKOBJDIRS=no (do not create objdirs at start of build) -R release Set RELEASEDIR to release -r Remove contents of TOOLDIR and DESTDIR before building -T tools Set TOOLDIR to tools. If unset, and TOOLDIR is not set in the environment, nbmake will be (re)built unconditionally. -U Set UNPRIVED -u Set UPDATE -V v=[val] Set variable `v' to `val' -w wrapper Create nbmake script as wrapper (default: ${TOOLDIR}/bin/nbmake-${MACHINE})
2003-01-23 19:24:08 +03:00
export MAKEFLAGS MACHINE MACHINE_ARCH
}
Rework how build.sh functions, so that command line options set various parameters, and a list of "operations" defines what to do. The full usage is show below. Notes: `-b' has been deprecated (it always occurs now) `-d' is replaced by "distribution" `-R rel' onlys sets RELEASEDIR; use "release" to build a release `-k kern' has been replaced by "kernel=kern" `-i idir' has been replaced by "install=idir" -r now occurs before nbmake is rebuilt Add a copyright (long due!). Rework the code to (a KNF inspired) ShellNF. Use functions appropriately. Allow `nb' prefix to be easily changed to something else. Solve world peace (just kidding) This is part of the (never achievable) goal of attempting to make NetBSD easier to build... --8<-- new usage follows --8<-- Usage: build.sh [-EnorUu] [-a arch] [-B buildid] [-D dest] [-j njob] [-M obj] [-m mach] [-O obj] [-R release] [-T tools] [-V var=[value]] [-w wrapper] [operation [...] ] System build operations (all imply "obj" and "tools"): build Run "make build" distribution Run "make distribution" (includes etc/ files) release Run "make release" (includes kernels & distrib media) Other operations: obj Run "make obj" (default unless -o) tools Build and install tools kernel=conf Build kernel with config file `conf' install=idir Run "make installworld" to `idir' (useful after 'distribution' or 'release') Options: -a arch Set MACHINE_ARCH to arch (otherwise deduced from MACHINE) -B buildId Set BUILDID to buildId -D dest Set DESTDIR to dest -E Set "expert" mode; disables some DESTDIR checks -j njob Run up to njob jobs in parallel; see make(1) -M obj Set obj root directory to obj (sets MAKEOBJDIRPREFIX) -m mach Set MACHINE to mach (not required if NetBSD native) -n Show commands that would be executed, but do not execute them -O obj Set obj root directory to obj (sets a MAKEOBJDIR pattern) -o Set MKOBJDIRS=no (do not create objdirs at start of build) -R release Set RELEASEDIR to release -r Remove contents of TOOLDIR and DESTDIR before building -T tools Set TOOLDIR to tools. If unset, and TOOLDIR is not set in the environment, nbmake will be (re)built unconditionally. -U Set UNPRIVED -u Set UPDATE -V v=[val] Set variable `v' to `val' -w wrapper Create nbmake script as wrapper (default: ${TOOLDIR}/bin/nbmake-${MACHINE})
2003-01-23 19:24:08 +03:00
rebuildmake()
{
# Test make source file timestamps against installed ${toolprefix}make
# binary, if TOOLDIR is pre-set.
#
# Note that we do NOT try to grovel "mk.conf" here to find out if
# TOOLDIR is set there, because it can contain make variable
# expansions and other stuff only parseable *after* we have a working
# ${toolprefix}make. So this logic can only work if the user has
# pre-set TOOLDIR in the environment or used the -T option to build.sh.
#
make="${TOOLDIR-nonexistent}/bin/${toolprefix}make"
if [ -x "${make}" ]; then
Rework how build.sh functions, so that command line options set various parameters, and a list of "operations" defines what to do. The full usage is show below. Notes: `-b' has been deprecated (it always occurs now) `-d' is replaced by "distribution" `-R rel' onlys sets RELEASEDIR; use "release" to build a release `-k kern' has been replaced by "kernel=kern" `-i idir' has been replaced by "install=idir" -r now occurs before nbmake is rebuilt Add a copyright (long due!). Rework the code to (a KNF inspired) ShellNF. Use functions appropriately. Allow `nb' prefix to be easily changed to something else. Solve world peace (just kidding) This is part of the (never achievable) goal of attempting to make NetBSD easier to build... --8<-- new usage follows --8<-- Usage: build.sh [-EnorUu] [-a arch] [-B buildid] [-D dest] [-j njob] [-M obj] [-m mach] [-O obj] [-R release] [-T tools] [-V var=[value]] [-w wrapper] [operation [...] ] System build operations (all imply "obj" and "tools"): build Run "make build" distribution Run "make distribution" (includes etc/ files) release Run "make release" (includes kernels & distrib media) Other operations: obj Run "make obj" (default unless -o) tools Build and install tools kernel=conf Build kernel with config file `conf' install=idir Run "make installworld" to `idir' (useful after 'distribution' or 'release') Options: -a arch Set MACHINE_ARCH to arch (otherwise deduced from MACHINE) -B buildId Set BUILDID to buildId -D dest Set DESTDIR to dest -E Set "expert" mode; disables some DESTDIR checks -j njob Run up to njob jobs in parallel; see make(1) -M obj Set obj root directory to obj (sets MAKEOBJDIRPREFIX) -m mach Set MACHINE to mach (not required if NetBSD native) -n Show commands that would be executed, but do not execute them -O obj Set obj root directory to obj (sets a MAKEOBJDIR pattern) -o Set MKOBJDIRS=no (do not create objdirs at start of build) -R release Set RELEASEDIR to release -r Remove contents of TOOLDIR and DESTDIR before building -T tools Set TOOLDIR to tools. If unset, and TOOLDIR is not set in the environment, nbmake will be (re)built unconditionally. -U Set UNPRIVED -u Set UPDATE -V v=[val] Set variable `v' to `val' -w wrapper Create nbmake script as wrapper (default: ${TOOLDIR}/bin/nbmake-${MACHINE})
2003-01-23 19:24:08 +03:00
for f in usr.bin/make/*.[ch] usr.bin/make/lst.lib/*.[ch]; do
if [ "${f}" -nt "${make}" ]; then
Rework how build.sh functions, so that command line options set various parameters, and a list of "operations" defines what to do. The full usage is show below. Notes: `-b' has been deprecated (it always occurs now) `-d' is replaced by "distribution" `-R rel' onlys sets RELEASEDIR; use "release" to build a release `-k kern' has been replaced by "kernel=kern" `-i idir' has been replaced by "install=idir" -r now occurs before nbmake is rebuilt Add a copyright (long due!). Rework the code to (a KNF inspired) ShellNF. Use functions appropriately. Allow `nb' prefix to be easily changed to something else. Solve world peace (just kidding) This is part of the (never achievable) goal of attempting to make NetBSD easier to build... --8<-- new usage follows --8<-- Usage: build.sh [-EnorUu] [-a arch] [-B buildid] [-D dest] [-j njob] [-M obj] [-m mach] [-O obj] [-R release] [-T tools] [-V var=[value]] [-w wrapper] [operation [...] ] System build operations (all imply "obj" and "tools"): build Run "make build" distribution Run "make distribution" (includes etc/ files) release Run "make release" (includes kernels & distrib media) Other operations: obj Run "make obj" (default unless -o) tools Build and install tools kernel=conf Build kernel with config file `conf' install=idir Run "make installworld" to `idir' (useful after 'distribution' or 'release') Options: -a arch Set MACHINE_ARCH to arch (otherwise deduced from MACHINE) -B buildId Set BUILDID to buildId -D dest Set DESTDIR to dest -E Set "expert" mode; disables some DESTDIR checks -j njob Run up to njob jobs in parallel; see make(1) -M obj Set obj root directory to obj (sets MAKEOBJDIRPREFIX) -m mach Set MACHINE to mach (not required if NetBSD native) -n Show commands that would be executed, but do not execute them -O obj Set obj root directory to obj (sets a MAKEOBJDIR pattern) -o Set MKOBJDIRS=no (do not create objdirs at start of build) -R release Set RELEASEDIR to release -r Remove contents of TOOLDIR and DESTDIR before building -T tools Set TOOLDIR to tools. If unset, and TOOLDIR is not set in the environment, nbmake will be (re)built unconditionally. -U Set UNPRIVED -u Set UPDATE -V v=[val] Set variable `v' to `val' -w wrapper Create nbmake script as wrapper (default: ${TOOLDIR}/bin/nbmake-${MACHINE})
2003-01-23 19:24:08 +03:00
do_rebuildmake=true
break
fi
done
else
do_rebuildmake=true
fi
Rework how build.sh functions, so that command line options set various parameters, and a list of "operations" defines what to do. The full usage is show below. Notes: `-b' has been deprecated (it always occurs now) `-d' is replaced by "distribution" `-R rel' onlys sets RELEASEDIR; use "release" to build a release `-k kern' has been replaced by "kernel=kern" `-i idir' has been replaced by "install=idir" -r now occurs before nbmake is rebuilt Add a copyright (long due!). Rework the code to (a KNF inspired) ShellNF. Use functions appropriately. Allow `nb' prefix to be easily changed to something else. Solve world peace (just kidding) This is part of the (never achievable) goal of attempting to make NetBSD easier to build... --8<-- new usage follows --8<-- Usage: build.sh [-EnorUu] [-a arch] [-B buildid] [-D dest] [-j njob] [-M obj] [-m mach] [-O obj] [-R release] [-T tools] [-V var=[value]] [-w wrapper] [operation [...] ] System build operations (all imply "obj" and "tools"): build Run "make build" distribution Run "make distribution" (includes etc/ files) release Run "make release" (includes kernels & distrib media) Other operations: obj Run "make obj" (default unless -o) tools Build and install tools kernel=conf Build kernel with config file `conf' install=idir Run "make installworld" to `idir' (useful after 'distribution' or 'release') Options: -a arch Set MACHINE_ARCH to arch (otherwise deduced from MACHINE) -B buildId Set BUILDID to buildId -D dest Set DESTDIR to dest -E Set "expert" mode; disables some DESTDIR checks -j njob Run up to njob jobs in parallel; see make(1) -M obj Set obj root directory to obj (sets MAKEOBJDIRPREFIX) -m mach Set MACHINE to mach (not required if NetBSD native) -n Show commands that would be executed, but do not execute them -O obj Set obj root directory to obj (sets a MAKEOBJDIR pattern) -o Set MKOBJDIRS=no (do not create objdirs at start of build) -R release Set RELEASEDIR to release -r Remove contents of TOOLDIR and DESTDIR before building -T tools Set TOOLDIR to tools. If unset, and TOOLDIR is not set in the environment, nbmake will be (re)built unconditionally. -U Set UNPRIVED -u Set UPDATE -V v=[val] Set variable `v' to `val' -w wrapper Create nbmake script as wrapper (default: ${TOOLDIR}/bin/nbmake-${MACHINE})
2003-01-23 19:24:08 +03:00
# Build bootstrap ${toolprefix}make if needed.
if ${do_rebuildmake}; then
statusmsg "Bootstrapping ${toolprefix}make"
${runcmd} cd "${tmpdir}"
${runcmd} env CC="${HOST_CC-cc}" CPPFLAGS="${HOST_CPPFLAGS}" \
Rework how build.sh functions, so that command line options set various parameters, and a list of "operations" defines what to do. The full usage is show below. Notes: `-b' has been deprecated (it always occurs now) `-d' is replaced by "distribution" `-R rel' onlys sets RELEASEDIR; use "release" to build a release `-k kern' has been replaced by "kernel=kern" `-i idir' has been replaced by "install=idir" -r now occurs before nbmake is rebuilt Add a copyright (long due!). Rework the code to (a KNF inspired) ShellNF. Use functions appropriately. Allow `nb' prefix to be easily changed to something else. Solve world peace (just kidding) This is part of the (never achievable) goal of attempting to make NetBSD easier to build... --8<-- new usage follows --8<-- Usage: build.sh [-EnorUu] [-a arch] [-B buildid] [-D dest] [-j njob] [-M obj] [-m mach] [-O obj] [-R release] [-T tools] [-V var=[value]] [-w wrapper] [operation [...] ] System build operations (all imply "obj" and "tools"): build Run "make build" distribution Run "make distribution" (includes etc/ files) release Run "make release" (includes kernels & distrib media) Other operations: obj Run "make obj" (default unless -o) tools Build and install tools kernel=conf Build kernel with config file `conf' install=idir Run "make installworld" to `idir' (useful after 'distribution' or 'release') Options: -a arch Set MACHINE_ARCH to arch (otherwise deduced from MACHINE) -B buildId Set BUILDID to buildId -D dest Set DESTDIR to dest -E Set "expert" mode; disables some DESTDIR checks -j njob Run up to njob jobs in parallel; see make(1) -M obj Set obj root directory to obj (sets MAKEOBJDIRPREFIX) -m mach Set MACHINE to mach (not required if NetBSD native) -n Show commands that would be executed, but do not execute them -O obj Set obj root directory to obj (sets a MAKEOBJDIR pattern) -o Set MKOBJDIRS=no (do not create objdirs at start of build) -R release Set RELEASEDIR to release -r Remove contents of TOOLDIR and DESTDIR before building -T tools Set TOOLDIR to tools. If unset, and TOOLDIR is not set in the environment, nbmake will be (re)built unconditionally. -U Set UNPRIVED -u Set UPDATE -V v=[val] Set variable `v' to `val' -w wrapper Create nbmake script as wrapper (default: ${TOOLDIR}/bin/nbmake-${MACHINE})
2003-01-23 19:24:08 +03:00
CFLAGS="${HOST_CFLAGS--O}" LDFLAGS="${HOST_LDFLAGS}" \
sh "${TOP}/tools/make/configure" ||
bomb "Configure of ${toolprefix}make failed"
${runcmd} sh buildmake.sh ||
bomb "Build of ${toolprefix}make failed"
make="${tmpdir}/${toolprefix}make"
${runcmd} cd "${TOP}"
${runcmd} rm -f usr.bin/make/*.o usr.bin/make/lst.lib/*.o
Rework how build.sh functions, so that command line options set various parameters, and a list of "operations" defines what to do. The full usage is show below. Notes: `-b' has been deprecated (it always occurs now) `-d' is replaced by "distribution" `-R rel' onlys sets RELEASEDIR; use "release" to build a release `-k kern' has been replaced by "kernel=kern" `-i idir' has been replaced by "install=idir" -r now occurs before nbmake is rebuilt Add a copyright (long due!). Rework the code to (a KNF inspired) ShellNF. Use functions appropriately. Allow `nb' prefix to be easily changed to something else. Solve world peace (just kidding) This is part of the (never achievable) goal of attempting to make NetBSD easier to build... --8<-- new usage follows --8<-- Usage: build.sh [-EnorUu] [-a arch] [-B buildid] [-D dest] [-j njob] [-M obj] [-m mach] [-O obj] [-R release] [-T tools] [-V var=[value]] [-w wrapper] [operation [...] ] System build operations (all imply "obj" and "tools"): build Run "make build" distribution Run "make distribution" (includes etc/ files) release Run "make release" (includes kernels & distrib media) Other operations: obj Run "make obj" (default unless -o) tools Build and install tools kernel=conf Build kernel with config file `conf' install=idir Run "make installworld" to `idir' (useful after 'distribution' or 'release') Options: -a arch Set MACHINE_ARCH to arch (otherwise deduced from MACHINE) -B buildId Set BUILDID to buildId -D dest Set DESTDIR to dest -E Set "expert" mode; disables some DESTDIR checks -j njob Run up to njob jobs in parallel; see make(1) -M obj Set obj root directory to obj (sets MAKEOBJDIRPREFIX) -m mach Set MACHINE to mach (not required if NetBSD native) -n Show commands that would be executed, but do not execute them -O obj Set obj root directory to obj (sets a MAKEOBJDIR pattern) -o Set MKOBJDIRS=no (do not create objdirs at start of build) -R release Set RELEASEDIR to release -r Remove contents of TOOLDIR and DESTDIR before building -T tools Set TOOLDIR to tools. If unset, and TOOLDIR is not set in the environment, nbmake will be (re)built unconditionally. -U Set UNPRIVED -u Set UPDATE -V v=[val] Set variable `v' to `val' -w wrapper Create nbmake script as wrapper (default: ${TOOLDIR}/bin/nbmake-${MACHINE})
2003-01-23 19:24:08 +03:00
fi
}
Major cleanup and overhaul: * Allow MACHINE to be set automatically on NetBSD native builds. Require -m only if the host is not NetBSD. * Fail if DESTDIR is set to root (/) and the build is not NetBSD native, or the build is attempting a "make release" (option -R). * Warn the user if DESTDIR is set to root (/) that the kernel must be up to date, or else the build might hose the system. Also, do not remove DESTDIR on -r if it is set to root. * Fail if TOOLDIR is set to / or empty after checking with nbmake. * Allow DESTDIR and TOOLDIR to be set in mk.conf and/or by the new default from <bsd.own.mk>. Note that if -T is not used to set TOOLDIR, and TOOLDIR is not set in the environment, then nbmake will always be bootstrapped (rather than looking at nbmake's timestamp). This is because /bin/sh doesn't know how to get TOOLDIR from mk.conf without first having nbmake (...which lives in TOOLDIR). * Do a pass of "make obj" through src/tools before installing nbmake (so long as -o/MKOBJDIRS=no is not specified). This ensures that objdirs exist if they are desired, and paves the way for using build.sh to build all the src/tools without building everything else. * Add "-w" option, which allows the builder to specify where the nbmake wrapper shell script should be created. If not specified, $TOOLDIR/bin/nbmake-$MACHINE is still created as a default. * Print the values of DESTDIR and TOOLDIR after bootstrapping nbmake, for informational purposes. It should now be possible to type just "./build.sh" on a NetBSD-current host and get a new build in / for the appropriate architecture. However, building in-place like this has *not* been extensively tested yet, so be careful.
2001-10-31 22:59:43 +03:00
Rework how build.sh functions, so that command line options set various parameters, and a list of "operations" defines what to do. The full usage is show below. Notes: `-b' has been deprecated (it always occurs now) `-d' is replaced by "distribution" `-R rel' onlys sets RELEASEDIR; use "release" to build a release `-k kern' has been replaced by "kernel=kern" `-i idir' has been replaced by "install=idir" -r now occurs before nbmake is rebuilt Add a copyright (long due!). Rework the code to (a KNF inspired) ShellNF. Use functions appropriately. Allow `nb' prefix to be easily changed to something else. Solve world peace (just kidding) This is part of the (never achievable) goal of attempting to make NetBSD easier to build... --8<-- new usage follows --8<-- Usage: build.sh [-EnorUu] [-a arch] [-B buildid] [-D dest] [-j njob] [-M obj] [-m mach] [-O obj] [-R release] [-T tools] [-V var=[value]] [-w wrapper] [operation [...] ] System build operations (all imply "obj" and "tools"): build Run "make build" distribution Run "make distribution" (includes etc/ files) release Run "make release" (includes kernels & distrib media) Other operations: obj Run "make obj" (default unless -o) tools Build and install tools kernel=conf Build kernel with config file `conf' install=idir Run "make installworld" to `idir' (useful after 'distribution' or 'release') Options: -a arch Set MACHINE_ARCH to arch (otherwise deduced from MACHINE) -B buildId Set BUILDID to buildId -D dest Set DESTDIR to dest -E Set "expert" mode; disables some DESTDIR checks -j njob Run up to njob jobs in parallel; see make(1) -M obj Set obj root directory to obj (sets MAKEOBJDIRPREFIX) -m mach Set MACHINE to mach (not required if NetBSD native) -n Show commands that would be executed, but do not execute them -O obj Set obj root directory to obj (sets a MAKEOBJDIR pattern) -o Set MKOBJDIRS=no (do not create objdirs at start of build) -R release Set RELEASEDIR to release -r Remove contents of TOOLDIR and DESTDIR before building -T tools Set TOOLDIR to tools. If unset, and TOOLDIR is not set in the environment, nbmake will be (re)built unconditionally. -U Set UNPRIVED -u Set UPDATE -V v=[val] Set variable `v' to `val' -w wrapper Create nbmake script as wrapper (default: ${TOOLDIR}/bin/nbmake-${MACHINE})
2003-01-23 19:24:08 +03:00
validatemakeparams()
{
if [ "${runcmd}" = "echo" ]; then
Rework how build.sh functions, so that command line options set various parameters, and a list of "operations" defines what to do. The full usage is show below. Notes: `-b' has been deprecated (it always occurs now) `-d' is replaced by "distribution" `-R rel' onlys sets RELEASEDIR; use "release" to build a release `-k kern' has been replaced by "kernel=kern" `-i idir' has been replaced by "install=idir" -r now occurs before nbmake is rebuilt Add a copyright (long due!). Rework the code to (a KNF inspired) ShellNF. Use functions appropriately. Allow `nb' prefix to be easily changed to something else. Solve world peace (just kidding) This is part of the (never achievable) goal of attempting to make NetBSD easier to build... --8<-- new usage follows --8<-- Usage: build.sh [-EnorUu] [-a arch] [-B buildid] [-D dest] [-j njob] [-M obj] [-m mach] [-O obj] [-R release] [-T tools] [-V var=[value]] [-w wrapper] [operation [...] ] System build operations (all imply "obj" and "tools"): build Run "make build" distribution Run "make distribution" (includes etc/ files) release Run "make release" (includes kernels & distrib media) Other operations: obj Run "make obj" (default unless -o) tools Build and install tools kernel=conf Build kernel with config file `conf' install=idir Run "make installworld" to `idir' (useful after 'distribution' or 'release') Options: -a arch Set MACHINE_ARCH to arch (otherwise deduced from MACHINE) -B buildId Set BUILDID to buildId -D dest Set DESTDIR to dest -E Set "expert" mode; disables some DESTDIR checks -j njob Run up to njob jobs in parallel; see make(1) -M obj Set obj root directory to obj (sets MAKEOBJDIRPREFIX) -m mach Set MACHINE to mach (not required if NetBSD native) -n Show commands that would be executed, but do not execute them -O obj Set obj root directory to obj (sets a MAKEOBJDIR pattern) -o Set MKOBJDIRS=no (do not create objdirs at start of build) -R release Set RELEASEDIR to release -r Remove contents of TOOLDIR and DESTDIR before building -T tools Set TOOLDIR to tools. If unset, and TOOLDIR is not set in the environment, nbmake will be (re)built unconditionally. -U Set UNPRIVED -u Set UPDATE -V v=[val] Set variable `v' to `val' -w wrapper Create nbmake script as wrapper (default: ${TOOLDIR}/bin/nbmake-${MACHINE})
2003-01-23 19:24:08 +03:00
TOOLCHAIN_MISSING=no
EXTERNAL_TOOLCHAIN=""
else
TOOLCHAIN_MISSING=$(raw_getmakevar TOOLCHAIN_MISSING)
EXTERNAL_TOOLCHAIN=$(raw_getmakevar EXTERNAL_TOOLCHAIN)
Rework how build.sh functions, so that command line options set various parameters, and a list of "operations" defines what to do. The full usage is show below. Notes: `-b' has been deprecated (it always occurs now) `-d' is replaced by "distribution" `-R rel' onlys sets RELEASEDIR; use "release" to build a release `-k kern' has been replaced by "kernel=kern" `-i idir' has been replaced by "install=idir" -r now occurs before nbmake is rebuilt Add a copyright (long due!). Rework the code to (a KNF inspired) ShellNF. Use functions appropriately. Allow `nb' prefix to be easily changed to something else. Solve world peace (just kidding) This is part of the (never achievable) goal of attempting to make NetBSD easier to build... --8<-- new usage follows --8<-- Usage: build.sh [-EnorUu] [-a arch] [-B buildid] [-D dest] [-j njob] [-M obj] [-m mach] [-O obj] [-R release] [-T tools] [-V var=[value]] [-w wrapper] [operation [...] ] System build operations (all imply "obj" and "tools"): build Run "make build" distribution Run "make distribution" (includes etc/ files) release Run "make release" (includes kernels & distrib media) Other operations: obj Run "make obj" (default unless -o) tools Build and install tools kernel=conf Build kernel with config file `conf' install=idir Run "make installworld" to `idir' (useful after 'distribution' or 'release') Options: -a arch Set MACHINE_ARCH to arch (otherwise deduced from MACHINE) -B buildId Set BUILDID to buildId -D dest Set DESTDIR to dest -E Set "expert" mode; disables some DESTDIR checks -j njob Run up to njob jobs in parallel; see make(1) -M obj Set obj root directory to obj (sets MAKEOBJDIRPREFIX) -m mach Set MACHINE to mach (not required if NetBSD native) -n Show commands that would be executed, but do not execute them -O obj Set obj root directory to obj (sets a MAKEOBJDIR pattern) -o Set MKOBJDIRS=no (do not create objdirs at start of build) -R release Set RELEASEDIR to release -r Remove contents of TOOLDIR and DESTDIR before building -T tools Set TOOLDIR to tools. If unset, and TOOLDIR is not set in the environment, nbmake will be (re)built unconditionally. -U Set UNPRIVED -u Set UPDATE -V v=[val] Set variable `v' to `val' -w wrapper Create nbmake script as wrapper (default: ${TOOLDIR}/bin/nbmake-${MACHINE})
2003-01-23 19:24:08 +03:00
fi
if [ "${TOOLCHAIN_MISSING}" = "yes" ] && \
[ -z "${EXTERNAL_TOOLCHAIN}" ]; then
${runcmd} echo "ERROR: build.sh (in-tree cross-toolchain) is not yet available for"
${runcmd} echo " MACHINE: ${MACHINE}"
${runcmd} echo " MACHINE_ARCH: ${MACHINE_ARCH}"
${runcmd} echo ""
${runcmd} echo "All builds for this platform should be done via a traditional make"
${runcmd} echo "If you wish to use an external cross-toolchain, set"
${runcmd} echo " EXTERNAL_TOOLCHAIN=<path to toolchain root>"
${runcmd} echo "in either the environment or mk.conf and rerun"
${runcmd} echo " ${progname} $*"
Rework how build.sh functions, so that command line options set various parameters, and a list of "operations" defines what to do. The full usage is show below. Notes: `-b' has been deprecated (it always occurs now) `-d' is replaced by "distribution" `-R rel' onlys sets RELEASEDIR; use "release" to build a release `-k kern' has been replaced by "kernel=kern" `-i idir' has been replaced by "install=idir" -r now occurs before nbmake is rebuilt Add a copyright (long due!). Rework the code to (a KNF inspired) ShellNF. Use functions appropriately. Allow `nb' prefix to be easily changed to something else. Solve world peace (just kidding) This is part of the (never achievable) goal of attempting to make NetBSD easier to build... --8<-- new usage follows --8<-- Usage: build.sh [-EnorUu] [-a arch] [-B buildid] [-D dest] [-j njob] [-M obj] [-m mach] [-O obj] [-R release] [-T tools] [-V var=[value]] [-w wrapper] [operation [...] ] System build operations (all imply "obj" and "tools"): build Run "make build" distribution Run "make distribution" (includes etc/ files) release Run "make release" (includes kernels & distrib media) Other operations: obj Run "make obj" (default unless -o) tools Build and install tools kernel=conf Build kernel with config file `conf' install=idir Run "make installworld" to `idir' (useful after 'distribution' or 'release') Options: -a arch Set MACHINE_ARCH to arch (otherwise deduced from MACHINE) -B buildId Set BUILDID to buildId -D dest Set DESTDIR to dest -E Set "expert" mode; disables some DESTDIR checks -j njob Run up to njob jobs in parallel; see make(1) -M obj Set obj root directory to obj (sets MAKEOBJDIRPREFIX) -m mach Set MACHINE to mach (not required if NetBSD native) -n Show commands that would be executed, but do not execute them -O obj Set obj root directory to obj (sets a MAKEOBJDIR pattern) -o Set MKOBJDIRS=no (do not create objdirs at start of build) -R release Set RELEASEDIR to release -r Remove contents of TOOLDIR and DESTDIR before building -T tools Set TOOLDIR to tools. If unset, and TOOLDIR is not set in the environment, nbmake will be (re)built unconditionally. -U Set UNPRIVED -u Set UPDATE -V v=[val] Set variable `v' to `val' -w wrapper Create nbmake script as wrapper (default: ${TOOLDIR}/bin/nbmake-${MACHINE})
2003-01-23 19:24:08 +03:00
exit 1
fi
if [ "${MKOBJDIRS}" != "no" ]; then
# If setting -M or -O to the root of an obj dir, make sure
# the base directory is made before continuing as <bsd.own.mk>
# will need this to pick up _SRC_TOP_OBJ_
#
if [ ! -z "${makeobjdir}" ]; then
${runcmd} mkdir -p "${makeobjdir}"
fi
# make obj in tools to ensure that the objdir for the top-level
# of the source tree and for "tools" is available, in case the
# default TOOLDIR setting from <bsd.own.mk> is used, or the
# build.sh default DESTDIR and RELEASEDIR is to be used.
#
${runcmd} cd tools
${runcmd} "${make}" -m ${TOP}/share/mk obj NOSUBDIR= ||
bomb "Failed to make obj in tools"
${runcmd} cd "${TOP}"
Rework how build.sh functions, so that command line options set various parameters, and a list of "operations" defines what to do. The full usage is show below. Notes: `-b' has been deprecated (it always occurs now) `-d' is replaced by "distribution" `-R rel' onlys sets RELEASEDIR; use "release" to build a release `-k kern' has been replaced by "kernel=kern" `-i idir' has been replaced by "install=idir" -r now occurs before nbmake is rebuilt Add a copyright (long due!). Rework the code to (a KNF inspired) ShellNF. Use functions appropriately. Allow `nb' prefix to be easily changed to something else. Solve world peace (just kidding) This is part of the (never achievable) goal of attempting to make NetBSD easier to build... --8<-- new usage follows --8<-- Usage: build.sh [-EnorUu] [-a arch] [-B buildid] [-D dest] [-j njob] [-M obj] [-m mach] [-O obj] [-R release] [-T tools] [-V var=[value]] [-w wrapper] [operation [...] ] System build operations (all imply "obj" and "tools"): build Run "make build" distribution Run "make distribution" (includes etc/ files) release Run "make release" (includes kernels & distrib media) Other operations: obj Run "make obj" (default unless -o) tools Build and install tools kernel=conf Build kernel with config file `conf' install=idir Run "make installworld" to `idir' (useful after 'distribution' or 'release') Options: -a arch Set MACHINE_ARCH to arch (otherwise deduced from MACHINE) -B buildId Set BUILDID to buildId -D dest Set DESTDIR to dest -E Set "expert" mode; disables some DESTDIR checks -j njob Run up to njob jobs in parallel; see make(1) -M obj Set obj root directory to obj (sets MAKEOBJDIRPREFIX) -m mach Set MACHINE to mach (not required if NetBSD native) -n Show commands that would be executed, but do not execute them -O obj Set obj root directory to obj (sets a MAKEOBJDIR pattern) -o Set MKOBJDIRS=no (do not create objdirs at start of build) -R release Set RELEASEDIR to release -r Remove contents of TOOLDIR and DESTDIR before building -T tools Set TOOLDIR to tools. If unset, and TOOLDIR is not set in the environment, nbmake will be (re)built unconditionally. -U Set UNPRIVED -u Set UPDATE -V v=[val] Set variable `v' to `val' -w wrapper Create nbmake script as wrapper (default: ${TOOLDIR}/bin/nbmake-${MACHINE})
2003-01-23 19:24:08 +03:00
fi
statusmsg "MACHINE: ${MACHINE}"
statusmsg "MACHINE_ARCH: ${MACHINE_ARCH}"
# Find TOOLDIR, DESTDIR, and RELEASEDIR.
Rework how build.sh functions, so that command line options set various parameters, and a list of "operations" defines what to do. The full usage is show below. Notes: `-b' has been deprecated (it always occurs now) `-d' is replaced by "distribution" `-R rel' onlys sets RELEASEDIR; use "release" to build a release `-k kern' has been replaced by "kernel=kern" `-i idir' has been replaced by "install=idir" -r now occurs before nbmake is rebuilt Add a copyright (long due!). Rework the code to (a KNF inspired) ShellNF. Use functions appropriately. Allow `nb' prefix to be easily changed to something else. Solve world peace (just kidding) This is part of the (never achievable) goal of attempting to make NetBSD easier to build... --8<-- new usage follows --8<-- Usage: build.sh [-EnorUu] [-a arch] [-B buildid] [-D dest] [-j njob] [-M obj] [-m mach] [-O obj] [-R release] [-T tools] [-V var=[value]] [-w wrapper] [operation [...] ] System build operations (all imply "obj" and "tools"): build Run "make build" distribution Run "make distribution" (includes etc/ files) release Run "make release" (includes kernels & distrib media) Other operations: obj Run "make obj" (default unless -o) tools Build and install tools kernel=conf Build kernel with config file `conf' install=idir Run "make installworld" to `idir' (useful after 'distribution' or 'release') Options: -a arch Set MACHINE_ARCH to arch (otherwise deduced from MACHINE) -B buildId Set BUILDID to buildId -D dest Set DESTDIR to dest -E Set "expert" mode; disables some DESTDIR checks -j njob Run up to njob jobs in parallel; see make(1) -M obj Set obj root directory to obj (sets MAKEOBJDIRPREFIX) -m mach Set MACHINE to mach (not required if NetBSD native) -n Show commands that would be executed, but do not execute them -O obj Set obj root directory to obj (sets a MAKEOBJDIR pattern) -o Set MKOBJDIRS=no (do not create objdirs at start of build) -R release Set RELEASEDIR to release -r Remove contents of TOOLDIR and DESTDIR before building -T tools Set TOOLDIR to tools. If unset, and TOOLDIR is not set in the environment, nbmake will be (re)built unconditionally. -U Set UNPRIVED -u Set UPDATE -V v=[val] Set variable `v' to `val' -w wrapper Create nbmake script as wrapper (default: ${TOOLDIR}/bin/nbmake-${MACHINE})
2003-01-23 19:24:08 +03:00
#
TOOLDIR=$(getmakevar TOOLDIR)
statusmsg "TOOLDIR path: ${TOOLDIR}"
DESTDIR=$(getmakevar DESTDIR)
RELEASEDIR=$(getmakevar RELEASEDIR)
if ! $do_expertmode; then
_SRC_TOP_OBJ_=$(getmakevar _SRC_TOP_OBJ_)
: ${DESTDIR:=${_SRC_TOP_OBJ_}/destdir.${MACHINE}}
: ${RELEASEDIR:=${_SRC_TOP_OBJ_}/releasedir}
makeenv="${makeenv} DESTDIR RELEASEDIR"
fi
export TOOLDIR DESTDIR RELEASEDIR
statusmsg "DESTDIR path: ${DESTDIR}"
statusmsg "RELEASEDIR path: ${RELEASEDIR}"
Rework how build.sh functions, so that command line options set various parameters, and a list of "operations" defines what to do. The full usage is show below. Notes: `-b' has been deprecated (it always occurs now) `-d' is replaced by "distribution" `-R rel' onlys sets RELEASEDIR; use "release" to build a release `-k kern' has been replaced by "kernel=kern" `-i idir' has been replaced by "install=idir" -r now occurs before nbmake is rebuilt Add a copyright (long due!). Rework the code to (a KNF inspired) ShellNF. Use functions appropriately. Allow `nb' prefix to be easily changed to something else. Solve world peace (just kidding) This is part of the (never achievable) goal of attempting to make NetBSD easier to build... --8<-- new usage follows --8<-- Usage: build.sh [-EnorUu] [-a arch] [-B buildid] [-D dest] [-j njob] [-M obj] [-m mach] [-O obj] [-R release] [-T tools] [-V var=[value]] [-w wrapper] [operation [...] ] System build operations (all imply "obj" and "tools"): build Run "make build" distribution Run "make distribution" (includes etc/ files) release Run "make release" (includes kernels & distrib media) Other operations: obj Run "make obj" (default unless -o) tools Build and install tools kernel=conf Build kernel with config file `conf' install=idir Run "make installworld" to `idir' (useful after 'distribution' or 'release') Options: -a arch Set MACHINE_ARCH to arch (otherwise deduced from MACHINE) -B buildId Set BUILDID to buildId -D dest Set DESTDIR to dest -E Set "expert" mode; disables some DESTDIR checks -j njob Run up to njob jobs in parallel; see make(1) -M obj Set obj root directory to obj (sets MAKEOBJDIRPREFIX) -m mach Set MACHINE to mach (not required if NetBSD native) -n Show commands that would be executed, but do not execute them -O obj Set obj root directory to obj (sets a MAKEOBJDIR pattern) -o Set MKOBJDIRS=no (do not create objdirs at start of build) -R release Set RELEASEDIR to release -r Remove contents of TOOLDIR and DESTDIR before building -T tools Set TOOLDIR to tools. If unset, and TOOLDIR is not set in the environment, nbmake will be (re)built unconditionally. -U Set UNPRIVED -u Set UPDATE -V v=[val] Set variable `v' to `val' -w wrapper Create nbmake script as wrapper (default: ${TOOLDIR}/bin/nbmake-${MACHINE})
2003-01-23 19:24:08 +03:00
# Check validity of TOOLDIR and DESTDIR.
#
if [ -z "${TOOLDIR}" ] || [ "${TOOLDIR}" = "/" ]; then
bomb "TOOLDIR '${TOOLDIR}' invalid"
Rework how build.sh functions, so that command line options set various parameters, and a list of "operations" defines what to do. The full usage is show below. Notes: `-b' has been deprecated (it always occurs now) `-d' is replaced by "distribution" `-R rel' onlys sets RELEASEDIR; use "release" to build a release `-k kern' has been replaced by "kernel=kern" `-i idir' has been replaced by "install=idir" -r now occurs before nbmake is rebuilt Add a copyright (long due!). Rework the code to (a KNF inspired) ShellNF. Use functions appropriately. Allow `nb' prefix to be easily changed to something else. Solve world peace (just kidding) This is part of the (never achievable) goal of attempting to make NetBSD easier to build... --8<-- new usage follows --8<-- Usage: build.sh [-EnorUu] [-a arch] [-B buildid] [-D dest] [-j njob] [-M obj] [-m mach] [-O obj] [-R release] [-T tools] [-V var=[value]] [-w wrapper] [operation [...] ] System build operations (all imply "obj" and "tools"): build Run "make build" distribution Run "make distribution" (includes etc/ files) release Run "make release" (includes kernels & distrib media) Other operations: obj Run "make obj" (default unless -o) tools Build and install tools kernel=conf Build kernel with config file `conf' install=idir Run "make installworld" to `idir' (useful after 'distribution' or 'release') Options: -a arch Set MACHINE_ARCH to arch (otherwise deduced from MACHINE) -B buildId Set BUILDID to buildId -D dest Set DESTDIR to dest -E Set "expert" mode; disables some DESTDIR checks -j njob Run up to njob jobs in parallel; see make(1) -M obj Set obj root directory to obj (sets MAKEOBJDIRPREFIX) -m mach Set MACHINE to mach (not required if NetBSD native) -n Show commands that would be executed, but do not execute them -O obj Set obj root directory to obj (sets a MAKEOBJDIR pattern) -o Set MKOBJDIRS=no (do not create objdirs at start of build) -R release Set RELEASEDIR to release -r Remove contents of TOOLDIR and DESTDIR before building -T tools Set TOOLDIR to tools. If unset, and TOOLDIR is not set in the environment, nbmake will be (re)built unconditionally. -U Set UNPRIVED -u Set UPDATE -V v=[val] Set variable `v' to `val' -w wrapper Create nbmake script as wrapper (default: ${TOOLDIR}/bin/nbmake-${MACHINE})
2003-01-23 19:24:08 +03:00
fi
removedirs="${TOOLDIR}"
Rework how build.sh functions, so that command line options set various parameters, and a list of "operations" defines what to do. The full usage is show below. Notes: `-b' has been deprecated (it always occurs now) `-d' is replaced by "distribution" `-R rel' onlys sets RELEASEDIR; use "release" to build a release `-k kern' has been replaced by "kernel=kern" `-i idir' has been replaced by "install=idir" -r now occurs before nbmake is rebuilt Add a copyright (long due!). Rework the code to (a KNF inspired) ShellNF. Use functions appropriately. Allow `nb' prefix to be easily changed to something else. Solve world peace (just kidding) This is part of the (never achievable) goal of attempting to make NetBSD easier to build... --8<-- new usage follows --8<-- Usage: build.sh [-EnorUu] [-a arch] [-B buildid] [-D dest] [-j njob] [-M obj] [-m mach] [-O obj] [-R release] [-T tools] [-V var=[value]] [-w wrapper] [operation [...] ] System build operations (all imply "obj" and "tools"): build Run "make build" distribution Run "make distribution" (includes etc/ files) release Run "make release" (includes kernels & distrib media) Other operations: obj Run "make obj" (default unless -o) tools Build and install tools kernel=conf Build kernel with config file `conf' install=idir Run "make installworld" to `idir' (useful after 'distribution' or 'release') Options: -a arch Set MACHINE_ARCH to arch (otherwise deduced from MACHINE) -B buildId Set BUILDID to buildId -D dest Set DESTDIR to dest -E Set "expert" mode; disables some DESTDIR checks -j njob Run up to njob jobs in parallel; see make(1) -M obj Set obj root directory to obj (sets MAKEOBJDIRPREFIX) -m mach Set MACHINE to mach (not required if NetBSD native) -n Show commands that would be executed, but do not execute them -O obj Set obj root directory to obj (sets a MAKEOBJDIR pattern) -o Set MKOBJDIRS=no (do not create objdirs at start of build) -R release Set RELEASEDIR to release -r Remove contents of TOOLDIR and DESTDIR before building -T tools Set TOOLDIR to tools. If unset, and TOOLDIR is not set in the environment, nbmake will be (re)built unconditionally. -U Set UNPRIVED -u Set UPDATE -V v=[val] Set variable `v' to `val' -w wrapper Create nbmake script as wrapper (default: ${TOOLDIR}/bin/nbmake-${MACHINE})
2003-01-23 19:24:08 +03:00
if [ -z "${DESTDIR}" ] || [ "${DESTDIR}" = "/" ]; then
if ${do_build} || ${do_distribution} || ${do_release}; then
if ! ${do_build} || \
Rework how build.sh functions, so that command line options set various parameters, and a list of "operations" defines what to do. The full usage is show below. Notes: `-b' has been deprecated (it always occurs now) `-d' is replaced by "distribution" `-R rel' onlys sets RELEASEDIR; use "release" to build a release `-k kern' has been replaced by "kernel=kern" `-i idir' has been replaced by "install=idir" -r now occurs before nbmake is rebuilt Add a copyright (long due!). Rework the code to (a KNF inspired) ShellNF. Use functions appropriately. Allow `nb' prefix to be easily changed to something else. Solve world peace (just kidding) This is part of the (never achievable) goal of attempting to make NetBSD easier to build... --8<-- new usage follows --8<-- Usage: build.sh [-EnorUu] [-a arch] [-B buildid] [-D dest] [-j njob] [-M obj] [-m mach] [-O obj] [-R release] [-T tools] [-V var=[value]] [-w wrapper] [operation [...] ] System build operations (all imply "obj" and "tools"): build Run "make build" distribution Run "make distribution" (includes etc/ files) release Run "make release" (includes kernels & distrib media) Other operations: obj Run "make obj" (default unless -o) tools Build and install tools kernel=conf Build kernel with config file `conf' install=idir Run "make installworld" to `idir' (useful after 'distribution' or 'release') Options: -a arch Set MACHINE_ARCH to arch (otherwise deduced from MACHINE) -B buildId Set BUILDID to buildId -D dest Set DESTDIR to dest -E Set "expert" mode; disables some DESTDIR checks -j njob Run up to njob jobs in parallel; see make(1) -M obj Set obj root directory to obj (sets MAKEOBJDIRPREFIX) -m mach Set MACHINE to mach (not required if NetBSD native) -n Show commands that would be executed, but do not execute them -O obj Set obj root directory to obj (sets a MAKEOBJDIR pattern) -o Set MKOBJDIRS=no (do not create objdirs at start of build) -R release Set RELEASEDIR to release -r Remove contents of TOOLDIR and DESTDIR before building -T tools Set TOOLDIR to tools. If unset, and TOOLDIR is not set in the environment, nbmake will be (re)built unconditionally. -U Set UNPRIVED -u Set UPDATE -V v=[val] Set variable `v' to `val' -w wrapper Create nbmake script as wrapper (default: ${TOOLDIR}/bin/nbmake-${MACHINE})
2003-01-23 19:24:08 +03:00
[ "${uname_s}" != "NetBSD" ] || \
[ "${uname_m}" != "${MACHINE}" ]; then
Rework how build.sh functions, so that command line options set various parameters, and a list of "operations" defines what to do. The full usage is show below. Notes: `-b' has been deprecated (it always occurs now) `-d' is replaced by "distribution" `-R rel' onlys sets RELEASEDIR; use "release" to build a release `-k kern' has been replaced by "kernel=kern" `-i idir' has been replaced by "install=idir" -r now occurs before nbmake is rebuilt Add a copyright (long due!). Rework the code to (a KNF inspired) ShellNF. Use functions appropriately. Allow `nb' prefix to be easily changed to something else. Solve world peace (just kidding) This is part of the (never achievable) goal of attempting to make NetBSD easier to build... --8<-- new usage follows --8<-- Usage: build.sh [-EnorUu] [-a arch] [-B buildid] [-D dest] [-j njob] [-M obj] [-m mach] [-O obj] [-R release] [-T tools] [-V var=[value]] [-w wrapper] [operation [...] ] System build operations (all imply "obj" and "tools"): build Run "make build" distribution Run "make distribution" (includes etc/ files) release Run "make release" (includes kernels & distrib media) Other operations: obj Run "make obj" (default unless -o) tools Build and install tools kernel=conf Build kernel with config file `conf' install=idir Run "make installworld" to `idir' (useful after 'distribution' or 'release') Options: -a arch Set MACHINE_ARCH to arch (otherwise deduced from MACHINE) -B buildId Set BUILDID to buildId -D dest Set DESTDIR to dest -E Set "expert" mode; disables some DESTDIR checks -j njob Run up to njob jobs in parallel; see make(1) -M obj Set obj root directory to obj (sets MAKEOBJDIRPREFIX) -m mach Set MACHINE to mach (not required if NetBSD native) -n Show commands that would be executed, but do not execute them -O obj Set obj root directory to obj (sets a MAKEOBJDIR pattern) -o Set MKOBJDIRS=no (do not create objdirs at start of build) -R release Set RELEASEDIR to release -r Remove contents of TOOLDIR and DESTDIR before building -T tools Set TOOLDIR to tools. If unset, and TOOLDIR is not set in the environment, nbmake will be (re)built unconditionally. -U Set UNPRIVED -u Set UPDATE -V v=[val] Set variable `v' to `val' -w wrapper Create nbmake script as wrapper (default: ${TOOLDIR}/bin/nbmake-${MACHINE})
2003-01-23 19:24:08 +03:00
bomb "DESTDIR must != / for cross builds, or ${progname} 'distribution' or 'release'."
fi
if ! ${do_expertmode}; then
Rework how build.sh functions, so that command line options set various parameters, and a list of "operations" defines what to do. The full usage is show below. Notes: `-b' has been deprecated (it always occurs now) `-d' is replaced by "distribution" `-R rel' onlys sets RELEASEDIR; use "release" to build a release `-k kern' has been replaced by "kernel=kern" `-i idir' has been replaced by "install=idir" -r now occurs before nbmake is rebuilt Add a copyright (long due!). Rework the code to (a KNF inspired) ShellNF. Use functions appropriately. Allow `nb' prefix to be easily changed to something else. Solve world peace (just kidding) This is part of the (never achievable) goal of attempting to make NetBSD easier to build... --8<-- new usage follows --8<-- Usage: build.sh [-EnorUu] [-a arch] [-B buildid] [-D dest] [-j njob] [-M obj] [-m mach] [-O obj] [-R release] [-T tools] [-V var=[value]] [-w wrapper] [operation [...] ] System build operations (all imply "obj" and "tools"): build Run "make build" distribution Run "make distribution" (includes etc/ files) release Run "make release" (includes kernels & distrib media) Other operations: obj Run "make obj" (default unless -o) tools Build and install tools kernel=conf Build kernel with config file `conf' install=idir Run "make installworld" to `idir' (useful after 'distribution' or 'release') Options: -a arch Set MACHINE_ARCH to arch (otherwise deduced from MACHINE) -B buildId Set BUILDID to buildId -D dest Set DESTDIR to dest -E Set "expert" mode; disables some DESTDIR checks -j njob Run up to njob jobs in parallel; see make(1) -M obj Set obj root directory to obj (sets MAKEOBJDIRPREFIX) -m mach Set MACHINE to mach (not required if NetBSD native) -n Show commands that would be executed, but do not execute them -O obj Set obj root directory to obj (sets a MAKEOBJDIR pattern) -o Set MKOBJDIRS=no (do not create objdirs at start of build) -R release Set RELEASEDIR to release -r Remove contents of TOOLDIR and DESTDIR before building -T tools Set TOOLDIR to tools. If unset, and TOOLDIR is not set in the environment, nbmake will be (re)built unconditionally. -U Set UNPRIVED -u Set UPDATE -V v=[val] Set variable `v' to `val' -w wrapper Create nbmake script as wrapper (default: ${TOOLDIR}/bin/nbmake-${MACHINE})
2003-01-23 19:24:08 +03:00
bomb "DESTDIR must != / for non -E (expert) builds"
fi
statusmsg "WARNING: Building to /, in expert mode."
statusmsg " This may cause your system to break! Reasons include:"
statusmsg " - your kernel is not up to date"
statusmsg " - the libraries or toolchain have changed"
statusmsg " YOU HAVE BEEN WARNED!"
fi
Rework how build.sh functions, so that command line options set various parameters, and a list of "operations" defines what to do. The full usage is show below. Notes: `-b' has been deprecated (it always occurs now) `-d' is replaced by "distribution" `-R rel' onlys sets RELEASEDIR; use "release" to build a release `-k kern' has been replaced by "kernel=kern" `-i idir' has been replaced by "install=idir" -r now occurs before nbmake is rebuilt Add a copyright (long due!). Rework the code to (a KNF inspired) ShellNF. Use functions appropriately. Allow `nb' prefix to be easily changed to something else. Solve world peace (just kidding) This is part of the (never achievable) goal of attempting to make NetBSD easier to build... --8<-- new usage follows --8<-- Usage: build.sh [-EnorUu] [-a arch] [-B buildid] [-D dest] [-j njob] [-M obj] [-m mach] [-O obj] [-R release] [-T tools] [-V var=[value]] [-w wrapper] [operation [...] ] System build operations (all imply "obj" and "tools"): build Run "make build" distribution Run "make distribution" (includes etc/ files) release Run "make release" (includes kernels & distrib media) Other operations: obj Run "make obj" (default unless -o) tools Build and install tools kernel=conf Build kernel with config file `conf' install=idir Run "make installworld" to `idir' (useful after 'distribution' or 'release') Options: -a arch Set MACHINE_ARCH to arch (otherwise deduced from MACHINE) -B buildId Set BUILDID to buildId -D dest Set DESTDIR to dest -E Set "expert" mode; disables some DESTDIR checks -j njob Run up to njob jobs in parallel; see make(1) -M obj Set obj root directory to obj (sets MAKEOBJDIRPREFIX) -m mach Set MACHINE to mach (not required if NetBSD native) -n Show commands that would be executed, but do not execute them -O obj Set obj root directory to obj (sets a MAKEOBJDIR pattern) -o Set MKOBJDIRS=no (do not create objdirs at start of build) -R release Set RELEASEDIR to release -r Remove contents of TOOLDIR and DESTDIR before building -T tools Set TOOLDIR to tools. If unset, and TOOLDIR is not set in the environment, nbmake will be (re)built unconditionally. -U Set UNPRIVED -u Set UPDATE -V v=[val] Set variable `v' to `val' -w wrapper Create nbmake script as wrapper (default: ${TOOLDIR}/bin/nbmake-${MACHINE})
2003-01-23 19:24:08 +03:00
else
removedirs="${removedirs} ${DESTDIR}"
Major cleanup and overhaul: * Allow MACHINE to be set automatically on NetBSD native builds. Require -m only if the host is not NetBSD. * Fail if DESTDIR is set to root (/) and the build is not NetBSD native, or the build is attempting a "make release" (option -R). * Warn the user if DESTDIR is set to root (/) that the kernel must be up to date, or else the build might hose the system. Also, do not remove DESTDIR on -r if it is set to root. * Fail if TOOLDIR is set to / or empty after checking with nbmake. * Allow DESTDIR and TOOLDIR to be set in mk.conf and/or by the new default from <bsd.own.mk>. Note that if -T is not used to set TOOLDIR, and TOOLDIR is not set in the environment, then nbmake will always be bootstrapped (rather than looking at nbmake's timestamp). This is because /bin/sh doesn't know how to get TOOLDIR from mk.conf without first having nbmake (...which lives in TOOLDIR). * Do a pass of "make obj" through src/tools before installing nbmake (so long as -o/MKOBJDIRS=no is not specified). This ensures that objdirs exist if they are desired, and paves the way for using build.sh to build all the src/tools without building everything else. * Add "-w" option, which allows the builder to specify where the nbmake wrapper shell script should be created. If not specified, $TOOLDIR/bin/nbmake-$MACHINE is still created as a default. * Print the values of DESTDIR and TOOLDIR after bootstrapping nbmake, for informational purposes. It should now be possible to type just "./build.sh" on a NetBSD-current host and get a new build in / for the appropriate architecture. However, building in-place like this has *not* been extensively tested yet, so be careful.
2001-10-31 22:59:43 +03:00
fi
if ${do_build} || ${do_distribution} || ${do_release}; then
if ! ${do_expertmode} && \
[ $(id -u 2>/dev/null) -ne 0 ] && \
[ -z "${MKUNPRIVED}" ] ; then
bomb "-U or -E must be set for build as an unprivileged user."
fi
fi
if ${do_releasekernel} && [ -z "${RELEASEDIR}" ]; then
bomb "Must set RELEASEDIR with \`releasekernel=...'"
fi
Rework how build.sh functions, so that command line options set various parameters, and a list of "operations" defines what to do. The full usage is show below. Notes: `-b' has been deprecated (it always occurs now) `-d' is replaced by "distribution" `-R rel' onlys sets RELEASEDIR; use "release" to build a release `-k kern' has been replaced by "kernel=kern" `-i idir' has been replaced by "install=idir" -r now occurs before nbmake is rebuilt Add a copyright (long due!). Rework the code to (a KNF inspired) ShellNF. Use functions appropriately. Allow `nb' prefix to be easily changed to something else. Solve world peace (just kidding) This is part of the (never achievable) goal of attempting to make NetBSD easier to build... --8<-- new usage follows --8<-- Usage: build.sh [-EnorUu] [-a arch] [-B buildid] [-D dest] [-j njob] [-M obj] [-m mach] [-O obj] [-R release] [-T tools] [-V var=[value]] [-w wrapper] [operation [...] ] System build operations (all imply "obj" and "tools"): build Run "make build" distribution Run "make distribution" (includes etc/ files) release Run "make release" (includes kernels & distrib media) Other operations: obj Run "make obj" (default unless -o) tools Build and install tools kernel=conf Build kernel with config file `conf' install=idir Run "make installworld" to `idir' (useful after 'distribution' or 'release') Options: -a arch Set MACHINE_ARCH to arch (otherwise deduced from MACHINE) -B buildId Set BUILDID to buildId -D dest Set DESTDIR to dest -E Set "expert" mode; disables some DESTDIR checks -j njob Run up to njob jobs in parallel; see make(1) -M obj Set obj root directory to obj (sets MAKEOBJDIRPREFIX) -m mach Set MACHINE to mach (not required if NetBSD native) -n Show commands that would be executed, but do not execute them -O obj Set obj root directory to obj (sets a MAKEOBJDIR pattern) -o Set MKOBJDIRS=no (do not create objdirs at start of build) -R release Set RELEASEDIR to release -r Remove contents of TOOLDIR and DESTDIR before building -T tools Set TOOLDIR to tools. If unset, and TOOLDIR is not set in the environment, nbmake will be (re)built unconditionally. -U Set UNPRIVED -u Set UPDATE -V v=[val] Set variable `v' to `val' -w wrapper Create nbmake script as wrapper (default: ${TOOLDIR}/bin/nbmake-${MACHINE})
2003-01-23 19:24:08 +03:00
}
createmakewrapper()
{
# Remove the target directories.
#
if ${do_removedirs}; then
for f in ${removedirs}; do
statusmsg "Removing ${f}"
${runcmd} rm -r -f "${f}"
Rework how build.sh functions, so that command line options set various parameters, and a list of "operations" defines what to do. The full usage is show below. Notes: `-b' has been deprecated (it always occurs now) `-d' is replaced by "distribution" `-R rel' onlys sets RELEASEDIR; use "release" to build a release `-k kern' has been replaced by "kernel=kern" `-i idir' has been replaced by "install=idir" -r now occurs before nbmake is rebuilt Add a copyright (long due!). Rework the code to (a KNF inspired) ShellNF. Use functions appropriately. Allow `nb' prefix to be easily changed to something else. Solve world peace (just kidding) This is part of the (never achievable) goal of attempting to make NetBSD easier to build... --8<-- new usage follows --8<-- Usage: build.sh [-EnorUu] [-a arch] [-B buildid] [-D dest] [-j njob] [-M obj] [-m mach] [-O obj] [-R release] [-T tools] [-V var=[value]] [-w wrapper] [operation [...] ] System build operations (all imply "obj" and "tools"): build Run "make build" distribution Run "make distribution" (includes etc/ files) release Run "make release" (includes kernels & distrib media) Other operations: obj Run "make obj" (default unless -o) tools Build and install tools kernel=conf Build kernel with config file `conf' install=idir Run "make installworld" to `idir' (useful after 'distribution' or 'release') Options: -a arch Set MACHINE_ARCH to arch (otherwise deduced from MACHINE) -B buildId Set BUILDID to buildId -D dest Set DESTDIR to dest -E Set "expert" mode; disables some DESTDIR checks -j njob Run up to njob jobs in parallel; see make(1) -M obj Set obj root directory to obj (sets MAKEOBJDIRPREFIX) -m mach Set MACHINE to mach (not required if NetBSD native) -n Show commands that would be executed, but do not execute them -O obj Set obj root directory to obj (sets a MAKEOBJDIR pattern) -o Set MKOBJDIRS=no (do not create objdirs at start of build) -R release Set RELEASEDIR to release -r Remove contents of TOOLDIR and DESTDIR before building -T tools Set TOOLDIR to tools. If unset, and TOOLDIR is not set in the environment, nbmake will be (re)built unconditionally. -U Set UNPRIVED -u Set UPDATE -V v=[val] Set variable `v' to `val' -w wrapper Create nbmake script as wrapper (default: ${TOOLDIR}/bin/nbmake-${MACHINE})
2003-01-23 19:24:08 +03:00
done
fi
Rework how build.sh functions, so that command line options set various parameters, and a list of "operations" defines what to do. The full usage is show below. Notes: `-b' has been deprecated (it always occurs now) `-d' is replaced by "distribution" `-R rel' onlys sets RELEASEDIR; use "release" to build a release `-k kern' has been replaced by "kernel=kern" `-i idir' has been replaced by "install=idir" -r now occurs before nbmake is rebuilt Add a copyright (long due!). Rework the code to (a KNF inspired) ShellNF. Use functions appropriately. Allow `nb' prefix to be easily changed to something else. Solve world peace (just kidding) This is part of the (never achievable) goal of attempting to make NetBSD easier to build... --8<-- new usage follows --8<-- Usage: build.sh [-EnorUu] [-a arch] [-B buildid] [-D dest] [-j njob] [-M obj] [-m mach] [-O obj] [-R release] [-T tools] [-V var=[value]] [-w wrapper] [operation [...] ] System build operations (all imply "obj" and "tools"): build Run "make build" distribution Run "make distribution" (includes etc/ files) release Run "make release" (includes kernels & distrib media) Other operations: obj Run "make obj" (default unless -o) tools Build and install tools kernel=conf Build kernel with config file `conf' install=idir Run "make installworld" to `idir' (useful after 'distribution' or 'release') Options: -a arch Set MACHINE_ARCH to arch (otherwise deduced from MACHINE) -B buildId Set BUILDID to buildId -D dest Set DESTDIR to dest -E Set "expert" mode; disables some DESTDIR checks -j njob Run up to njob jobs in parallel; see make(1) -M obj Set obj root directory to obj (sets MAKEOBJDIRPREFIX) -m mach Set MACHINE to mach (not required if NetBSD native) -n Show commands that would be executed, but do not execute them -O obj Set obj root directory to obj (sets a MAKEOBJDIR pattern) -o Set MKOBJDIRS=no (do not create objdirs at start of build) -R release Set RELEASEDIR to release -r Remove contents of TOOLDIR and DESTDIR before building -T tools Set TOOLDIR to tools. If unset, and TOOLDIR is not set in the environment, nbmake will be (re)built unconditionally. -U Set UNPRIVED -u Set UPDATE -V v=[val] Set variable `v' to `val' -w wrapper Create nbmake script as wrapper (default: ${TOOLDIR}/bin/nbmake-${MACHINE})
2003-01-23 19:24:08 +03:00
# Recreate $TOOLDIR.
#
${runcmd} mkdir -p "${TOOLDIR}/bin" ||
bomb "mkdir of '${TOOLDIR}/bin' failed"
Rework how build.sh functions, so that command line options set various parameters, and a list of "operations" defines what to do. The full usage is show below. Notes: `-b' has been deprecated (it always occurs now) `-d' is replaced by "distribution" `-R rel' onlys sets RELEASEDIR; use "release" to build a release `-k kern' has been replaced by "kernel=kern" `-i idir' has been replaced by "install=idir" -r now occurs before nbmake is rebuilt Add a copyright (long due!). Rework the code to (a KNF inspired) ShellNF. Use functions appropriately. Allow `nb' prefix to be easily changed to something else. Solve world peace (just kidding) This is part of the (never achievable) goal of attempting to make NetBSD easier to build... --8<-- new usage follows --8<-- Usage: build.sh [-EnorUu] [-a arch] [-B buildid] [-D dest] [-j njob] [-M obj] [-m mach] [-O obj] [-R release] [-T tools] [-V var=[value]] [-w wrapper] [operation [...] ] System build operations (all imply "obj" and "tools"): build Run "make build" distribution Run "make distribution" (includes etc/ files) release Run "make release" (includes kernels & distrib media) Other operations: obj Run "make obj" (default unless -o) tools Build and install tools kernel=conf Build kernel with config file `conf' install=idir Run "make installworld" to `idir' (useful after 'distribution' or 'release') Options: -a arch Set MACHINE_ARCH to arch (otherwise deduced from MACHINE) -B buildId Set BUILDID to buildId -D dest Set DESTDIR to dest -E Set "expert" mode; disables some DESTDIR checks -j njob Run up to njob jobs in parallel; see make(1) -M obj Set obj root directory to obj (sets MAKEOBJDIRPREFIX) -m mach Set MACHINE to mach (not required if NetBSD native) -n Show commands that would be executed, but do not execute them -O obj Set obj root directory to obj (sets a MAKEOBJDIR pattern) -o Set MKOBJDIRS=no (do not create objdirs at start of build) -R release Set RELEASEDIR to release -r Remove contents of TOOLDIR and DESTDIR before building -T tools Set TOOLDIR to tools. If unset, and TOOLDIR is not set in the environment, nbmake will be (re)built unconditionally. -U Set UNPRIVED -u Set UPDATE -V v=[val] Set variable `v' to `val' -w wrapper Create nbmake script as wrapper (default: ${TOOLDIR}/bin/nbmake-${MACHINE})
2003-01-23 19:24:08 +03:00
# Install ${toolprefix}make if it was built.
#
if ${do_rebuildmake}; then
${runcmd} rm -f "${TOOLDIR}/bin/${toolprefix}make"
${runcmd} cp "${make}" "${TOOLDIR}/bin/${toolprefix}make" ||
bomb "Failed to install \$TOOLDIR/bin/${toolprefix}make"
make="${TOOLDIR}/bin/${toolprefix}make"
statusmsg "Created ${make}"
fi
Rework how build.sh functions, so that command line options set various parameters, and a list of "operations" defines what to do. The full usage is show below. Notes: `-b' has been deprecated (it always occurs now) `-d' is replaced by "distribution" `-R rel' onlys sets RELEASEDIR; use "release" to build a release `-k kern' has been replaced by "kernel=kern" `-i idir' has been replaced by "install=idir" -r now occurs before nbmake is rebuilt Add a copyright (long due!). Rework the code to (a KNF inspired) ShellNF. Use functions appropriately. Allow `nb' prefix to be easily changed to something else. Solve world peace (just kidding) This is part of the (never achievable) goal of attempting to make NetBSD easier to build... --8<-- new usage follows --8<-- Usage: build.sh [-EnorUu] [-a arch] [-B buildid] [-D dest] [-j njob] [-M obj] [-m mach] [-O obj] [-R release] [-T tools] [-V var=[value]] [-w wrapper] [operation [...] ] System build operations (all imply "obj" and "tools"): build Run "make build" distribution Run "make distribution" (includes etc/ files) release Run "make release" (includes kernels & distrib media) Other operations: obj Run "make obj" (default unless -o) tools Build and install tools kernel=conf Build kernel with config file `conf' install=idir Run "make installworld" to `idir' (useful after 'distribution' or 'release') Options: -a arch Set MACHINE_ARCH to arch (otherwise deduced from MACHINE) -B buildId Set BUILDID to buildId -D dest Set DESTDIR to dest -E Set "expert" mode; disables some DESTDIR checks -j njob Run up to njob jobs in parallel; see make(1) -M obj Set obj root directory to obj (sets MAKEOBJDIRPREFIX) -m mach Set MACHINE to mach (not required if NetBSD native) -n Show commands that would be executed, but do not execute them -O obj Set obj root directory to obj (sets a MAKEOBJDIR pattern) -o Set MKOBJDIRS=no (do not create objdirs at start of build) -R release Set RELEASEDIR to release -r Remove contents of TOOLDIR and DESTDIR before building -T tools Set TOOLDIR to tools. If unset, and TOOLDIR is not set in the environment, nbmake will be (re)built unconditionally. -U Set UNPRIVED -u Set UPDATE -V v=[val] Set variable `v' to `val' -w wrapper Create nbmake script as wrapper (default: ${TOOLDIR}/bin/nbmake-${MACHINE})
2003-01-23 19:24:08 +03:00
# Build a ${toolprefix}make wrapper script, usable by hand as
# well as by build.sh.
#
if [ -z "${makewrapper}" ]; then
makewrapper="${TOOLDIR}/bin/${toolprefix}make-${makewrappermachine:-${MACHINE}}"
[ -z "${BUILDID}" ] || makewrapper="${makewrapper}-${BUILDID}"
Rework how build.sh functions, so that command line options set various parameters, and a list of "operations" defines what to do. The full usage is show below. Notes: `-b' has been deprecated (it always occurs now) `-d' is replaced by "distribution" `-R rel' onlys sets RELEASEDIR; use "release" to build a release `-k kern' has been replaced by "kernel=kern" `-i idir' has been replaced by "install=idir" -r now occurs before nbmake is rebuilt Add a copyright (long due!). Rework the code to (a KNF inspired) ShellNF. Use functions appropriately. Allow `nb' prefix to be easily changed to something else. Solve world peace (just kidding) This is part of the (never achievable) goal of attempting to make NetBSD easier to build... --8<-- new usage follows --8<-- Usage: build.sh [-EnorUu] [-a arch] [-B buildid] [-D dest] [-j njob] [-M obj] [-m mach] [-O obj] [-R release] [-T tools] [-V var=[value]] [-w wrapper] [operation [...] ] System build operations (all imply "obj" and "tools"): build Run "make build" distribution Run "make distribution" (includes etc/ files) release Run "make release" (includes kernels & distrib media) Other operations: obj Run "make obj" (default unless -o) tools Build and install tools kernel=conf Build kernel with config file `conf' install=idir Run "make installworld" to `idir' (useful after 'distribution' or 'release') Options: -a arch Set MACHINE_ARCH to arch (otherwise deduced from MACHINE) -B buildId Set BUILDID to buildId -D dest Set DESTDIR to dest -E Set "expert" mode; disables some DESTDIR checks -j njob Run up to njob jobs in parallel; see make(1) -M obj Set obj root directory to obj (sets MAKEOBJDIRPREFIX) -m mach Set MACHINE to mach (not required if NetBSD native) -n Show commands that would be executed, but do not execute them -O obj Set obj root directory to obj (sets a MAKEOBJDIR pattern) -o Set MKOBJDIRS=no (do not create objdirs at start of build) -R release Set RELEASEDIR to release -r Remove contents of TOOLDIR and DESTDIR before building -T tools Set TOOLDIR to tools. If unset, and TOOLDIR is not set in the environment, nbmake will be (re)built unconditionally. -U Set UNPRIVED -u Set UPDATE -V v=[val] Set variable `v' to `val' -w wrapper Create nbmake script as wrapper (default: ${TOOLDIR}/bin/nbmake-${MACHINE})
2003-01-23 19:24:08 +03:00
fi
${runcmd} rm -f "${makewrapper}"
if [ "${runcmd}" = "echo" ]; then
echo 'cat <<EOF >'${makewrapper}
Rework how build.sh functions, so that command line options set various parameters, and a list of "operations" defines what to do. The full usage is show below. Notes: `-b' has been deprecated (it always occurs now) `-d' is replaced by "distribution" `-R rel' onlys sets RELEASEDIR; use "release" to build a release `-k kern' has been replaced by "kernel=kern" `-i idir' has been replaced by "install=idir" -r now occurs before nbmake is rebuilt Add a copyright (long due!). Rework the code to (a KNF inspired) ShellNF. Use functions appropriately. Allow `nb' prefix to be easily changed to something else. Solve world peace (just kidding) This is part of the (never achievable) goal of attempting to make NetBSD easier to build... --8<-- new usage follows --8<-- Usage: build.sh [-EnorUu] [-a arch] [-B buildid] [-D dest] [-j njob] [-M obj] [-m mach] [-O obj] [-R release] [-T tools] [-V var=[value]] [-w wrapper] [operation [...] ] System build operations (all imply "obj" and "tools"): build Run "make build" distribution Run "make distribution" (includes etc/ files) release Run "make release" (includes kernels & distrib media) Other operations: obj Run "make obj" (default unless -o) tools Build and install tools kernel=conf Build kernel with config file `conf' install=idir Run "make installworld" to `idir' (useful after 'distribution' or 'release') Options: -a arch Set MACHINE_ARCH to arch (otherwise deduced from MACHINE) -B buildId Set BUILDID to buildId -D dest Set DESTDIR to dest -E Set "expert" mode; disables some DESTDIR checks -j njob Run up to njob jobs in parallel; see make(1) -M obj Set obj root directory to obj (sets MAKEOBJDIRPREFIX) -m mach Set MACHINE to mach (not required if NetBSD native) -n Show commands that would be executed, but do not execute them -O obj Set obj root directory to obj (sets a MAKEOBJDIR pattern) -o Set MKOBJDIRS=no (do not create objdirs at start of build) -R release Set RELEASEDIR to release -r Remove contents of TOOLDIR and DESTDIR before building -T tools Set TOOLDIR to tools. If unset, and TOOLDIR is not set in the environment, nbmake will be (re)built unconditionally. -U Set UNPRIVED -u Set UPDATE -V v=[val] Set variable `v' to `val' -w wrapper Create nbmake script as wrapper (default: ${TOOLDIR}/bin/nbmake-${MACHINE})
2003-01-23 19:24:08 +03:00
makewrapout=
else
makewrapout=">>\${makewrapper}"
Rework how build.sh functions, so that command line options set various parameters, and a list of "operations" defines what to do. The full usage is show below. Notes: `-b' has been deprecated (it always occurs now) `-d' is replaced by "distribution" `-R rel' onlys sets RELEASEDIR; use "release" to build a release `-k kern' has been replaced by "kernel=kern" `-i idir' has been replaced by "install=idir" -r now occurs before nbmake is rebuilt Add a copyright (long due!). Rework the code to (a KNF inspired) ShellNF. Use functions appropriately. Allow `nb' prefix to be easily changed to something else. Solve world peace (just kidding) This is part of the (never achievable) goal of attempting to make NetBSD easier to build... --8<-- new usage follows --8<-- Usage: build.sh [-EnorUu] [-a arch] [-B buildid] [-D dest] [-j njob] [-M obj] [-m mach] [-O obj] [-R release] [-T tools] [-V var=[value]] [-w wrapper] [operation [...] ] System build operations (all imply "obj" and "tools"): build Run "make build" distribution Run "make distribution" (includes etc/ files) release Run "make release" (includes kernels & distrib media) Other operations: obj Run "make obj" (default unless -o) tools Build and install tools kernel=conf Build kernel with config file `conf' install=idir Run "make installworld" to `idir' (useful after 'distribution' or 'release') Options: -a arch Set MACHINE_ARCH to arch (otherwise deduced from MACHINE) -B buildId Set BUILDID to buildId -D dest Set DESTDIR to dest -E Set "expert" mode; disables some DESTDIR checks -j njob Run up to njob jobs in parallel; see make(1) -M obj Set obj root directory to obj (sets MAKEOBJDIRPREFIX) -m mach Set MACHINE to mach (not required if NetBSD native) -n Show commands that would be executed, but do not execute them -O obj Set obj root directory to obj (sets a MAKEOBJDIR pattern) -o Set MKOBJDIRS=no (do not create objdirs at start of build) -R release Set RELEASEDIR to release -r Remove contents of TOOLDIR and DESTDIR before building -T tools Set TOOLDIR to tools. If unset, and TOOLDIR is not set in the environment, nbmake will be (re)built unconditionally. -U Set UNPRIVED -u Set UPDATE -V v=[val] Set variable `v' to `val' -w wrapper Create nbmake script as wrapper (default: ${TOOLDIR}/bin/nbmake-${MACHINE})
2003-01-23 19:24:08 +03:00
fi
eval cat <<EOF ${makewrapout}
#! /bin/sh
# Set proper variables to allow easy "make" building of a NetBSD subtree.
# Generated from: \$NetBSD: build.sh,v 1.115 2003/09/10 18:05:52 jmmv Exp $
#
EOF
for f in ${makeenv}; do
if eval "[ -z \"\${$f}\" -a \"\${${f}-X}\" = \"X\" ]"; then
eval echo "unset ${f}" ${makewrapout}
else
eval echo "${f}=\'\$$(echo ${f})\'\;\ export\ ${f}" ${makewrapout}
fi
Rework how build.sh functions, so that command line options set various parameters, and a list of "operations" defines what to do. The full usage is show below. Notes: `-b' has been deprecated (it always occurs now) `-d' is replaced by "distribution" `-R rel' onlys sets RELEASEDIR; use "release" to build a release `-k kern' has been replaced by "kernel=kern" `-i idir' has been replaced by "install=idir" -r now occurs before nbmake is rebuilt Add a copyright (long due!). Rework the code to (a KNF inspired) ShellNF. Use functions appropriately. Allow `nb' prefix to be easily changed to something else. Solve world peace (just kidding) This is part of the (never achievable) goal of attempting to make NetBSD easier to build... --8<-- new usage follows --8<-- Usage: build.sh [-EnorUu] [-a arch] [-B buildid] [-D dest] [-j njob] [-M obj] [-m mach] [-O obj] [-R release] [-T tools] [-V var=[value]] [-w wrapper] [operation [...] ] System build operations (all imply "obj" and "tools"): build Run "make build" distribution Run "make distribution" (includes etc/ files) release Run "make release" (includes kernels & distrib media) Other operations: obj Run "make obj" (default unless -o) tools Build and install tools kernel=conf Build kernel with config file `conf' install=idir Run "make installworld" to `idir' (useful after 'distribution' or 'release') Options: -a arch Set MACHINE_ARCH to arch (otherwise deduced from MACHINE) -B buildId Set BUILDID to buildId -D dest Set DESTDIR to dest -E Set "expert" mode; disables some DESTDIR checks -j njob Run up to njob jobs in parallel; see make(1) -M obj Set obj root directory to obj (sets MAKEOBJDIRPREFIX) -m mach Set MACHINE to mach (not required if NetBSD native) -n Show commands that would be executed, but do not execute them -O obj Set obj root directory to obj (sets a MAKEOBJDIR pattern) -o Set MKOBJDIRS=no (do not create objdirs at start of build) -R release Set RELEASEDIR to release -r Remove contents of TOOLDIR and DESTDIR before building -T tools Set TOOLDIR to tools. If unset, and TOOLDIR is not set in the environment, nbmake will be (re)built unconditionally. -U Set UNPRIVED -u Set UPDATE -V v=[val] Set variable `v' to `val' -w wrapper Create nbmake script as wrapper (default: ${TOOLDIR}/bin/nbmake-${MACHINE})
2003-01-23 19:24:08 +03:00
done
eval echo "USETOOLS=yes\; export USETOOLS" ${makewrapout}
eval cat <<EOF ${makewrapout}
exec "\${TOOLDIR}/bin/${toolprefix}make" \${1+"\$@"}
EOF
[ "${runcmd}" = "echo" ] && echo EOF
${runcmd} chmod +x "${makewrapper}"
statusmsg "makewrapper: ${makewrapper}"
statusmsg "Updated ${makewrapper}"
Rework how build.sh functions, so that command line options set various parameters, and a list of "operations" defines what to do. The full usage is show below. Notes: `-b' has been deprecated (it always occurs now) `-d' is replaced by "distribution" `-R rel' onlys sets RELEASEDIR; use "release" to build a release `-k kern' has been replaced by "kernel=kern" `-i idir' has been replaced by "install=idir" -r now occurs before nbmake is rebuilt Add a copyright (long due!). Rework the code to (a KNF inspired) ShellNF. Use functions appropriately. Allow `nb' prefix to be easily changed to something else. Solve world peace (just kidding) This is part of the (never achievable) goal of attempting to make NetBSD easier to build... --8<-- new usage follows --8<-- Usage: build.sh [-EnorUu] [-a arch] [-B buildid] [-D dest] [-j njob] [-M obj] [-m mach] [-O obj] [-R release] [-T tools] [-V var=[value]] [-w wrapper] [operation [...] ] System build operations (all imply "obj" and "tools"): build Run "make build" distribution Run "make distribution" (includes etc/ files) release Run "make release" (includes kernels & distrib media) Other operations: obj Run "make obj" (default unless -o) tools Build and install tools kernel=conf Build kernel with config file `conf' install=idir Run "make installworld" to `idir' (useful after 'distribution' or 'release') Options: -a arch Set MACHINE_ARCH to arch (otherwise deduced from MACHINE) -B buildId Set BUILDID to buildId -D dest Set DESTDIR to dest -E Set "expert" mode; disables some DESTDIR checks -j njob Run up to njob jobs in parallel; see make(1) -M obj Set obj root directory to obj (sets MAKEOBJDIRPREFIX) -m mach Set MACHINE to mach (not required if NetBSD native) -n Show commands that would be executed, but do not execute them -O obj Set obj root directory to obj (sets a MAKEOBJDIR pattern) -o Set MKOBJDIRS=no (do not create objdirs at start of build) -R release Set RELEASEDIR to release -r Remove contents of TOOLDIR and DESTDIR before building -T tools Set TOOLDIR to tools. If unset, and TOOLDIR is not set in the environment, nbmake will be (re)built unconditionally. -U Set UNPRIVED -u Set UPDATE -V v=[val] Set variable `v' to `val' -w wrapper Create nbmake script as wrapper (default: ${TOOLDIR}/bin/nbmake-${MACHINE})
2003-01-23 19:24:08 +03:00
}
buildtools()
{
if [ "${MKOBJDIRS}" != "no" ]; then
${runcmd} "${makewrapper}" ${parallel} obj-tools ||
bomb "Failed to make obj-tools"
fi
${runcmd} cd tools
if [ -z "${MKUPDATE}" ]; then
Rework how build.sh functions, so that command line options set various parameters, and a list of "operations" defines what to do. The full usage is show below. Notes: `-b' has been deprecated (it always occurs now) `-d' is replaced by "distribution" `-R rel' onlys sets RELEASEDIR; use "release" to build a release `-k kern' has been replaced by "kernel=kern" `-i idir' has been replaced by "install=idir" -r now occurs before nbmake is rebuilt Add a copyright (long due!). Rework the code to (a KNF inspired) ShellNF. Use functions appropriately. Allow `nb' prefix to be easily changed to something else. Solve world peace (just kidding) This is part of the (never achievable) goal of attempting to make NetBSD easier to build... --8<-- new usage follows --8<-- Usage: build.sh [-EnorUu] [-a arch] [-B buildid] [-D dest] [-j njob] [-M obj] [-m mach] [-O obj] [-R release] [-T tools] [-V var=[value]] [-w wrapper] [operation [...] ] System build operations (all imply "obj" and "tools"): build Run "make build" distribution Run "make distribution" (includes etc/ files) release Run "make release" (includes kernels & distrib media) Other operations: obj Run "make obj" (default unless -o) tools Build and install tools kernel=conf Build kernel with config file `conf' install=idir Run "make installworld" to `idir' (useful after 'distribution' or 'release') Options: -a arch Set MACHINE_ARCH to arch (otherwise deduced from MACHINE) -B buildId Set BUILDID to buildId -D dest Set DESTDIR to dest -E Set "expert" mode; disables some DESTDIR checks -j njob Run up to njob jobs in parallel; see make(1) -M obj Set obj root directory to obj (sets MAKEOBJDIRPREFIX) -m mach Set MACHINE to mach (not required if NetBSD native) -n Show commands that would be executed, but do not execute them -O obj Set obj root directory to obj (sets a MAKEOBJDIR pattern) -o Set MKOBJDIRS=no (do not create objdirs at start of build) -R release Set RELEASEDIR to release -r Remove contents of TOOLDIR and DESTDIR before building -T tools Set TOOLDIR to tools. If unset, and TOOLDIR is not set in the environment, nbmake will be (re)built unconditionally. -U Set UNPRIVED -u Set UPDATE -V v=[val] Set variable `v' to `val' -w wrapper Create nbmake script as wrapper (default: ${TOOLDIR}/bin/nbmake-${MACHINE})
2003-01-23 19:24:08 +03:00
cleandir=cleandir
else
cleandir=
fi
${runcmd} "${makewrapper}" ${cleandir} dependall install ||
bomb "Failed to make tools"
statusmsg "Tools built to ${TOOLDIR}"
${runcmd} cd "${TOP}"
Rework how build.sh functions, so that command line options set various parameters, and a list of "operations" defines what to do. The full usage is show below. Notes: `-b' has been deprecated (it always occurs now) `-d' is replaced by "distribution" `-R rel' onlys sets RELEASEDIR; use "release" to build a release `-k kern' has been replaced by "kernel=kern" `-i idir' has been replaced by "install=idir" -r now occurs before nbmake is rebuilt Add a copyright (long due!). Rework the code to (a KNF inspired) ShellNF. Use functions appropriately. Allow `nb' prefix to be easily changed to something else. Solve world peace (just kidding) This is part of the (never achievable) goal of attempting to make NetBSD easier to build... --8<-- new usage follows --8<-- Usage: build.sh [-EnorUu] [-a arch] [-B buildid] [-D dest] [-j njob] [-M obj] [-m mach] [-O obj] [-R release] [-T tools] [-V var=[value]] [-w wrapper] [operation [...] ] System build operations (all imply "obj" and "tools"): build Run "make build" distribution Run "make distribution" (includes etc/ files) release Run "make release" (includes kernels & distrib media) Other operations: obj Run "make obj" (default unless -o) tools Build and install tools kernel=conf Build kernel with config file `conf' install=idir Run "make installworld" to `idir' (useful after 'distribution' or 'release') Options: -a arch Set MACHINE_ARCH to arch (otherwise deduced from MACHINE) -B buildId Set BUILDID to buildId -D dest Set DESTDIR to dest -E Set "expert" mode; disables some DESTDIR checks -j njob Run up to njob jobs in parallel; see make(1) -M obj Set obj root directory to obj (sets MAKEOBJDIRPREFIX) -m mach Set MACHINE to mach (not required if NetBSD native) -n Show commands that would be executed, but do not execute them -O obj Set obj root directory to obj (sets a MAKEOBJDIR pattern) -o Set MKOBJDIRS=no (do not create objdirs at start of build) -R release Set RELEASEDIR to release -r Remove contents of TOOLDIR and DESTDIR before building -T tools Set TOOLDIR to tools. If unset, and TOOLDIR is not set in the environment, nbmake will be (re)built unconditionally. -U Set UNPRIVED -u Set UPDATE -V v=[val] Set variable `v' to `val' -w wrapper Create nbmake script as wrapper (default: ${TOOLDIR}/bin/nbmake-${MACHINE})
2003-01-23 19:24:08 +03:00
}
getkernelconf()
Rework how build.sh functions, so that command line options set various parameters, and a list of "operations" defines what to do. The full usage is show below. Notes: `-b' has been deprecated (it always occurs now) `-d' is replaced by "distribution" `-R rel' onlys sets RELEASEDIR; use "release" to build a release `-k kern' has been replaced by "kernel=kern" `-i idir' has been replaced by "install=idir" -r now occurs before nbmake is rebuilt Add a copyright (long due!). Rework the code to (a KNF inspired) ShellNF. Use functions appropriately. Allow `nb' prefix to be easily changed to something else. Solve world peace (just kidding) This is part of the (never achievable) goal of attempting to make NetBSD easier to build... --8<-- new usage follows --8<-- Usage: build.sh [-EnorUu] [-a arch] [-B buildid] [-D dest] [-j njob] [-M obj] [-m mach] [-O obj] [-R release] [-T tools] [-V var=[value]] [-w wrapper] [operation [...] ] System build operations (all imply "obj" and "tools"): build Run "make build" distribution Run "make distribution" (includes etc/ files) release Run "make release" (includes kernels & distrib media) Other operations: obj Run "make obj" (default unless -o) tools Build and install tools kernel=conf Build kernel with config file `conf' install=idir Run "make installworld" to `idir' (useful after 'distribution' or 'release') Options: -a arch Set MACHINE_ARCH to arch (otherwise deduced from MACHINE) -B buildId Set BUILDID to buildId -D dest Set DESTDIR to dest -E Set "expert" mode; disables some DESTDIR checks -j njob Run up to njob jobs in parallel; see make(1) -M obj Set obj root directory to obj (sets MAKEOBJDIRPREFIX) -m mach Set MACHINE to mach (not required if NetBSD native) -n Show commands that would be executed, but do not execute them -O obj Set obj root directory to obj (sets a MAKEOBJDIR pattern) -o Set MKOBJDIRS=no (do not create objdirs at start of build) -R release Set RELEASEDIR to release -r Remove contents of TOOLDIR and DESTDIR before building -T tools Set TOOLDIR to tools. If unset, and TOOLDIR is not set in the environment, nbmake will be (re)built unconditionally. -U Set UNPRIVED -u Set UPDATE -V v=[val] Set variable `v' to `val' -w wrapper Create nbmake script as wrapper (default: ${TOOLDIR}/bin/nbmake-${MACHINE})
2003-01-23 19:24:08 +03:00
{
kernelconf="$1"
if [ "${MKOBJDIRS}" != "no" ]; then
Rework how build.sh functions, so that command line options set various parameters, and a list of "operations" defines what to do. The full usage is show below. Notes: `-b' has been deprecated (it always occurs now) `-d' is replaced by "distribution" `-R rel' onlys sets RELEASEDIR; use "release" to build a release `-k kern' has been replaced by "kernel=kern" `-i idir' has been replaced by "install=idir" -r now occurs before nbmake is rebuilt Add a copyright (long due!). Rework the code to (a KNF inspired) ShellNF. Use functions appropriately. Allow `nb' prefix to be easily changed to something else. Solve world peace (just kidding) This is part of the (never achievable) goal of attempting to make NetBSD easier to build... --8<-- new usage follows --8<-- Usage: build.sh [-EnorUu] [-a arch] [-B buildid] [-D dest] [-j njob] [-M obj] [-m mach] [-O obj] [-R release] [-T tools] [-V var=[value]] [-w wrapper] [operation [...] ] System build operations (all imply "obj" and "tools"): build Run "make build" distribution Run "make distribution" (includes etc/ files) release Run "make release" (includes kernels & distrib media) Other operations: obj Run "make obj" (default unless -o) tools Build and install tools kernel=conf Build kernel with config file `conf' install=idir Run "make installworld" to `idir' (useful after 'distribution' or 'release') Options: -a arch Set MACHINE_ARCH to arch (otherwise deduced from MACHINE) -B buildId Set BUILDID to buildId -D dest Set DESTDIR to dest -E Set "expert" mode; disables some DESTDIR checks -j njob Run up to njob jobs in parallel; see make(1) -M obj Set obj root directory to obj (sets MAKEOBJDIRPREFIX) -m mach Set MACHINE to mach (not required if NetBSD native) -n Show commands that would be executed, but do not execute them -O obj Set obj root directory to obj (sets a MAKEOBJDIR pattern) -o Set MKOBJDIRS=no (do not create objdirs at start of build) -R release Set RELEASEDIR to release -r Remove contents of TOOLDIR and DESTDIR before building -T tools Set TOOLDIR to tools. If unset, and TOOLDIR is not set in the environment, nbmake will be (re)built unconditionally. -U Set UNPRIVED -u Set UPDATE -V v=[val] Set variable `v' to `val' -w wrapper Create nbmake script as wrapper (default: ${TOOLDIR}/bin/nbmake-${MACHINE})
2003-01-23 19:24:08 +03:00
# The correct value of KERNOBJDIR might
# depend on a prior "make obj" in
# ${KERNSRCDIR}/${KERNARCHDIR}/compile.
#
KERNSRCDIR="$(getmakevar KERNSRCDIR)"
KERNARCHDIR="$(getmakevar KERNARCHDIR)"
${runcmd} cd "${KERNSRCDIR}/${KERNARCHDIR}/compile"
${runcmd} "${makewrapper}" obj ||
bomb "Failed to make obj in ${KERNSRCDIR}/${KERNARCHDIR}/compile"
${runcmd} cd "${TOP}"
Rework how build.sh functions, so that command line options set various parameters, and a list of "operations" defines what to do. The full usage is show below. Notes: `-b' has been deprecated (it always occurs now) `-d' is replaced by "distribution" `-R rel' onlys sets RELEASEDIR; use "release" to build a release `-k kern' has been replaced by "kernel=kern" `-i idir' has been replaced by "install=idir" -r now occurs before nbmake is rebuilt Add a copyright (long due!). Rework the code to (a KNF inspired) ShellNF. Use functions appropriately. Allow `nb' prefix to be easily changed to something else. Solve world peace (just kidding) This is part of the (never achievable) goal of attempting to make NetBSD easier to build... --8<-- new usage follows --8<-- Usage: build.sh [-EnorUu] [-a arch] [-B buildid] [-D dest] [-j njob] [-M obj] [-m mach] [-O obj] [-R release] [-T tools] [-V var=[value]] [-w wrapper] [operation [...] ] System build operations (all imply "obj" and "tools"): build Run "make build" distribution Run "make distribution" (includes etc/ files) release Run "make release" (includes kernels & distrib media) Other operations: obj Run "make obj" (default unless -o) tools Build and install tools kernel=conf Build kernel with config file `conf' install=idir Run "make installworld" to `idir' (useful after 'distribution' or 'release') Options: -a arch Set MACHINE_ARCH to arch (otherwise deduced from MACHINE) -B buildId Set BUILDID to buildId -D dest Set DESTDIR to dest -E Set "expert" mode; disables some DESTDIR checks -j njob Run up to njob jobs in parallel; see make(1) -M obj Set obj root directory to obj (sets MAKEOBJDIRPREFIX) -m mach Set MACHINE to mach (not required if NetBSD native) -n Show commands that would be executed, but do not execute them -O obj Set obj root directory to obj (sets a MAKEOBJDIR pattern) -o Set MKOBJDIRS=no (do not create objdirs at start of build) -R release Set RELEASEDIR to release -r Remove contents of TOOLDIR and DESTDIR before building -T tools Set TOOLDIR to tools. If unset, and TOOLDIR is not set in the environment, nbmake will be (re)built unconditionally. -U Set UNPRIVED -u Set UPDATE -V v=[val] Set variable `v' to `val' -w wrapper Create nbmake script as wrapper (default: ${TOOLDIR}/bin/nbmake-${MACHINE})
2003-01-23 19:24:08 +03:00
fi
KERNCONFDIR="$(getmakevar KERNCONFDIR)"
KERNOBJDIR="$(getmakevar KERNOBJDIR)"
case "${kernelconf}" in
Rework how build.sh functions, so that command line options set various parameters, and a list of "operations" defines what to do. The full usage is show below. Notes: `-b' has been deprecated (it always occurs now) `-d' is replaced by "distribution" `-R rel' onlys sets RELEASEDIR; use "release" to build a release `-k kern' has been replaced by "kernel=kern" `-i idir' has been replaced by "install=idir" -r now occurs before nbmake is rebuilt Add a copyright (long due!). Rework the code to (a KNF inspired) ShellNF. Use functions appropriately. Allow `nb' prefix to be easily changed to something else. Solve world peace (just kidding) This is part of the (never achievable) goal of attempting to make NetBSD easier to build... --8<-- new usage follows --8<-- Usage: build.sh [-EnorUu] [-a arch] [-B buildid] [-D dest] [-j njob] [-M obj] [-m mach] [-O obj] [-R release] [-T tools] [-V var=[value]] [-w wrapper] [operation [...] ] System build operations (all imply "obj" and "tools"): build Run "make build" distribution Run "make distribution" (includes etc/ files) release Run "make release" (includes kernels & distrib media) Other operations: obj Run "make obj" (default unless -o) tools Build and install tools kernel=conf Build kernel with config file `conf' install=idir Run "make installworld" to `idir' (useful after 'distribution' or 'release') Options: -a arch Set MACHINE_ARCH to arch (otherwise deduced from MACHINE) -B buildId Set BUILDID to buildId -D dest Set DESTDIR to dest -E Set "expert" mode; disables some DESTDIR checks -j njob Run up to njob jobs in parallel; see make(1) -M obj Set obj root directory to obj (sets MAKEOBJDIRPREFIX) -m mach Set MACHINE to mach (not required if NetBSD native) -n Show commands that would be executed, but do not execute them -O obj Set obj root directory to obj (sets a MAKEOBJDIR pattern) -o Set MKOBJDIRS=no (do not create objdirs at start of build) -R release Set RELEASEDIR to release -r Remove contents of TOOLDIR and DESTDIR before building -T tools Set TOOLDIR to tools. If unset, and TOOLDIR is not set in the environment, nbmake will be (re)built unconditionally. -U Set UNPRIVED -u Set UPDATE -V v=[val] Set variable `v' to `val' -w wrapper Create nbmake script as wrapper (default: ${TOOLDIR}/bin/nbmake-${MACHINE})
2003-01-23 19:24:08 +03:00
*/*)
kernelconfpath="${kernelconf}"
kernelconfname="${kernelconf##*/}"
Rework how build.sh functions, so that command line options set various parameters, and a list of "operations" defines what to do. The full usage is show below. Notes: `-b' has been deprecated (it always occurs now) `-d' is replaced by "distribution" `-R rel' onlys sets RELEASEDIR; use "release" to build a release `-k kern' has been replaced by "kernel=kern" `-i idir' has been replaced by "install=idir" -r now occurs before nbmake is rebuilt Add a copyright (long due!). Rework the code to (a KNF inspired) ShellNF. Use functions appropriately. Allow `nb' prefix to be easily changed to something else. Solve world peace (just kidding) This is part of the (never achievable) goal of attempting to make NetBSD easier to build... --8<-- new usage follows --8<-- Usage: build.sh [-EnorUu] [-a arch] [-B buildid] [-D dest] [-j njob] [-M obj] [-m mach] [-O obj] [-R release] [-T tools] [-V var=[value]] [-w wrapper] [operation [...] ] System build operations (all imply "obj" and "tools"): build Run "make build" distribution Run "make distribution" (includes etc/ files) release Run "make release" (includes kernels & distrib media) Other operations: obj Run "make obj" (default unless -o) tools Build and install tools kernel=conf Build kernel with config file `conf' install=idir Run "make installworld" to `idir' (useful after 'distribution' or 'release') Options: -a arch Set MACHINE_ARCH to arch (otherwise deduced from MACHINE) -B buildId Set BUILDID to buildId -D dest Set DESTDIR to dest -E Set "expert" mode; disables some DESTDIR checks -j njob Run up to njob jobs in parallel; see make(1) -M obj Set obj root directory to obj (sets MAKEOBJDIRPREFIX) -m mach Set MACHINE to mach (not required if NetBSD native) -n Show commands that would be executed, but do not execute them -O obj Set obj root directory to obj (sets a MAKEOBJDIR pattern) -o Set MKOBJDIRS=no (do not create objdirs at start of build) -R release Set RELEASEDIR to release -r Remove contents of TOOLDIR and DESTDIR before building -T tools Set TOOLDIR to tools. If unset, and TOOLDIR is not set in the environment, nbmake will be (re)built unconditionally. -U Set UNPRIVED -u Set UPDATE -V v=[val] Set variable `v' to `val' -w wrapper Create nbmake script as wrapper (default: ${TOOLDIR}/bin/nbmake-${MACHINE})
2003-01-23 19:24:08 +03:00
;;
*)
kernelconfpath="${KERNCONFDIR}/${kernelconf}"
kernelconfname="${kernelconf}"
Rework how build.sh functions, so that command line options set various parameters, and a list of "operations" defines what to do. The full usage is show below. Notes: `-b' has been deprecated (it always occurs now) `-d' is replaced by "distribution" `-R rel' onlys sets RELEASEDIR; use "release" to build a release `-k kern' has been replaced by "kernel=kern" `-i idir' has been replaced by "install=idir" -r now occurs before nbmake is rebuilt Add a copyright (long due!). Rework the code to (a KNF inspired) ShellNF. Use functions appropriately. Allow `nb' prefix to be easily changed to something else. Solve world peace (just kidding) This is part of the (never achievable) goal of attempting to make NetBSD easier to build... --8<-- new usage follows --8<-- Usage: build.sh [-EnorUu] [-a arch] [-B buildid] [-D dest] [-j njob] [-M obj] [-m mach] [-O obj] [-R release] [-T tools] [-V var=[value]] [-w wrapper] [operation [...] ] System build operations (all imply "obj" and "tools"): build Run "make build" distribution Run "make distribution" (includes etc/ files) release Run "make release" (includes kernels & distrib media) Other operations: obj Run "make obj" (default unless -o) tools Build and install tools kernel=conf Build kernel with config file `conf' install=idir Run "make installworld" to `idir' (useful after 'distribution' or 'release') Options: -a arch Set MACHINE_ARCH to arch (otherwise deduced from MACHINE) -B buildId Set BUILDID to buildId -D dest Set DESTDIR to dest -E Set "expert" mode; disables some DESTDIR checks -j njob Run up to njob jobs in parallel; see make(1) -M obj Set obj root directory to obj (sets MAKEOBJDIRPREFIX) -m mach Set MACHINE to mach (not required if NetBSD native) -n Show commands that would be executed, but do not execute them -O obj Set obj root directory to obj (sets a MAKEOBJDIR pattern) -o Set MKOBJDIRS=no (do not create objdirs at start of build) -R release Set RELEASEDIR to release -r Remove contents of TOOLDIR and DESTDIR before building -T tools Set TOOLDIR to tools. If unset, and TOOLDIR is not set in the environment, nbmake will be (re)built unconditionally. -U Set UNPRIVED -u Set UPDATE -V v=[val] Set variable `v' to `val' -w wrapper Create nbmake script as wrapper (default: ${TOOLDIR}/bin/nbmake-${MACHINE})
2003-01-23 19:24:08 +03:00
;;
esac
kernelbuildpath="${KERNOBJDIR}/${kernelconfname}"
}
buildkernel()
{
if ! ${do_tools} && ! ${buildkernelwarned:-false}; then
# Building tools every time we build a kernel is clearly
# unnecessary. We could try to figure out whether rebuilding
# the tools is necessary this time, but it doesn't seem worth
# the trouble. Instead, we say it's the user's responsibility
# to rebuild the tools if necessary.
#
statusmsg "Building kernel without building new tools"
buildkernelwarned=true
fi
getkernelconf $1
statusmsg "Building kernel: ${kernelconf}"
statusmsg "Build directory: ${kernelbuildpath}"
${runcmd} mkdir -p "${kernelbuildpath}" ||
bomb "Cannot mkdir: ${kernelbuildpath}"
if [ -z "${MKUPDATE}" ]; then
${runcmd} cd "${kernelbuildpath}"
${runcmd} "${makewrapper}" cleandir ||
bomb "Failed to make cleandir in ${kernelbuildpath}"
${runcmd} cd "${TOP}"
Rework how build.sh functions, so that command line options set various parameters, and a list of "operations" defines what to do. The full usage is show below. Notes: `-b' has been deprecated (it always occurs now) `-d' is replaced by "distribution" `-R rel' onlys sets RELEASEDIR; use "release" to build a release `-k kern' has been replaced by "kernel=kern" `-i idir' has been replaced by "install=idir" -r now occurs before nbmake is rebuilt Add a copyright (long due!). Rework the code to (a KNF inspired) ShellNF. Use functions appropriately. Allow `nb' prefix to be easily changed to something else. Solve world peace (just kidding) This is part of the (never achievable) goal of attempting to make NetBSD easier to build... --8<-- new usage follows --8<-- Usage: build.sh [-EnorUu] [-a arch] [-B buildid] [-D dest] [-j njob] [-M obj] [-m mach] [-O obj] [-R release] [-T tools] [-V var=[value]] [-w wrapper] [operation [...] ] System build operations (all imply "obj" and "tools"): build Run "make build" distribution Run "make distribution" (includes etc/ files) release Run "make release" (includes kernels & distrib media) Other operations: obj Run "make obj" (default unless -o) tools Build and install tools kernel=conf Build kernel with config file `conf' install=idir Run "make installworld" to `idir' (useful after 'distribution' or 'release') Options: -a arch Set MACHINE_ARCH to arch (otherwise deduced from MACHINE) -B buildId Set BUILDID to buildId -D dest Set DESTDIR to dest -E Set "expert" mode; disables some DESTDIR checks -j njob Run up to njob jobs in parallel; see make(1) -M obj Set obj root directory to obj (sets MAKEOBJDIRPREFIX) -m mach Set MACHINE to mach (not required if NetBSD native) -n Show commands that would be executed, but do not execute them -O obj Set obj root directory to obj (sets a MAKEOBJDIR pattern) -o Set MKOBJDIRS=no (do not create objdirs at start of build) -R release Set RELEASEDIR to release -r Remove contents of TOOLDIR and DESTDIR before building -T tools Set TOOLDIR to tools. If unset, and TOOLDIR is not set in the environment, nbmake will be (re)built unconditionally. -U Set UNPRIVED -u Set UPDATE -V v=[val] Set variable `v' to `val' -w wrapper Create nbmake script as wrapper (default: ${TOOLDIR}/bin/nbmake-${MACHINE})
2003-01-23 19:24:08 +03:00
fi
${runcmd} "${TOOLDIR}/bin/${toolprefix}config" -b "${kernelbuildpath}" \
-s "${TOP}/sys" "${kernelconfpath}" ||
bomb "${toolprefix}config failed for ${kernelconf}"
${runcmd} cd "${kernelbuildpath}"
${runcmd} "${makewrapper}" depend ||
bomb "Failed to make depend in ${kernelbuildpath}"
${runcmd} "${makewrapper}" ${parallel} all ||
bomb "Failed to make all in ${kernelbuildpath}"
${runcmd} cd "${TOP}"
if [ "${runcmd}" != "echo" ]; then
statusmsg "Kernels built from ${kernelconf}:"
kernlist=$(awk '$1 == "config" { print $2 }' ${kernelconfpath})
for kern in ${kernlist:-netbsd}; do
[ -f "${kernelbuildpath}/${kern}" ] && \
echo " ${kernelbuildpath}/${kern}"
done | tee -a "${results}"
fi
Rework how build.sh functions, so that command line options set various parameters, and a list of "operations" defines what to do. The full usage is show below. Notes: `-b' has been deprecated (it always occurs now) `-d' is replaced by "distribution" `-R rel' onlys sets RELEASEDIR; use "release" to build a release `-k kern' has been replaced by "kernel=kern" `-i idir' has been replaced by "install=idir" -r now occurs before nbmake is rebuilt Add a copyright (long due!). Rework the code to (a KNF inspired) ShellNF. Use functions appropriately. Allow `nb' prefix to be easily changed to something else. Solve world peace (just kidding) This is part of the (never achievable) goal of attempting to make NetBSD easier to build... --8<-- new usage follows --8<-- Usage: build.sh [-EnorUu] [-a arch] [-B buildid] [-D dest] [-j njob] [-M obj] [-m mach] [-O obj] [-R release] [-T tools] [-V var=[value]] [-w wrapper] [operation [...] ] System build operations (all imply "obj" and "tools"): build Run "make build" distribution Run "make distribution" (includes etc/ files) release Run "make release" (includes kernels & distrib media) Other operations: obj Run "make obj" (default unless -o) tools Build and install tools kernel=conf Build kernel with config file `conf' install=idir Run "make installworld" to `idir' (useful after 'distribution' or 'release') Options: -a arch Set MACHINE_ARCH to arch (otherwise deduced from MACHINE) -B buildId Set BUILDID to buildId -D dest Set DESTDIR to dest -E Set "expert" mode; disables some DESTDIR checks -j njob Run up to njob jobs in parallel; see make(1) -M obj Set obj root directory to obj (sets MAKEOBJDIRPREFIX) -m mach Set MACHINE to mach (not required if NetBSD native) -n Show commands that would be executed, but do not execute them -O obj Set obj root directory to obj (sets a MAKEOBJDIR pattern) -o Set MKOBJDIRS=no (do not create objdirs at start of build) -R release Set RELEASEDIR to release -r Remove contents of TOOLDIR and DESTDIR before building -T tools Set TOOLDIR to tools. If unset, and TOOLDIR is not set in the environment, nbmake will be (re)built unconditionally. -U Set UNPRIVED -u Set UPDATE -V v=[val] Set variable `v' to `val' -w wrapper Create nbmake script as wrapper (default: ${TOOLDIR}/bin/nbmake-${MACHINE})
2003-01-23 19:24:08 +03:00
}
releasekernel()
{
getkernelconf $1
kernelreldir="${RELEASEDIR}/${MACHINE}/binary/kernel"
${runcmd} mkdir -p "${kernelreldir}"
kernlist=$(awk '$1 == "config" { print $2 }' ${kernelconfpath})
for kern in ${kernlist:-netbsd}; do
builtkern="${kernelbuildpath}/${kern}"
[ -f "${builtkern}" ] || continue
releasekern="${kernelreldir}/${kern}-${kernelconfname}.gz"
statusmsg "Kernel copy: ${releasekern}"
${runcmd} gzip -c -9 < "${builtkern}" > "${releasekern}"
done
}
Rework how build.sh functions, so that command line options set various parameters, and a list of "operations" defines what to do. The full usage is show below. Notes: `-b' has been deprecated (it always occurs now) `-d' is replaced by "distribution" `-R rel' onlys sets RELEASEDIR; use "release" to build a release `-k kern' has been replaced by "kernel=kern" `-i idir' has been replaced by "install=idir" -r now occurs before nbmake is rebuilt Add a copyright (long due!). Rework the code to (a KNF inspired) ShellNF. Use functions appropriately. Allow `nb' prefix to be easily changed to something else. Solve world peace (just kidding) This is part of the (never achievable) goal of attempting to make NetBSD easier to build... --8<-- new usage follows --8<-- Usage: build.sh [-EnorUu] [-a arch] [-B buildid] [-D dest] [-j njob] [-M obj] [-m mach] [-O obj] [-R release] [-T tools] [-V var=[value]] [-w wrapper] [operation [...] ] System build operations (all imply "obj" and "tools"): build Run "make build" distribution Run "make distribution" (includes etc/ files) release Run "make release" (includes kernels & distrib media) Other operations: obj Run "make obj" (default unless -o) tools Build and install tools kernel=conf Build kernel with config file `conf' install=idir Run "make installworld" to `idir' (useful after 'distribution' or 'release') Options: -a arch Set MACHINE_ARCH to arch (otherwise deduced from MACHINE) -B buildId Set BUILDID to buildId -D dest Set DESTDIR to dest -E Set "expert" mode; disables some DESTDIR checks -j njob Run up to njob jobs in parallel; see make(1) -M obj Set obj root directory to obj (sets MAKEOBJDIRPREFIX) -m mach Set MACHINE to mach (not required if NetBSD native) -n Show commands that would be executed, but do not execute them -O obj Set obj root directory to obj (sets a MAKEOBJDIR pattern) -o Set MKOBJDIRS=no (do not create objdirs at start of build) -R release Set RELEASEDIR to release -r Remove contents of TOOLDIR and DESTDIR before building -T tools Set TOOLDIR to tools. If unset, and TOOLDIR is not set in the environment, nbmake will be (re)built unconditionally. -U Set UNPRIVED -u Set UPDATE -V v=[val] Set variable `v' to `val' -w wrapper Create nbmake script as wrapper (default: ${TOOLDIR}/bin/nbmake-${MACHINE})
2003-01-23 19:24:08 +03:00
installworld()
{
dir="$1"
${runcmd} "${makewrapper}" INSTALLWORLDDIR="${dir}" installworld ||
bomb "Failed to make installworld to ${dir}"
statusmsg "Successful installworld to ${dir}"
Rework how build.sh functions, so that command line options set various parameters, and a list of "operations" defines what to do. The full usage is show below. Notes: `-b' has been deprecated (it always occurs now) `-d' is replaced by "distribution" `-R rel' onlys sets RELEASEDIR; use "release" to build a release `-k kern' has been replaced by "kernel=kern" `-i idir' has been replaced by "install=idir" -r now occurs before nbmake is rebuilt Add a copyright (long due!). Rework the code to (a KNF inspired) ShellNF. Use functions appropriately. Allow `nb' prefix to be easily changed to something else. Solve world peace (just kidding) This is part of the (never achievable) goal of attempting to make NetBSD easier to build... --8<-- new usage follows --8<-- Usage: build.sh [-EnorUu] [-a arch] [-B buildid] [-D dest] [-j njob] [-M obj] [-m mach] [-O obj] [-R release] [-T tools] [-V var=[value]] [-w wrapper] [operation [...] ] System build operations (all imply "obj" and "tools"): build Run "make build" distribution Run "make distribution" (includes etc/ files) release Run "make release" (includes kernels & distrib media) Other operations: obj Run "make obj" (default unless -o) tools Build and install tools kernel=conf Build kernel with config file `conf' install=idir Run "make installworld" to `idir' (useful after 'distribution' or 'release') Options: -a arch Set MACHINE_ARCH to arch (otherwise deduced from MACHINE) -B buildId Set BUILDID to buildId -D dest Set DESTDIR to dest -E Set "expert" mode; disables some DESTDIR checks -j njob Run up to njob jobs in parallel; see make(1) -M obj Set obj root directory to obj (sets MAKEOBJDIRPREFIX) -m mach Set MACHINE to mach (not required if NetBSD native) -n Show commands that would be executed, but do not execute them -O obj Set obj root directory to obj (sets a MAKEOBJDIR pattern) -o Set MKOBJDIRS=no (do not create objdirs at start of build) -R release Set RELEASEDIR to release -r Remove contents of TOOLDIR and DESTDIR before building -T tools Set TOOLDIR to tools. If unset, and TOOLDIR is not set in the environment, nbmake will be (re)built unconditionally. -U Set UNPRIVED -u Set UPDATE -V v=[val] Set variable `v' to `val' -w wrapper Create nbmake script as wrapper (default: ${TOOLDIR}/bin/nbmake-${MACHINE})
2003-01-23 19:24:08 +03:00
}
main()
{
initdefaults
parseoptions "$@"
build_start=$(date)
statusmsg "${progname} command: $0 $@"
statusmsg "${progname} started: ${build_start}"
Rework how build.sh functions, so that command line options set various parameters, and a list of "operations" defines what to do. The full usage is show below. Notes: `-b' has been deprecated (it always occurs now) `-d' is replaced by "distribution" `-R rel' onlys sets RELEASEDIR; use "release" to build a release `-k kern' has been replaced by "kernel=kern" `-i idir' has been replaced by "install=idir" -r now occurs before nbmake is rebuilt Add a copyright (long due!). Rework the code to (a KNF inspired) ShellNF. Use functions appropriately. Allow `nb' prefix to be easily changed to something else. Solve world peace (just kidding) This is part of the (never achievable) goal of attempting to make NetBSD easier to build... --8<-- new usage follows --8<-- Usage: build.sh [-EnorUu] [-a arch] [-B buildid] [-D dest] [-j njob] [-M obj] [-m mach] [-O obj] [-R release] [-T tools] [-V var=[value]] [-w wrapper] [operation [...] ] System build operations (all imply "obj" and "tools"): build Run "make build" distribution Run "make distribution" (includes etc/ files) release Run "make release" (includes kernels & distrib media) Other operations: obj Run "make obj" (default unless -o) tools Build and install tools kernel=conf Build kernel with config file `conf' install=idir Run "make installworld" to `idir' (useful after 'distribution' or 'release') Options: -a arch Set MACHINE_ARCH to arch (otherwise deduced from MACHINE) -B buildId Set BUILDID to buildId -D dest Set DESTDIR to dest -E Set "expert" mode; disables some DESTDIR checks -j njob Run up to njob jobs in parallel; see make(1) -M obj Set obj root directory to obj (sets MAKEOBJDIRPREFIX) -m mach Set MACHINE to mach (not required if NetBSD native) -n Show commands that would be executed, but do not execute them -O obj Set obj root directory to obj (sets a MAKEOBJDIR pattern) -o Set MKOBJDIRS=no (do not create objdirs at start of build) -R release Set RELEASEDIR to release -r Remove contents of TOOLDIR and DESTDIR before building -T tools Set TOOLDIR to tools. If unset, and TOOLDIR is not set in the environment, nbmake will be (re)built unconditionally. -U Set UNPRIVED -u Set UPDATE -V v=[val] Set variable `v' to `val' -w wrapper Create nbmake script as wrapper (default: ${TOOLDIR}/bin/nbmake-${MACHINE})
2003-01-23 19:24:08 +03:00
rebuildmake
validatemakeparams
createmakewrapper
# Perform the operations.
#
for op in ${operations}; do
case "${op}" in
Rework how build.sh functions, so that command line options set various parameters, and a list of "operations" defines what to do. The full usage is show below. Notes: `-b' has been deprecated (it always occurs now) `-d' is replaced by "distribution" `-R rel' onlys sets RELEASEDIR; use "release" to build a release `-k kern' has been replaced by "kernel=kern" `-i idir' has been replaced by "install=idir" -r now occurs before nbmake is rebuilt Add a copyright (long due!). Rework the code to (a KNF inspired) ShellNF. Use functions appropriately. Allow `nb' prefix to be easily changed to something else. Solve world peace (just kidding) This is part of the (never achievable) goal of attempting to make NetBSD easier to build... --8<-- new usage follows --8<-- Usage: build.sh [-EnorUu] [-a arch] [-B buildid] [-D dest] [-j njob] [-M obj] [-m mach] [-O obj] [-R release] [-T tools] [-V var=[value]] [-w wrapper] [operation [...] ] System build operations (all imply "obj" and "tools"): build Run "make build" distribution Run "make distribution" (includes etc/ files) release Run "make release" (includes kernels & distrib media) Other operations: obj Run "make obj" (default unless -o) tools Build and install tools kernel=conf Build kernel with config file `conf' install=idir Run "make installworld" to `idir' (useful after 'distribution' or 'release') Options: -a arch Set MACHINE_ARCH to arch (otherwise deduced from MACHINE) -B buildId Set BUILDID to buildId -D dest Set DESTDIR to dest -E Set "expert" mode; disables some DESTDIR checks -j njob Run up to njob jobs in parallel; see make(1) -M obj Set obj root directory to obj (sets MAKEOBJDIRPREFIX) -m mach Set MACHINE to mach (not required if NetBSD native) -n Show commands that would be executed, but do not execute them -O obj Set obj root directory to obj (sets a MAKEOBJDIR pattern) -o Set MKOBJDIRS=no (do not create objdirs at start of build) -R release Set RELEASEDIR to release -r Remove contents of TOOLDIR and DESTDIR before building -T tools Set TOOLDIR to tools. If unset, and TOOLDIR is not set in the environment, nbmake will be (re)built unconditionally. -U Set UNPRIVED -u Set UPDATE -V v=[val] Set variable `v' to `val' -w wrapper Create nbmake script as wrapper (default: ${TOOLDIR}/bin/nbmake-${MACHINE})
2003-01-23 19:24:08 +03:00
makewrapper)
# no-op
;;
Rework how build.sh functions, so that command line options set various parameters, and a list of "operations" defines what to do. The full usage is show below. Notes: `-b' has been deprecated (it always occurs now) `-d' is replaced by "distribution" `-R rel' onlys sets RELEASEDIR; use "release" to build a release `-k kern' has been replaced by "kernel=kern" `-i idir' has been replaced by "install=idir" -r now occurs before nbmake is rebuilt Add a copyright (long due!). Rework the code to (a KNF inspired) ShellNF. Use functions appropriately. Allow `nb' prefix to be easily changed to something else. Solve world peace (just kidding) This is part of the (never achievable) goal of attempting to make NetBSD easier to build... --8<-- new usage follows --8<-- Usage: build.sh [-EnorUu] [-a arch] [-B buildid] [-D dest] [-j njob] [-M obj] [-m mach] [-O obj] [-R release] [-T tools] [-V var=[value]] [-w wrapper] [operation [...] ] System build operations (all imply "obj" and "tools"): build Run "make build" distribution Run "make distribution" (includes etc/ files) release Run "make release" (includes kernels & distrib media) Other operations: obj Run "make obj" (default unless -o) tools Build and install tools kernel=conf Build kernel with config file `conf' install=idir Run "make installworld" to `idir' (useful after 'distribution' or 'release') Options: -a arch Set MACHINE_ARCH to arch (otherwise deduced from MACHINE) -B buildId Set BUILDID to buildId -D dest Set DESTDIR to dest -E Set "expert" mode; disables some DESTDIR checks -j njob Run up to njob jobs in parallel; see make(1) -M obj Set obj root directory to obj (sets MAKEOBJDIRPREFIX) -m mach Set MACHINE to mach (not required if NetBSD native) -n Show commands that would be executed, but do not execute them -O obj Set obj root directory to obj (sets a MAKEOBJDIR pattern) -o Set MKOBJDIRS=no (do not create objdirs at start of build) -R release Set RELEASEDIR to release -r Remove contents of TOOLDIR and DESTDIR before building -T tools Set TOOLDIR to tools. If unset, and TOOLDIR is not set in the environment, nbmake will be (re)built unconditionally. -U Set UNPRIVED -u Set UPDATE -V v=[val] Set variable `v' to `val' -w wrapper Create nbmake script as wrapper (default: ${TOOLDIR}/bin/nbmake-${MACHINE})
2003-01-23 19:24:08 +03:00
tools)
buildtools
;;
Rework how build.sh functions, so that command line options set various parameters, and a list of "operations" defines what to do. The full usage is show below. Notes: `-b' has been deprecated (it always occurs now) `-d' is replaced by "distribution" `-R rel' onlys sets RELEASEDIR; use "release" to build a release `-k kern' has been replaced by "kernel=kern" `-i idir' has been replaced by "install=idir" -r now occurs before nbmake is rebuilt Add a copyright (long due!). Rework the code to (a KNF inspired) ShellNF. Use functions appropriately. Allow `nb' prefix to be easily changed to something else. Solve world peace (just kidding) This is part of the (never achievable) goal of attempting to make NetBSD easier to build... --8<-- new usage follows --8<-- Usage: build.sh [-EnorUu] [-a arch] [-B buildid] [-D dest] [-j njob] [-M obj] [-m mach] [-O obj] [-R release] [-T tools] [-V var=[value]] [-w wrapper] [operation [...] ] System build operations (all imply "obj" and "tools"): build Run "make build" distribution Run "make distribution" (includes etc/ files) release Run "make release" (includes kernels & distrib media) Other operations: obj Run "make obj" (default unless -o) tools Build and install tools kernel=conf Build kernel with config file `conf' install=idir Run "make installworld" to `idir' (useful after 'distribution' or 'release') Options: -a arch Set MACHINE_ARCH to arch (otherwise deduced from MACHINE) -B buildId Set BUILDID to buildId -D dest Set DESTDIR to dest -E Set "expert" mode; disables some DESTDIR checks -j njob Run up to njob jobs in parallel; see make(1) -M obj Set obj root directory to obj (sets MAKEOBJDIRPREFIX) -m mach Set MACHINE to mach (not required if NetBSD native) -n Show commands that would be executed, but do not execute them -O obj Set obj root directory to obj (sets a MAKEOBJDIR pattern) -o Set MKOBJDIRS=no (do not create objdirs at start of build) -R release Set RELEASEDIR to release -r Remove contents of TOOLDIR and DESTDIR before building -T tools Set TOOLDIR to tools. If unset, and TOOLDIR is not set in the environment, nbmake will be (re)built unconditionally. -U Set UNPRIVED -u Set UPDATE -V v=[val] Set variable `v' to `val' -w wrapper Create nbmake script as wrapper (default: ${TOOLDIR}/bin/nbmake-${MACHINE})
2003-01-23 19:24:08 +03:00
2003-07-16 17:21:47 +04:00
obj|build|distribution|release|sets|sourcesets|params)
${runcmd} "${makewrapper}" ${parallel} ${op} ||
bomb "Failed to make ${op}"
statusmsg "Successful make ${op}"
Rework how build.sh functions, so that command line options set various parameters, and a list of "operations" defines what to do. The full usage is show below. Notes: `-b' has been deprecated (it always occurs now) `-d' is replaced by "distribution" `-R rel' onlys sets RELEASEDIR; use "release" to build a release `-k kern' has been replaced by "kernel=kern" `-i idir' has been replaced by "install=idir" -r now occurs before nbmake is rebuilt Add a copyright (long due!). Rework the code to (a KNF inspired) ShellNF. Use functions appropriately. Allow `nb' prefix to be easily changed to something else. Solve world peace (just kidding) This is part of the (never achievable) goal of attempting to make NetBSD easier to build... --8<-- new usage follows --8<-- Usage: build.sh [-EnorUu] [-a arch] [-B buildid] [-D dest] [-j njob] [-M obj] [-m mach] [-O obj] [-R release] [-T tools] [-V var=[value]] [-w wrapper] [operation [...] ] System build operations (all imply "obj" and "tools"): build Run "make build" distribution Run "make distribution" (includes etc/ files) release Run "make release" (includes kernels & distrib media) Other operations: obj Run "make obj" (default unless -o) tools Build and install tools kernel=conf Build kernel with config file `conf' install=idir Run "make installworld" to `idir' (useful after 'distribution' or 'release') Options: -a arch Set MACHINE_ARCH to arch (otherwise deduced from MACHINE) -B buildId Set BUILDID to buildId -D dest Set DESTDIR to dest -E Set "expert" mode; disables some DESTDIR checks -j njob Run up to njob jobs in parallel; see make(1) -M obj Set obj root directory to obj (sets MAKEOBJDIRPREFIX) -m mach Set MACHINE to mach (not required if NetBSD native) -n Show commands that would be executed, but do not execute them -O obj Set obj root directory to obj (sets a MAKEOBJDIR pattern) -o Set MKOBJDIRS=no (do not create objdirs at start of build) -R release Set RELEASEDIR to release -r Remove contents of TOOLDIR and DESTDIR before building -T tools Set TOOLDIR to tools. If unset, and TOOLDIR is not set in the environment, nbmake will be (re)built unconditionally. -U Set UNPRIVED -u Set UPDATE -V v=[val] Set variable `v' to `val' -w wrapper Create nbmake script as wrapper (default: ${TOOLDIR}/bin/nbmake-${MACHINE})
2003-01-23 19:24:08 +03:00
;;
kernel=*)
arg=${op#*=}
buildkernel "${arg}"
;;
releasekernel=*)
arg=${op#*=}
releasekernel "${arg}"
;;
Rework how build.sh functions, so that command line options set various parameters, and a list of "operations" defines what to do. The full usage is show below. Notes: `-b' has been deprecated (it always occurs now) `-d' is replaced by "distribution" `-R rel' onlys sets RELEASEDIR; use "release" to build a release `-k kern' has been replaced by "kernel=kern" `-i idir' has been replaced by "install=idir" -r now occurs before nbmake is rebuilt Add a copyright (long due!). Rework the code to (a KNF inspired) ShellNF. Use functions appropriately. Allow `nb' prefix to be easily changed to something else. Solve world peace (just kidding) This is part of the (never achievable) goal of attempting to make NetBSD easier to build... --8<-- new usage follows --8<-- Usage: build.sh [-EnorUu] [-a arch] [-B buildid] [-D dest] [-j njob] [-M obj] [-m mach] [-O obj] [-R release] [-T tools] [-V var=[value]] [-w wrapper] [operation [...] ] System build operations (all imply "obj" and "tools"): build Run "make build" distribution Run "make distribution" (includes etc/ files) release Run "make release" (includes kernels & distrib media) Other operations: obj Run "make obj" (default unless -o) tools Build and install tools kernel=conf Build kernel with config file `conf' install=idir Run "make installworld" to `idir' (useful after 'distribution' or 'release') Options: -a arch Set MACHINE_ARCH to arch (otherwise deduced from MACHINE) -B buildId Set BUILDID to buildId -D dest Set DESTDIR to dest -E Set "expert" mode; disables some DESTDIR checks -j njob Run up to njob jobs in parallel; see make(1) -M obj Set obj root directory to obj (sets MAKEOBJDIRPREFIX) -m mach Set MACHINE to mach (not required if NetBSD native) -n Show commands that would be executed, but do not execute them -O obj Set obj root directory to obj (sets a MAKEOBJDIR pattern) -o Set MKOBJDIRS=no (do not create objdirs at start of build) -R release Set RELEASEDIR to release -r Remove contents of TOOLDIR and DESTDIR before building -T tools Set TOOLDIR to tools. If unset, and TOOLDIR is not set in the environment, nbmake will be (re)built unconditionally. -U Set UNPRIVED -u Set UPDATE -V v=[val] Set variable `v' to `val' -w wrapper Create nbmake script as wrapper (default: ${TOOLDIR}/bin/nbmake-${MACHINE})
2003-01-23 19:24:08 +03:00
install=*)
arg=${op#*=}
if [ "${arg}" = "/" ] && \
( [ "${uname_s}" != "NetBSD" ] || \
[ "${uname_m}" != "${MACHINE}" ] ); then
bomb "'${op}' must != / for cross builds."
fi
Rework how build.sh functions, so that command line options set various parameters, and a list of "operations" defines what to do. The full usage is show below. Notes: `-b' has been deprecated (it always occurs now) `-d' is replaced by "distribution" `-R rel' onlys sets RELEASEDIR; use "release" to build a release `-k kern' has been replaced by "kernel=kern" `-i idir' has been replaced by "install=idir" -r now occurs before nbmake is rebuilt Add a copyright (long due!). Rework the code to (a KNF inspired) ShellNF. Use functions appropriately. Allow `nb' prefix to be easily changed to something else. Solve world peace (just kidding) This is part of the (never achievable) goal of attempting to make NetBSD easier to build... --8<-- new usage follows --8<-- Usage: build.sh [-EnorUu] [-a arch] [-B buildid] [-D dest] [-j njob] [-M obj] [-m mach] [-O obj] [-R release] [-T tools] [-V var=[value]] [-w wrapper] [operation [...] ] System build operations (all imply "obj" and "tools"): build Run "make build" distribution Run "make distribution" (includes etc/ files) release Run "make release" (includes kernels & distrib media) Other operations: obj Run "make obj" (default unless -o) tools Build and install tools kernel=conf Build kernel with config file `conf' install=idir Run "make installworld" to `idir' (useful after 'distribution' or 'release') Options: -a arch Set MACHINE_ARCH to arch (otherwise deduced from MACHINE) -B buildId Set BUILDID to buildId -D dest Set DESTDIR to dest -E Set "expert" mode; disables some DESTDIR checks -j njob Run up to njob jobs in parallel; see make(1) -M obj Set obj root directory to obj (sets MAKEOBJDIRPREFIX) -m mach Set MACHINE to mach (not required if NetBSD native) -n Show commands that would be executed, but do not execute them -O obj Set obj root directory to obj (sets a MAKEOBJDIR pattern) -o Set MKOBJDIRS=no (do not create objdirs at start of build) -R release Set RELEASEDIR to release -r Remove contents of TOOLDIR and DESTDIR before building -T tools Set TOOLDIR to tools. If unset, and TOOLDIR is not set in the environment, nbmake will be (re)built unconditionally. -U Set UNPRIVED -u Set UPDATE -V v=[val] Set variable `v' to `val' -w wrapper Create nbmake script as wrapper (default: ${TOOLDIR}/bin/nbmake-${MACHINE})
2003-01-23 19:24:08 +03:00
installworld "${arg}"
;;
*)
Rework how build.sh functions, so that command line options set various parameters, and a list of "operations" defines what to do. The full usage is show below. Notes: `-b' has been deprecated (it always occurs now) `-d' is replaced by "distribution" `-R rel' onlys sets RELEASEDIR; use "release" to build a release `-k kern' has been replaced by "kernel=kern" `-i idir' has been replaced by "install=idir" -r now occurs before nbmake is rebuilt Add a copyright (long due!). Rework the code to (a KNF inspired) ShellNF. Use functions appropriately. Allow `nb' prefix to be easily changed to something else. Solve world peace (just kidding) This is part of the (never achievable) goal of attempting to make NetBSD easier to build... --8<-- new usage follows --8<-- Usage: build.sh [-EnorUu] [-a arch] [-B buildid] [-D dest] [-j njob] [-M obj] [-m mach] [-O obj] [-R release] [-T tools] [-V var=[value]] [-w wrapper] [operation [...] ] System build operations (all imply "obj" and "tools"): build Run "make build" distribution Run "make distribution" (includes etc/ files) release Run "make release" (includes kernels & distrib media) Other operations: obj Run "make obj" (default unless -o) tools Build and install tools kernel=conf Build kernel with config file `conf' install=idir Run "make installworld" to `idir' (useful after 'distribution' or 'release') Options: -a arch Set MACHINE_ARCH to arch (otherwise deduced from MACHINE) -B buildId Set BUILDID to buildId -D dest Set DESTDIR to dest -E Set "expert" mode; disables some DESTDIR checks -j njob Run up to njob jobs in parallel; see make(1) -M obj Set obj root directory to obj (sets MAKEOBJDIRPREFIX) -m mach Set MACHINE to mach (not required if NetBSD native) -n Show commands that would be executed, but do not execute them -O obj Set obj root directory to obj (sets a MAKEOBJDIR pattern) -o Set MKOBJDIRS=no (do not create objdirs at start of build) -R release Set RELEASEDIR to release -r Remove contents of TOOLDIR and DESTDIR before building -T tools Set TOOLDIR to tools. If unset, and TOOLDIR is not set in the environment, nbmake will be (re)built unconditionally. -U Set UNPRIVED -u Set UPDATE -V v=[val] Set variable `v' to `val' -w wrapper Create nbmake script as wrapper (default: ${TOOLDIR}/bin/nbmake-${MACHINE})
2003-01-23 19:24:08 +03:00
bomb "Unknown operation \`${op}'"
;;
Rework how build.sh functions, so that command line options set various parameters, and a list of "operations" defines what to do. The full usage is show below. Notes: `-b' has been deprecated (it always occurs now) `-d' is replaced by "distribution" `-R rel' onlys sets RELEASEDIR; use "release" to build a release `-k kern' has been replaced by "kernel=kern" `-i idir' has been replaced by "install=idir" -r now occurs before nbmake is rebuilt Add a copyright (long due!). Rework the code to (a KNF inspired) ShellNF. Use functions appropriately. Allow `nb' prefix to be easily changed to something else. Solve world peace (just kidding) This is part of the (never achievable) goal of attempting to make NetBSD easier to build... --8<-- new usage follows --8<-- Usage: build.sh [-EnorUu] [-a arch] [-B buildid] [-D dest] [-j njob] [-M obj] [-m mach] [-O obj] [-R release] [-T tools] [-V var=[value]] [-w wrapper] [operation [...] ] System build operations (all imply "obj" and "tools"): build Run "make build" distribution Run "make distribution" (includes etc/ files) release Run "make release" (includes kernels & distrib media) Other operations: obj Run "make obj" (default unless -o) tools Build and install tools kernel=conf Build kernel with config file `conf' install=idir Run "make installworld" to `idir' (useful after 'distribution' or 'release') Options: -a arch Set MACHINE_ARCH to arch (otherwise deduced from MACHINE) -B buildId Set BUILDID to buildId -D dest Set DESTDIR to dest -E Set "expert" mode; disables some DESTDIR checks -j njob Run up to njob jobs in parallel; see make(1) -M obj Set obj root directory to obj (sets MAKEOBJDIRPREFIX) -m mach Set MACHINE to mach (not required if NetBSD native) -n Show commands that would be executed, but do not execute them -O obj Set obj root directory to obj (sets a MAKEOBJDIR pattern) -o Set MKOBJDIRS=no (do not create objdirs at start of build) -R release Set RELEASEDIR to release -r Remove contents of TOOLDIR and DESTDIR before building -T tools Set TOOLDIR to tools. If unset, and TOOLDIR is not set in the environment, nbmake will be (re)built unconditionally. -U Set UNPRIVED -u Set UPDATE -V v=[val] Set variable `v' to `val' -w wrapper Create nbmake script as wrapper (default: ${TOOLDIR}/bin/nbmake-${MACHINE})
2003-01-23 19:24:08 +03:00
esac
Rework how build.sh functions, so that command line options set various parameters, and a list of "operations" defines what to do. The full usage is show below. Notes: `-b' has been deprecated (it always occurs now) `-d' is replaced by "distribution" `-R rel' onlys sets RELEASEDIR; use "release" to build a release `-k kern' has been replaced by "kernel=kern" `-i idir' has been replaced by "install=idir" -r now occurs before nbmake is rebuilt Add a copyright (long due!). Rework the code to (a KNF inspired) ShellNF. Use functions appropriately. Allow `nb' prefix to be easily changed to something else. Solve world peace (just kidding) This is part of the (never achievable) goal of attempting to make NetBSD easier to build... --8<-- new usage follows --8<-- Usage: build.sh [-EnorUu] [-a arch] [-B buildid] [-D dest] [-j njob] [-M obj] [-m mach] [-O obj] [-R release] [-T tools] [-V var=[value]] [-w wrapper] [operation [...] ] System build operations (all imply "obj" and "tools"): build Run "make build" distribution Run "make distribution" (includes etc/ files) release Run "make release" (includes kernels & distrib media) Other operations: obj Run "make obj" (default unless -o) tools Build and install tools kernel=conf Build kernel with config file `conf' install=idir Run "make installworld" to `idir' (useful after 'distribution' or 'release') Options: -a arch Set MACHINE_ARCH to arch (otherwise deduced from MACHINE) -B buildId Set BUILDID to buildId -D dest Set DESTDIR to dest -E Set "expert" mode; disables some DESTDIR checks -j njob Run up to njob jobs in parallel; see make(1) -M obj Set obj root directory to obj (sets MAKEOBJDIRPREFIX) -m mach Set MACHINE to mach (not required if NetBSD native) -n Show commands that would be executed, but do not execute them -O obj Set obj root directory to obj (sets a MAKEOBJDIR pattern) -o Set MKOBJDIRS=no (do not create objdirs at start of build) -R release Set RELEASEDIR to release -r Remove contents of TOOLDIR and DESTDIR before building -T tools Set TOOLDIR to tools. If unset, and TOOLDIR is not set in the environment, nbmake will be (re)built unconditionally. -U Set UNPRIVED -u Set UPDATE -V v=[val] Set variable `v' to `val' -w wrapper Create nbmake script as wrapper (default: ${TOOLDIR}/bin/nbmake-${MACHINE})
2003-01-23 19:24:08 +03:00
done
statusmsg "${progname} started: ${build_start}"
statusmsg "${progname} ended: $(date)"
if [ -s "${results}" ]; then
echo "===> Summary of results:"
sed -e 's/^===>//;s/^/ /' "${results}"
echo "===> ."
fi
}
Rework how build.sh functions, so that command line options set various parameters, and a list of "operations" defines what to do. The full usage is show below. Notes: `-b' has been deprecated (it always occurs now) `-d' is replaced by "distribution" `-R rel' onlys sets RELEASEDIR; use "release" to build a release `-k kern' has been replaced by "kernel=kern" `-i idir' has been replaced by "install=idir" -r now occurs before nbmake is rebuilt Add a copyright (long due!). Rework the code to (a KNF inspired) ShellNF. Use functions appropriately. Allow `nb' prefix to be easily changed to something else. Solve world peace (just kidding) This is part of the (never achievable) goal of attempting to make NetBSD easier to build... --8<-- new usage follows --8<-- Usage: build.sh [-EnorUu] [-a arch] [-B buildid] [-D dest] [-j njob] [-M obj] [-m mach] [-O obj] [-R release] [-T tools] [-V var=[value]] [-w wrapper] [operation [...] ] System build operations (all imply "obj" and "tools"): build Run "make build" distribution Run "make distribution" (includes etc/ files) release Run "make release" (includes kernels & distrib media) Other operations: obj Run "make obj" (default unless -o) tools Build and install tools kernel=conf Build kernel with config file `conf' install=idir Run "make installworld" to `idir' (useful after 'distribution' or 'release') Options: -a arch Set MACHINE_ARCH to arch (otherwise deduced from MACHINE) -B buildId Set BUILDID to buildId -D dest Set DESTDIR to dest -E Set "expert" mode; disables some DESTDIR checks -j njob Run up to njob jobs in parallel; see make(1) -M obj Set obj root directory to obj (sets MAKEOBJDIRPREFIX) -m mach Set MACHINE to mach (not required if NetBSD native) -n Show commands that would be executed, but do not execute them -O obj Set obj root directory to obj (sets a MAKEOBJDIR pattern) -o Set MKOBJDIRS=no (do not create objdirs at start of build) -R release Set RELEASEDIR to release -r Remove contents of TOOLDIR and DESTDIR before building -T tools Set TOOLDIR to tools. If unset, and TOOLDIR is not set in the environment, nbmake will be (re)built unconditionally. -U Set UNPRIVED -u Set UPDATE -V v=[val] Set variable `v' to `val' -w wrapper Create nbmake script as wrapper (default: ${TOOLDIR}/bin/nbmake-${MACHINE})
2003-01-23 19:24:08 +03:00
main "$@"