.Enable Substitution
.disable lowercase
;
; VFGEN.CMD -- Build the VF: Virtual Disk Package for your system.

	.setn exstat -1
	.sets $link "Tkb"
	.If <CLI> Eq "DCL" .Sets $link "Link"
	.sets $rsxmc "LB:[11,10]RSXMC.MAC"
	.sets $exemc "LB:[1,1]EXEMC.MLB"
	.sets $exelb "LB:[1,1]EXELIB.OLB"
	.sets $rsx11 "LB:"+<Sysuic>+"RSX11M.STB"
	.sets $vec11 "LB:"+<Libuic>+"RSXVEC.STB"

.10:
	;
	; Enter system configuration file specification
	.asks s                if different from '$rsxmc'
	;
	.if <strlen> ne 0 .sets $rsxmc s
	.gosub lookup '$rsxmc'
	.if <filerr> ne 1 .goto 10

.20:
	; Enter Executive Macro Library file specification
	.asks s                if different from '$exemc'
	;
	.if <strlen> ne 0 .sets $exemc s
	.gosub lookup '$exemc'
	.if <filerr> ne 1 .goto 20

.30:
	; Enter Executive Object Library file specification
	.asks s                if different from '$exelb'
	;
	.if <strlen> ne 0 .sets $exelb s
	.gosub lookup '$exelb'
	.if <filerr> ne 1 .goto 30

.40:
	; Enter Symbol Table file specification for current system 
	.asks s                if different from '$rsx11'
	;
	.if <strlen> ne 0 .sets $rsx11 s
	.gosub lookup '$rsx11'
	.if <filerr> ne 1 .goto 40

.50:
	; Enter Executive Vector Symbol Table file specification
	.asks s                if different from '$vec11'
	;
	.if <strlen> ne 0 .sets $vec11 s
	.gosub lookup '$vec11'
	.if <filerr> ne 1 .goto 50

.60:
	.sets $fcsrs ";"
	.Ask L Do you want to link to FCSRES
	;
	.ift L .sets $fcsrs ""
	.sets ls "NL:"
	.ask L Do you want assembly listings
	;
	.ift L .sets ls ""
	.sets mp "NL:"
	.ask L Do you want task build maps
	;
	.ift L .sets mp ""

.70:
	.asks s Do you want to (C) Continue, (P) Pause, (R) Repeat, or (E) Exit
	.if <strlen> eq 0 .goto 70
	.if s eq "C" .goto 80
	.if s eq "E" .exit 0
	.if s eq "R" .Goto 10
	.if s ne "P" .goto 70
	.pause
	.goto 70
	
.80:
	.open vfdrvasm.cmd
	.enable data
;
; VFDRVASM.CMD -- MACRO-11 Command File for assembling VF Driver sources
;
; Created on '<date>' at '<time>'
;
VFDRV ,'LS'VFDRV /-SP='$exemc'/ML,'$rsxmc'/PA:1,-
                      SY:'<uic>'VFPRE     ,VFDRV
VFTAB ,'LS'VFTAB /-SP='$exemc'/ML,'$rsxmc'/PA:1,-
                      SY:'<uic>'VFPRE/PA:1,VFTAB
.disable data
	.close

	.open avfasm.cmd
	.enable data
;
; AVFASM.CMD -- MACRO-11 Command File for assembling AVF sources
;
; Created on '<date>' at '<time>'
;
AVF   ,'LS'AVF   /-SP='$exemc'/ML,'$rsxmc'/PA:1,-
                      SY:'<uic>'VFPRE/PA:1,AVF
AVFERR,'LS'AVFERR/-SP='$exemc'/ML,'$rsxmc'/PA:1,-
                      SY:'<uic>'VFPRE/PA:1,AVFERR
AVFHRC,'LS'AVFHRC/-SP='$exemc'/ML,'$rsxmc'/PA:1,-
                      SY:'<uic>'VFPRE/PA:1,AVFHRC
.disable data
	.close

	.open dvfasm.cmd
	.enable data
;
; DVFASM.CMD -- MACRO-11 Command File for assembling DVF utility
;
; Created on '<date>' at '<time>'
;
DVF   ,'LS'DVF   /-SP='$exemc'/ML,'$rsxmc'/PA:1,-
                      SY:'<uic>'VFPRE/PA:1,DVF
DVFERR,'LS'DVFERR/-SP='$exemc'/ML,'$rsxmc'/PA:1,-
                      SY:'<uic>'VFPRE/PA:1,DVFERR
.disable data
	.close
.;
.; Create Task Build Command files
.;
	.open vfdrvbld.cmd
	.enable data
;
; VFDRVBLD.CMD  --  RSX-11M-PLUS loadable VF: driver build command file
;
; Created on '<date>' at '<time>'
;
VFDRV/-MM/-HD,'MP'VFDRV/SH/-SP,SY:VFDRV=
VFDRV,VFTAB
'$rsx11'/SS
'$exelb'/LB
/
STACK=0
PAR=DRVPAR:120000:20000
/
.disable data
	.close

	.open avfbld.cmd
	.enable data
