summaryrefslogtreecommitdiff
path: root/genbootstrap.sh
blob: 7ce0fbf1e0edf7042b5ec859a3b1a4bb44f91954 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/bin/sh
set -x

if test `uname` = Plan9; then
    export MYR_MUSE=`pwd`/muse/6.out
    export MYR_MC=`pwd`/6/6.out
    export MYR_RT=`pwd`/rt/_myrrt.6
else
    export MYR_MUSE=`pwd`/muse/muse
    export MYR_MC=`pwd`/6/6m
    export MYR_RT=`pwd`/rt/_myrrt.o
fi

./mbldwrap.sh
cp obj/mbld/mbld xmbld
./xmbld clean

# The generated shell script should be a compatible bourne
# shell script.
bootscript=mk/bootstrap/bootstrap+`uname -s`-`uname -m`.sh
echo '#!/bin/sh' > $bootscript
echo '# This script is generated by genbootstrap.sh' >> $bootscript
echo '# to regenerate, run "make bootstrap"' >> $bootscript
echo 'pwd=`pwd`' >> $bootscript
./xmbld -j1 -Bnone mbld:mbld | \
    sed "s:^\\(.*\\)/[^/]*\.\.\.:	cd \$pwd/\\1:g" | \
    sed "s:`pwd`:\$pwd:g" | \
    grep '^	' | \
    sed 's/.*/echo & \&\& & \&\&\\/' | \
    tee -a $bootscript
echo 'true' >> $bootscript
chmod +x $bootscript
#rm ./xmbld