Auto-bootstrap on mbld failure.
@@ -7,17 +7,23 @@ if test `uname` = Plan9; then
export MYR_MUSE=`pwd`/muse/$O.out
export MYR_MC=`pwd`/6/$O.out
export MYR_RT=`pwd`/rt/_myrrt.$O
- BOOT="./mk/bootstrap/bootstrap+`uname -s`-`uname -m`.sh"
else
export MYR_MUSE=muse
export MYR_MC=6m
export MYR_RT=`pwd`/rt/_myrrt.o
- BOOT="./mk/bootstrap/bootstrap+`uname -s`-`uname -m`.sh"
fi
+BOOT="./mk/bootstrap/bootstrap+`uname -s`-`uname -m`.sh"
-if [ -f mbld/mbld ] || [ -f obj/mbld/mbld ]; then
- ./obj/mbld/mbld $@ || ./mbld/mbld $@ || mbld $@ || \
- (echo "Unable to run mbld $@; have you build successfully"; false)
-else
- mbld || $BOOT
+MBLD=mbld
+if [ -f obj/mbld/mbld ]; then
+ MBLD=obj/mbld/mbld
+elif [ -f mbld/mbld ]; then
+ MBLD=mbld/mbld
fi
+
+bootstrap() {
+ ($BOOT && mbld/mbld $@) || \
+ (echo "Unable to run mbld $@; have you build successfully"; exit 1)
+}
+
+$MBLD $@ || bootstrap $@