;
; AVFBLD.CMD -- Task Build Command file for AVF Utility
;
; Created on '<date>' at '<time>'
;
AVF/PR/CP/-IP/-FP,'MP'AVF/SH/-SP=AVF,AVFERR,AVFHRC
'$vec11'/SS
'$exelb'/LB
VFDRV.STB/SS
/
STACK=64
UNITS=4
ASG=TI:1:2
ASG=SY:3:4
TASK=...AVF
PRI=70
'$fcsrs'LIBR=FCSRES:RO
;
; The default file protection for container files created by AVF
; is [RW,RW,RW,]; that is, System, Owner, and Group have read and write
; privileges. This can be changed by enabling the following GBLDEF option
; and specifying your preferred protection in binary. Recall that binary
; protection is specified as:
;
;	[System, Owner, Group, World]
;
; with each being specified as a four bit mask in the order DEWR ("D" being
; most significant). A "1" denies protection while "0" allows it.
;
;GBLDEF=DEFPRO:176314			; File protection [RW,RW,RW,]
;
//
.disable data
	.close

	.open dvfbld.cmd
	.enable data
;
; DVFBLD.CMD -- Task Build Command file for DVF Utility
;
; Created on '<date>' at '<time>'
;
DVF/PR/CP/-IP/-FP,'MP'DVF/-SP/SH=DVF,DVFERR
'$vec11'/SS
'$exelb'/LB
/
STACK=64
UNITS=4
ASG=TI:1:2
ASG=SY:3:4
TASK=...DVF
PRI=70
'$fcsrs'LIBR=FCSRES:RO
//
.disable data
	.close

;
; Assembly phase...
;
.100:
	Macro @VFDRVASM.CMD
	.If <Exstat> Eq 1 .Goto 110
	.if <Exstat> gt Exstat .Setn Exstat <Exstat>
.105:
	.asks s Do you want to (C) Continue, (P) Pause, (R) Repeat, or (E) Exit
	.if <strlen> eq 0 .goto 105
	.if s eq "C" .goto 110
	.if s eq "E" .exit 0
	.if s eq "R" .Goto 100
	.if s eq "P" .pause
	.goto 105
.110:
	Macro @AVFASM.CMD
	.If <Exstat> EQ 1 .Goto 120
	.if <Exstat> gt Exstat .Setn Exstat <Exstat>
.115:
	.asks s Do you want to (C) Continue, (P) Pause, (R) Repeat, or (E) Exit
	.if <strlen> eq 0 .goto 115
	.if s eq "C" .goto 120
	.if s eq "E" .exit 0
	.if s eq "R" .Goto 110
	.if s eq "P" .pause
	.goto 115
.120:
	Macro @DVFASM.CMD
	.If <Exstat> Eq 1 .Goto 130
	.if <Exstat> gt Exstat .Setn Exstat <Exstat>
.125:
	.asks s Do you want to (C) Continue, (P) Pause, (R) Repeat, or (E) Exit
	.if <strlen> eq 0 .goto 125
	.if s eq "C" .goto 130
	.if s eq "E" .exit 0
	.if s eq "R" .Goto 120
	.if s eq "P" .pause
	.goto 125
.130:
	;
	; Task Build phase...
	;
.140:
	'$Link' @VFDRVBLD.CMD
	.If <Exstat> Eq 1 .Goto 150
	.if <Exstat> gt Exstat .Setn Exstat <Exstat>
.145:
	.asks s Do you want to (C) Continue, (P) Pause, (R) Repeat, or (E) Exit
	.if <strlen> eq 0 .goto 145
	.if s eq "C" .goto 150
	.if s eq "E" .exit 0
	.if s eq "R" .Goto 140
	.if s eq "P" .pause
	.goto 145
.150:
	'$Link' @AVFBLD.CMD
	.If <Exstat> Eq 1 .Goto 160
	.if <Exstat> gt Exstat .Setn Exstat <Exstat>
.155:
	.asks s Do you want to (C) Continue, (P) Pause, (R) Repeat, or (E) Exit
	.if <strlen> eq 0 .goto 155
	.if s eq "C" .goto 160
	.if s eq "E" .exit 0
	.if s eq "R" .Goto 150
	.if s eq "P" .pause
	.goto 155
.160:
	'$Link' @DVFBLD.CMD
	.If <Exstat> Eq 1 .Goto 170
	.if <Exstat> gt Exstat .Setn Exstat <Exstat>
.165:
	.asks s Do you want to (C) Continue, (P) Pause, (R) Repeat, or (E) Exit
	.if <strlen> eq 0 .goto 165
	.if s eq "C" .goto 170
	.if s eq "E" .exit 0
	.if s eq "R" .Goto 160
	.if s eq "P" .pause
	.goto 165
.170:
	;
	; VFGEN.CMD Completed
	;
	.If Exstat Eq -1 .Setn Exstat 1
	.Exit 'Exstat'

.lookup:
	.testfile 'comman'
	.if <filerr> eq 1 .return
	;
	; Lookup error on 'comman'. 
	;
.look10:
	.asks s Do you want to (C) Continue, (P) Pause, or (E) Exit
	.if <strlen> eq 0 .goto look10
	.if s eq "C" .return
	.if s eq "E" .exit 0
	.if s ne "P" .goto look10
	.pause
	.goto look10
