; Generate the Vsys basic toolchain.  Assume the standard directory
; tree.
;
; Successfully running this script twice guarantees that the build
; builds itself.
;
; WARNING:  This script writes over executables in bin.
;
; dnw, 05-Feb-2022

; Build Amistart.ab, Crt0.y, Vtoex_n.
cd IOst
cd
delete Amistart.ab *.y quiet  ;preemptive deletion for RENAME in NS.s
execute NS.s
execute Vtoex.s 
copy Amistart.ab /lib clone
echo "Copied Amistart.ab to /lib."
copy Crt0.y /lib clone
echo "Copied Crt0.y to /lib."
delete Amistart.ab *.y *.o quiet

; Build AAma13
cd /ASM
cd
execute AA13.s
delete *.y *.o quiet

; Build Link13
cd /Load
cd
execute L13.s
delete *.y *.o  quiet

; Build Das13 and Ldo13, build and install Deb.ab and Dis.ab.
cd /DBG
cd
execute Das13.s
execute Ldo13.s
delete *.y *.o quiet

; Build Ved13
cd /ed
cd
execute Ved13.s
delete *.y *.o quiet

; Build Schip13
cd /TSCHIP
cd
execute Schip13.s
delete *.y *.yy quiet

; Install executables in bin.
cd /
cd
copy IOst/Vtoex_n bin/Vtoex clone
echo "Copied IOst/Vtoex_n to bin/Vtoex."
delete IOst/Vtoex_n quiet
copy ASM/AAma13 bin/AAma clone
echo "Copied ASM/AAma13 to bin/AAma."
delete ASM/AAma13 quiet
copy Load/Link13 bin/Link clone
echo "Copied Load/Link13 to bin/Link."
delete Load/Link13 quiet
copy DBG/Das13 bin/Das clone
echo "Copied DBG/Das13 to bin/Das."
copy DBG/Ldo13 bin/Ldo clone
echo "Copied DBG/Ldo13 to bin/Ldo."
delete DBG/Das13 DBG/Ldo13 quiet
copy DBG/Deb13.ab lib/Deb.ab clone
echo "Copied DBG/Deb13.ab to lib/Deb.ab."
copy DBG/Dis13.ab lib/Dis.ab clone
echo "Copied DBG/Dis13.ab to lib/Dis.ab."
delete DBG/*.ab quiet
copy ed/Ved13 bin/V clone
echo "Copied ed/Ved13 to bin/V."
delete ed/Ved13 quiet
copy TSCHIP/Schip13 bin/Schip clone
echo "Copied TSCHIP/Schip13 to bin/Schip"
delete TSCHIP/Schip13 quiet
