.ENABLE SUBSTITUTION
.ENABLE ESCAPE
.SETS TASK "LNK"
;
;		SSA Linker Task Build Command File
;
;		Builds the "LNK" task from scratch
;
;
.SETS $UIC <UIC>
.SETS $DISK <SYDISK>
.SETN UNIT <SYUNIT>
.SETF LIB
.SETF FCS
.DEVICE:
.ASK LIB DO YOU WISH TO BUILD THE NON-FCSRES VERSION OF THE LINKER
.IFF LIB .ASK FCS DO YOU WISH TO BUILD THE FCSRES VERSION OF THE LINKER
.IFT LIB .ASK FCS DO YOU WISH TO BUILD THE FCSRES VERSION OF THE LINKER ALSO
;
;	The resulting task or tasks will be placed in uic [31,54] 
;	on '$DISK''UNIT':
;	If a copy of the tasks are needed on another device, such as the
;	SYSTEM disk then answer the next question with that device.
;	A CARRAGE RETURN will indicate no other device.
;
;Enter target DEVICE and UNIT number for the additional 
.ASKS DV 'TASK' modules.
.IF <STRLEN> EQ 0 .SETS DV "NL"
ASN 'DV':=TK:
.IF <STRLEN> EQ 0 .GOTO PROCES
.TESTFILE 'DV':[0,0]INDEXF.SYS
.IF <FILERR> NE 1 .GOTO DSKERR
.PROCES:
;
.ASKS LDV Enter the DEVICE and UNIT number for listings ( default = NL:)
.IF <STRLEN> EQ 0  .SETS LDV "NL"
ASN 'LDV':=LS:
.IF LDV EQ "NL" .GOTO MAPS
.TESTFILE LS:[0,0]INDEXF.SYS
.IF <FILERR> NE 1 .GOTO DSKERR
;
.MAPS:
.ASKS MAPS Enter the DEVICE and UNIT number for maps ( default = NL:)
.IF <STRLEN> EQ 0  .SETS MAPS "NL"
ASN 'MAPS':=MP:
.IF MAPS EQ "NL" .GOTO SETUP
.TESTFILE MP:[0,0]INDEXF.SYS
.IF <FILERR> EQ 1 .GOTO SETUP
;
.DSKERR:
;
;	*****	Device not Mounted or Allocated
;
.GOTO DONE
.SETUP:
SET /UIC=[31,24]
;
;		Assemble all macro files
;
PIP [31,20]*.OBJ;*/DE
.IF LDV NE "NL" PIP LS:[31,34]*.LST;*/DE
.TESTFILE [31,20]SSALNK.OLB
.IF <FILERR> EQ 1 PIP [31,20]SSALNK.OLB;*/DE
.TESTFILE [31,20]SSALNKOLB.DIR
.IF <FILERR> EQ 1 PIP [31,20]SSALNKOLB.DIR;*/DE
SLP @[31,40]HEADR.SLP
MAC @SSALNKMAC
;
;		Build Linker Object Library File
;
PIP [31,20]SSALNK.OBS=[31,20]*.OBJ
PIP [31,20]*.OBJ;*/DE
LBR [31,20]SSALNK/CR:250.:128./-EP=[31,20]SSALNK.OBS
.WAIT LBR
LBR [31,20]SSALNK.OLB,SSALNKOLB.DIR/LE/FU/-SP
.WAIT LBR
PIP [31,20]SSALNK.OLB/PU
PIP [31,20]SSALNK.OLB/TR
PIP [31,20]SSALNK.OBS;*/DE
.IFF FCS GOTO NFCS
;
;		Build task using FCS Resident Library
;
.IF LDV EQ "NL" .GOTO 100
.TESTFILE MP:[31,34]SSALNKFCS.MAP
.IF <FILERR> EQ 1 PIP MP:[31,34]SSALNKFCS.MAP;*/DE
.100:
.TESTFILE [31,54]SSALNKFCS.TSK
.IF <FILERR> EQ 1 PIP [31,54]SSALNKFCS.TSK;*/DE
TKB @SSALNKFCS
.WAIT TKB
.IF LDV NE "NL" PIP MP:[31,34]SSALNKFCS.MAP/TR
PIP [31,54]SSALNKFCS.TSK/TR
.IF DV NE "NL" PIP TK:[31,54]/NV=[31,54]SSALNKFCS.TSK
.NFCS:
.IFF LIB GOTO DONE
;
;		Build task using System Library
;
.IF LDV EQ "NL" .GOTO 200
.TESTFILE MP:[31,34]SSALNKSLB.MAP
.IF <FILERR> EQ 1 PIP MP:[31,34]SSALNKSLB.MAP;*/DE
.200:
.TESTFILE [31,54]SSALNKSLB.TSK
.IF <FILERR> EQ 1 PIP [31,54]SSALNKSLB.TSK;*/DE
TKB @SSALNKSLB
.WAIT TKB
.IF LDV NE "NL" PIP MP:[31,34]SSALNKSLB.MAP/TR
PIP [31,54]SSALNKSLB.TSK/TR
.IF DV NE "NL" PIP TK:[31,54]/NV=[31,54]SSALNKSLB.TSK
;
;		Linker Build Complete
;
.DONE:
ASN =
SET /UIC='$UIC'
.EXIT
