version 1.69, 2002/10/02 16:57:29 |
version 1.70, 2002/10/20 15:48:01 |
|
|
_x_: |
_x_: |
echo \${$1} |
echo \${$1} |
.include <bsd.prog.mk> |
.include <bsd.prog.mk> |
|
.include <bsd.kernobj.mk> |
EOF |
EOF |
} |
} |
|
|
Line 101 resolvepath () { |
|
Line 102 resolvepath () { |
|
} |
} |
|
|
usage () { |
usage () { |
echo "Usage:" |
cat <<_usage_ |
echo "$0 [-bdorUu] [-a arch] [-B buildid] [-j njob] [-m mach] " |
Usage: |
echo " [-w wrapper] [-D dest] [-M obj] [-O obj] [-R release] [-T tools]" |
$0 [-bdorUu] [-a arch] [-B buildid] [-D dest] [-j njob] [-k kernel] |
echo "" |
[-M obj] [-m mach] [-O obj] [-R release] [-T tools] [-w wrapper] |
echo " -a: set MACHINE_ARCH to arch (otherwise deduced from MACHINE)" |
|
echo " -B: set BUILDID to buildid" |
-a arch set MACHINE_ARCH to arch (otherwise deduced from MACHINE) |
echo " -b: build nbmake and nbmake wrapper script, if needed" |
-B buildid set BUILDID to buildid |
echo " -D: set DESTDIR to dest" |
-b build nbmake and nbmake wrapper script, if needed |
echo " -d: build a full distribution into DESTDIR (including etc files)" |
-D dest set DESTDIR to dest |
echo " -j: Run up to njob jobs in parallel; see make(1)" |
-d build a full distribution into DESTDIR (including etc files) |
echo " -M: set obj root directory to obj (sets MAKEOBJDIRPREFIX)" |
-j njob run up to njob jobs in parallel; see make(1) |
echo " -m: set MACHINE to mach (not required if NetBSD native)" |
-k kernel build a kernel using the named configuration file |
echo " -n: show commands that would be executed, but do not execute them" |
-M obj set obj root directory to obj (sets MAKEOBJDIRPREFIX) |
echo " -O: set obj root directory to obj (sets a MAKEOBJDIR pattern)" |
-m mach set MACHINE to mach (not required if NetBSD native) |
echo " -o: set MKOBJDIRS=no (do not create objdirs at start of build)" |
-n show commands that would be executed, but do not execute them |
echo " -R: build a release (and set RELEASEDIR to release)" |
-O obj set obj root directory to obj (sets a MAKEOBJDIR pattern) |
echo " -r: remove contents of TOOLDIR and DESTDIR before building" |
-o set MKOBJDIRS=no (do not create objdirs at start of build) |
echo " -T: set TOOLDIR to tools" |
-R release build a release (and set RELEASEDIR to release) |
echo " -t: build and install tools only (implies -b)" |
-r remove contents of TOOLDIR and DESTDIR before building |
echo " -U: set UNPRIVED" |
-T tools set TOOLDIR to tools |
echo " -u: set UPDATE" |
-t build and install tools only (implies -b) |
echo " -w: create nbmake script at wrapper (default TOOLDIR/bin/nbmake-MACHINE)" |
-U set UNPRIVED |
echo "" |
-u set UPDATE |
echo "Note: if -T is unset and TOOLDIR is not set in the environment," |
-w wrapper create nbmake script at wrapper |
echo " nbmake will be [re]built unconditionally." |
(default TOOLDIR/bin/nbmake-MACHINE) |
|
|
|
Note: if -T is unset and TOOLDIR is not set in the environment, |
|
nbmake will be [re]built unconditionally. |
|
_usage_ |
exit 1 |
exit 1 |
} |
} |
|
|
|
|
MAKEFLAGS= |
MAKEFLAGS= |
buildtarget=build |
buildtarget=build |
do_buildsystem=true |
do_buildsystem=true |
|
do_buildonlykernel=false |
do_buildonlytools=false |
do_buildonlytools=false |
do_rebuildmake=false |
do_rebuildmake=false |
do_removedirs=false |
do_removedirs=false |
makeenv= |
makeenv= |
makewrapper= |
makewrapper= |
opt_a=no |
opt_a=no |
opts='a:B:bdhj:m:nortuw:D:M:O:R:T:U' |
opts='a:B:bdhj:k: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 |
Line 173 while eval $getoptcmd; do case $opt in |
|
Line 179 while eval $getoptcmd; do case $opt in |
|
-j) eval $optargcmd |
-j) eval $optargcmd |
parallel="-j $OPTARG";; |
parallel="-j $OPTARG";; |
|
|
|
-k) do_buildonlykernel=true; do_buildsystem=false |
|
eval $optargcmd |
|
KERNCONFNAME=$OPTARG;; |
|
|
# -m overrides MACHINE_ARCH unless "-a" is specified |
# -m overrides MACHINE_ARCH unless "-a" is specified |
-m) eval $optargcmd |
-m) eval $optargcmd |
MACHINE=$OPTARG; [ "$opt_a" != "yes" ] && getarch;; |
MACHINE=$OPTARG; [ "$opt_a" != "yes" ] && getarch;; |
|
|
if [ -z "$TOOLDIR" ] && [ "$MKOBJDIRS" != "no" ]; then |
if [ -z "$TOOLDIR" ] && [ "$MKOBJDIRS" != "no" ]; then |
$runcmd cd tools |
$runcmd cd tools |
$runcmd $make -m ${TOP}/share/mk obj NOSUBDIR= || exit 1 |
$runcmd $make -m ${TOP}/share/mk obj NOSUBDIR= || exit 1 |
$runcmd cd .. |
$runcmd cd "$TOP" |
fi |
fi |
|
|
# |
# |
Line 412 $runcmd chmod +x "$makewrapper" |
|
Line 422 $runcmd chmod +x "$makewrapper" |
|
|
|
if $do_buildsystem; then |
if $do_buildsystem; then |
${runcmd-exec} "$makewrapper" $parallel $buildtarget |
${runcmd-exec} "$makewrapper" $parallel $buildtarget |
elif $do_buildonlytools; then |
else |
if [ "$MKOBJDIRS" != "no" ]; then |
# One or more of do_buildonlytools and do_buildonlykernel |
$runcmd "$makewrapper" $parallel obj-tools || exit 1 |
# might be set. Do them in the appropriate order. |
|
if $do_buildonlytools; then |
|
if [ "$MKOBJDIRS" != "no" ]; then |
|
$runcmd "$makewrapper" $parallel obj-tools || exit 1 |
|
fi |
|
$runcmd cd tools |
|
if [ "$UPDATE" = "" ]; then |
|
$runcmd "$makewrapper" cleandir dependall install |
|
else |
|
$runcmd "$makewrapper" dependall install |
|
fi |
fi |
fi |
$runcmd cd tools |
if $do_buildonlykernel; then |
if [ "$UPDATE" = "" ]; then |
$runcmd echo "===> Building kernel ${KERNCONFNAME}" |
${runcmd-exec} "$makewrapper" cleandir dependall install |
if [ "$runcmd" = "echo" ]; then |
else |
# shown symbolically with -n |
${runcmd-exec} "$makewrapper" dependall install |
# because getmakevar might not work yet |
|
KERNCONFDIR='${KERNCONFDIR}' |
|
KERNOBJDIR='${KERNOBJDIR}' |
|
else |
|
KERNCONFDIR="$( getmakevar KERNCONFDIR )" |
|
KERNOBJDIR="$( getmakevar KERNOBJDIR )" |
|
fi |
|
case "${KERNCONFNAME}" in |
|
*/*) |
|
kernconfpath=${KERNCONFNAME} |
|
KERNCONFNAME=`basename ${KERNCONFNAME}` |
|
;; |
|
*) |
|
kernconfpath=${KERNCONFDIR}/${KERNCONFNAME} |
|
;; |
|
esac |
|
$runcmd mkdir -p "${KERNOBJDIR}/${KERNCONFNAME}" |
|
if [ "$UPDATE" = "" ]; then |
|
$runcmd cd "${KERNOBJDIR}/${KERNCONFNAME}" |
|
$runcmd "$makewrapper" cleandir |
|
$runcmd cd "$TOP" |
|
fi |
|
$runcmd "${TOOLDIR}/bin/nbconfig" \ |
|
-b "${KERNOBJDIR}/${KERNCONFNAME}" \ |
|
-s "${TOP}/sys" "${kernconfpath}" |
|
$runcmd cd "${KERNOBJDIR}/${KERNCONFNAME}" |
|
$runcmd "$makewrapper" depend |
|
$runcmd "$makewrapper" $parallel all |
|
echo "New kernel should be in ${KERNOBJDIR}/${KERNCONFNAME}" |
fi |
fi |
fi |
fi |