# Script to build U/W FOCAL from source to create
# uwfocal.rk05 install image.
# We build with the OS8_TOOLTIME packs: v3d-patched.rk05

mount rk0 $os8mo/v3d-patched.rk05 required scratch
mount rk1 $os8mo/uwfocal.rk05 
boot rk0

os8 ZERO RKA1:
os8 ZERO RKB1:

# Copy source files onto the tape image.
# PAL Sources
cpto $src/src/uwfocal/12KFNS.PA RKA1:
cpto $src/src/uwfocal/16KCPR.PA RKA1:
cpto $src/src/uwfocal/16KLIB.PA RKA1:
cpto $src/src/uwfocal/16KXII.PA RKA1:
cpto $src/src/uwfocal/16MPLT.PA RKA1:
cpto $src/src/uwfocal/32KXII.PA RKA1:
cpto $src/src/uwfocal/8XFIO.PA RKA1:
cpto $src/src/uwfocal/8XFPP.PA RKA1:
cpto $src/src/uwfocal/8NFIO.PA RKA1:
cpto $src/src/uwfocal/8NFPP.PA RKA1:
cpto $src/src/uwfocal/8NT.PA RKA1:
cpto $src/src/uwfocal/BSLASH.PA RKA1:
cpto $src/src/uwfocal/FCOM45.PA RKA1:
cpto $src/src/uwfocal/FCOM47.PA RKA1:
cpto $src/src/uwfocal/LPT8I.PA RKA1:
    # Documentation
cpto $src/src/uwfocal/CARD1.DA RKA1:
cpto $src/src/uwfocal/CARD2.DA RKA1:
cpto $src/src/uwfocal/CARD3.DA RKA1:
cpto $src/src/uwfocal/CARD4.DA RKA1:
cpto $src/src/uwfocal/ERRORS.FD RKA1:
cpto $src/src/uwfocal/NOTE1.TX RKA1:
cpto $src/src/uwfocal/NOTE2.TX RKA1:
cpto $src/src/uwfocal/HEADER.HL RKA1:
    # Text file containing FOCAL Floating Point tests
cpto $src/src/uwfocal/FPTEST.TX RKA1:
    # Focal Compiled binary blobs.
cpto $src/src/uwfocal/12DEMO.FC RKA1: /I
cpto $src/src/uwfocal/2NDEMO.FC RKA1: /I
cpto $src/src/uwfocal/AXIS.FC RKA1: /I
cpto $src/src/uwfocal/AXISET.FC RKA1: /I
cpto $src/src/uwfocal/CONVRT.FC RKA1: /I
cpto $src/src/uwfocal/CRSHAR.FC RKA1: /I
cpto $src/src/uwfocal/DATE.FC RKA1: /I
cpto $src/src/uwfocal/EIGVAL.FC RKA1: /I
cpto $src/src/uwfocal/EIGVEC.FC RKA1: /I
cpto $src/src/uwfocal/EVDEMO.FC RKA1: /I
cpto $src/src/uwfocal/FILNAM.FC RKA1: /I
cpto $src/src/uwfocal/HEADER.FC RKA1: /I
cpto $src/src/uwfocal/LOWPAS.FC RKA1: /I
cpto $src/src/uwfocal/LSTSQR.FC RKA1: /I
cpto $src/src/uwfocal/PLCARD.FC RKA1: /I
cpto $src/src/uwfocal/PLDEMO.FC RKA1: /I
cpto $src/src/uwfocal/PLOTER.FC RKA1: /I
cpto $src/src/uwfocal/SKETCH.FC RKA1: /I
cpto $src/src/uwfocal/SMSORT.FC RKA1: /I
cpto $src/src/uwfocal/UWFOCL.FC RKA1: /I
cpto $src/src/uwfocal/VUDEMO.FC RKA1: /I
cpto $src/src/uwfocal/XYAXIS.FC RKA1: /I

# Binary blobs we don't yet build
# When the build system evolves
# to reliably build them, remove this block.

cpto $src/src/uwfocal/16KXII.BN RKA1: /I
cpto $src/src/uwfocal/16MPLT.BN RKA1: /I
cpto $src/src/uwfocal/32KXII.BN RKA1: /I
cpto $src/src/uwfocal/BSLASH.BN RKA1: /I
cpto $src/src/uwfocal/F32K4E.SV RKA1: /I
cpto $src/src/uwfocal/FCOM45.BN RKA1: /I
cpto $src/src/uwfocal/FCOM47.BN RKA1: /I
cpto $src/src/uwfocal/LPT8I.BN RKA1: /I
cpto $src/src/uwfocal/SCROLL.SV RKA1: /I

# These commands are a mess because we hit the limit
# of the OS/8 command line.

pal8 U.BN,RKB1:U.LS<RKA1:16KCPR,12KFNS,8XFIO,8XFPP,16KLIB /K
os8 COPY RKA1:UWF16K.BN<U.BN
os8 DELETE U.BN
os8 RENAME RKB1:UWF16K.LS<RKB1:U.LS
os8 MAP RKB1:UWF16K.MP<RKA1:UWF16K.BN

pal8 U.BN,RKB1:U.LS<RKA1:16KCPR,12KFNS,8NFIO,8NFPP,16KLIB /K
os8 COPY RKA1:UWFNOE.BN<U.BN
os8 DELETE U.BN
os8 RENAME RKB1:UWFNOE.LS<RKB1:U.LS
os8 MAP RKB1:UWFNOE.MP<RKA1:UWFNOE.BN

pal8 U.BN,RKB1:U.LS<RKA1:16KCPR,12KFNS,8NT,8NFIO,8NFPP,16KLIB /K
os8 COPY RKA1:UWFTST.BN<U.BN
os8 DELETE U.BN
os8 RENAME RKB1:UWFTST.LS<RKB1:U.LS
os8 MAP RKB1:UWFTST.MP<RKA1:UWFTST.BN

os8 LOAD RKA1:UWF16K.BN
os8 SAVE RKA1:UWF16K.SV;100
os8 LOAD RKA1:UWFNOE.BN
os8 SAVE RKA1:UWFNOE.SV;100
os8 LOAD RKA1:UWFTST.BN
os8 SAVE RKA1:UWFTST.SV;100

patch $src/src/uwfocal/eae-modeb-clear.patch8


