summaryrefslogtreecommitdiff
path: root/genbootstrap.sh
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2015-05-15 18:41:45 -0700
committerOri Bernstein <ori@eigenstate.org>2015-05-15 18:42:21 -0700
commit7ace115b8b37597f31927ce993d0e6f6afa799e1 (patch)
tree56332638bed8ef2cf8ad57b0c79080535917d2ff /genbootstrap.sh
parent609ec770191522854da18e8f6095a86ce61882ab (diff)
downloadmc-7ace115b8b37597f31927ce993d0e6f6afa799e1.tar.gz
Add one bootstrap file per system.
We may have different build orders, so we want one bootstrap file per system.
Diffstat (limited to 'genbootstrap.sh')
-rwxr-xr-xgenbootstrap.sh34
1 files changed, 21 insertions, 13 deletions
diff --git a/genbootstrap.sh b/genbootstrap.sh
index fafee06..09c7aad 100755
--- a/genbootstrap.sh
+++ b/genbootstrap.sh
@@ -1,23 +1,31 @@
-#!/usr/bin/env bash
+#!/bin/sh
+
+if test `uname` = Plan9; then
+ export MYR_MUSE=../muse/6.out
+ export MYR_MC=../6/6.out
+ export MYR_RT=../rt/_myrrt.$O
+else
+ export MYR_MUSE=../muse/muse
+ export MYR_MC=../6/6m
+ export MYR_RT=../rt/_myrrt.o
+fi
-export MYR_MUSE=../muse/muse
-export MYR_MC=../6/6m
-export MYR_RT=../rt/_myrrt.o
./mbldwrap.sh
cp mbld/mbld xmbld
./xmbld clean
+
# The generated shell script should be a compatible bourne
# shell script.
-bootscript=bootstrap+`uname -s`-`uname -m`
-echo '#!/bin/sh' > bootstrap.sh
-echo 'pwd=`pwd`' >> bootstrap.sh
+bootscript=mk/bootstrap/bootstrap+`uname -s`-`uname -m`.sh
+echo '#!/bin/sh' > $bootscript
+echo 'pwd=`pwd`' >> $bootscript
./xmbld -Rnone | \
- sed "s:Entering directory '\\(.*\\)':\tcd \$pwd/\\1:g" | \
- sed "s:Leaving directory.*:\tcd \$pwd:g" | \
+ sed "s:Entering directory '\\(.*\\)': cd \$pwd/\\1:g" | \
+ sed "s:Leaving directory.*: cd \$pwd:g" | \
sed "s:\\([a-zA-Z0-9_-]*\\)+.*:\`\$pwd/sysselect.sh \1\`:" | \
- grep $'^\t' | \
- sed $'s/.*/echo &\\\n&/' | \
- tee -a bootstrap.sh
-chmod +x bootstrap.sh
+ grep '^ ' | \
+ sed 's/.*/echo &;&/' | \
+ tee -a $bootscript
+chmod +x $bootscript
rm ./xmbld