# Generate the Vsys toolchain for NeXT.  Assume the standard
# directory tree with this file at /usr/GenVsys.s.
#
# Successfully running this script twice guarantees that the build
# builds itself.
#
# dnw, 05-Feb-2022

# Build AAma15.
cd ASM
pwd
AA15.s
rm *.y

# Build Link15.
cd ../Load
pwd
L15.s
rm *.y

# Build Das15, Ldo15, Deb15.ab, and Dis15.ab.
cd ../DBG
pwd
Das15.s
Ldo15.s
rm *.y

# Build Ved15
cd ../ed
pwd
Ved15.s
rm *.y

# Build Schip.yy with IOst.y, test it with Ldo, and build Schip.
cd ../TSCHIP
pwd
Schip15.s
rm *.y *.yy

# Install in usr/bin and /usr/lib.
cd ..
pwd
mv ASM/AAma15 bin/AAma
echo "Moved ASM/AAma15 to bin/AAma."
mv Load/Link15 bin/Link
echo "Moved Load/Link15 to bin/Link."
mv DBG/Das15 bin/Das
echo "Moved DBG/Das/15 to bin/Das15."
mv DBG/Ldo15 bin/Ldo
echo "Moved DBG/Ldo15 to bin/Ldo15."
mv DBG/Deb15.ab lib/Deb.ab
echo "Moved DBG/Deb15.ab to lib/Deb.ab."
mv DBG/Dis15.ab lib/Dis.ab
echo "Moved DBG/Dis15.ab to lib/Dis.ab."
mv ed/Ved15 lib/V
echo "Moved ed/Ved15 to lib/V."
mv TSCHIP/Schip15 bin/Schip
echo "Moved TSCHIP/Schip15 to bin/Schip."
