From 7d134e662e3aafb7bcae83c9ceb529a4988c1956 Mon Sep 17 00:00:00 2001 From: lukem Date: Mon, 13 May 2002 01:44:34 +0000 Subject: [PATCH] add "-M makeobjdirprefix" to build.sh --- BUILDING | 2 ++ BUILDING.mdoc | 8 +++++++- build.sh | 16 +++++++++++----- 3 files changed, 20 insertions(+), 6 deletions(-) diff --git a/BUILDING b/BUILDING index 78d8efd919fa..0b61b6f6322c 100644 --- a/BUILDING +++ b/BUILDING @@ -479,6 +479,8 @@ BUILDING -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 place the built object files under obj. For instance, a set- ting of /usr/obj will place build-time files files under diff --git a/BUILDING.mdoc b/BUILDING.mdoc index 633a0388a959..6e3a73c84d56 100644 --- a/BUILDING.mdoc +++ b/BUILDING.mdoc @@ -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. .\" All rights reserved. @@ -873,6 +873,12 @@ Set the value of to .Em dest . . +.It Sy -M Em obj +Set +.Sy MAKEOBJDIRPREFIX +to +.Em obj . +. .It Sy -O Em obj Create an appropriate transform macro for .Sy MAKEOBJDIR diff --git a/build.sh b/build.sh index 2fb3c3bd4bcc..497216c63e60 100755 --- a/build.sh +++ b/build.sh @@ -1,5 +1,5 @@ #! /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. # @@ -83,7 +83,7 @@ resolvepath () { usage () { echo "Usage:" 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 " -a: set MACHINE_ARCH to arch (otherwise deduced from MACHINE)" echo " -B: set BUILDID to buildid" @@ -91,6 +91,7 @@ usage () { echo " -D: set DESTDIR to dest" echo " -d: build a full distribution into DESTDIR (including etc files)" 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 " -n: show commands that would be executed, but do not execute them" echo " -O: set obj root directory to obj (sets a MAKEOBJDIR pattern)" @@ -119,7 +120,7 @@ do_removedirs=false makeenv= makewrapper= 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= if type getopts >/dev/null 2>&1; then @@ -178,6 +179,11 @@ while eval $getoptcmd; do case $opt in DESTDIR="$OPTARG"; export DESTDIR makeenv="$makeenv DESTDIR";; + -M) eval $optargcmd; resolvepath + MAKEOBJDIRPREFIX="$OPTARG"; export MAKEOBJDIRPREFIX + makeobjdir=$OPTARG + makeenv="$makeenv MAKEOBJDIRPREFIX";; + -O) eval $optargcmd; resolvepath MAKEOBJDIR="\${.CURDIR:C,^$cwd,$OPTARG,}"; export MAKEOBJDIR makeobjdir=$OPTARG @@ -285,7 +291,7 @@ if [ -z "$TOOLDIR" ] && [ "$MKOBJDIRS" != "no" ]; then 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_ # if [ "$MKOBJDIRS" != "no" ] && [ ! -z "$makeobjdir" ]; then @@ -367,7 +373,7 @@ fi eval cat <