add "-M makeobjdirprefix" to build.sh

This commit is contained in:
lukem 2002-05-13 01:44:34 +00:00
parent ee2264c945
commit 7d134e662e
3 changed files with 20 additions and 6 deletions

View File

@ -479,6 +479,8 @@ BUILDING
-D dest Set the value of DESTDIR to dest. -D dest Set the value of DESTDIR to dest.
-M obj Set MAKEOBJDIRPREFIX to obj.
-O obj Create an appropriate transform macro for MAKEOBJDIR that will -O obj Create an appropriate transform macro for MAKEOBJDIR that will
place the built object files under obj. For instance, a set- place the built object files under obj. For instance, a set-
ting of /usr/obj will place build-time files files under ting of /usr/obj will place build-time files files under

View File

@ -1,4 +1,4 @@
.\" $NetBSD: BUILDING.mdoc,v 1.17 2002/05/03 08:59:14 lukem Exp $ .\" $NetBSD: BUILDING.mdoc,v 1.18 2002/05/13 01:44:34 lukem Exp $
.\" .\"
.\" Copyright (c) 2001 The NetBSD Foundation, Inc. .\" Copyright (c) 2001 The NetBSD Foundation, Inc.
.\" All rights reserved. .\" All rights reserved.
@ -873,6 +873,12 @@ Set the value of
to to
.Em dest . .Em dest .
. .
.It Sy -M Em obj
Set
.Sy MAKEOBJDIRPREFIX
to
.Em obj .
.
.It Sy -O Em obj .It Sy -O Em obj
Create an appropriate transform macro for Create an appropriate transform macro for
.Sy MAKEOBJDIR .Sy MAKEOBJDIR

View File

@ -1,5 +1,5 @@
#! /bin/sh #! /bin/sh
# $NetBSD: build.sh,v 1.57 2002/05/02 22:13:31 sommerfeld Exp $ # $NetBSD: build.sh,v 1.58 2002/05/13 01:44:34 lukem Exp $
# #
# Top level build wrapper, for a system containing no tools. # Top level build wrapper, for a system containing no tools.
# #
@ -83,7 +83,7 @@ resolvepath () {
usage () { usage () {
echo "Usage:" echo "Usage:"
echo "$0 [-bdorUu] [-a arch] [-B buildid] [-j njob] [-m mach] " echo "$0 [-bdorUu] [-a arch] [-B buildid] [-j njob] [-m mach] "
echo " [-w wrapper] [-D dest] [-O obj] [-R release] [-T tools]" echo " [-w wrapper] [-D dest] [-M obj] [-O obj] [-R release] [-T tools]"
echo "" echo ""
echo " -a: set MACHINE_ARCH to arch (otherwise deduced from MACHINE)" echo " -a: set MACHINE_ARCH to arch (otherwise deduced from MACHINE)"
echo " -B: set BUILDID to buildid" echo " -B: set BUILDID to buildid"
@ -91,6 +91,7 @@ usage () {
echo " -D: set DESTDIR to dest" echo " -D: set DESTDIR to dest"
echo " -d: build a full distribution into DESTDIR (including etc files)" echo " -d: build a full distribution into DESTDIR (including etc files)"
echo " -j: Run up to njob jobs in parallel; see make(1)" echo " -j: Run up to njob jobs in parallel; see make(1)"
echo " -M: set obj root directory to obj (sets MAKEOBJDIRPREFIX)"
echo " -m: set MACHINE to mach (not required if NetBSD native)" echo " -m: set MACHINE to mach (not required if NetBSD native)"
echo " -n: show commands that would be executed, but do not execute them" echo " -n: show commands that would be executed, but do not execute them"
echo " -O: set obj root directory to obj (sets a MAKEOBJDIR pattern)" echo " -O: set obj root directory to obj (sets a MAKEOBJDIR pattern)"
@ -119,7 +120,7 @@ do_removedirs=false
makeenv= makeenv=
makewrapper= makewrapper=
opt_a=no opt_a=no
opts='a:B:bdhj:m:nortuw:D:O:R:T:U' opts='a:B:bdhj:m:nortuw:D:M:O:R:T:U'
runcmd= runcmd=
if type getopts >/dev/null 2>&1; then if type getopts >/dev/null 2>&1; then
@ -178,6 +179,11 @@ while eval $getoptcmd; do case $opt in
DESTDIR="$OPTARG"; export DESTDIR DESTDIR="$OPTARG"; export DESTDIR
makeenv="$makeenv DESTDIR";; makeenv="$makeenv DESTDIR";;
-M) eval $optargcmd; resolvepath
MAKEOBJDIRPREFIX="$OPTARG"; export MAKEOBJDIRPREFIX
makeobjdir=$OPTARG
makeenv="$makeenv MAKEOBJDIRPREFIX";;
-O) eval $optargcmd; resolvepath -O) eval $optargcmd; resolvepath
MAKEOBJDIR="\${.CURDIR:C,^$cwd,$OPTARG,}"; export MAKEOBJDIR MAKEOBJDIR="\${.CURDIR:C,^$cwd,$OPTARG,}"; export MAKEOBJDIR
makeobjdir=$OPTARG makeobjdir=$OPTARG
@ -285,7 +291,7 @@ if [ -z "$TOOLDIR" ] && [ "$MKOBJDIRS" != "no" ]; then
fi fi
# #
# If setting -O to root an obj dir make sure the base directory is made # If setting -M or -O to root 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_ # before continuing as bsd.own.mk will need this to pick up _SRC_TOP_OBJ_
# #
if [ "$MKOBJDIRS" != "no" ] && [ ! -z "$makeobjdir" ]; then if [ "$MKOBJDIRS" != "no" ] && [ ! -z "$makeobjdir" ]; then
@ -367,7 +373,7 @@ fi
eval cat <<EOF $makewrapout eval cat <<EOF $makewrapout
#! /bin/sh #! /bin/sh
# Set proper variables to allow easy "make" building of a NetBSD subtree. # Set proper variables to allow easy "make" building of a NetBSD subtree.
# Generated from: \$NetBSD: build.sh,v 1.57 2002/05/02 22:13:31 sommerfeld Exp $ # Generated from: \$NetBSD: build.sh,v 1.58 2002/05/13 01:44:34 lukem Exp $
# #
EOF EOF