	.ENABLE GLOBAL
	.ENABLE SUBSTITUTION
	;
	;	Building COR -- Program to create partitions out of GEN
	;	  and	 SPC -- Program to checkpoint tasks out of GEN
	.SETF SRCDEV
	.IFNDF $TKB .SETS $TKB "TKB"
	.IFDF $SRC .GOTO SRCOK
	.SETS $SRC COMMAN
	.PARSE $SRC " " $SRC DUMMY
	.PARSE $SRC "/" $SRC DUMMY
	.PARSE $SRC "." $SRC EXT
	.IF EXT EQ "" .SETS EXT "CMD"
	.TESTFILE '$SRC'.'EXT'
	.PARSE <FILSPC> ":" $SRC TEMP
	.TESTFILE SY:
	.PARSE <FILSPC> ":" SYDEV TEMP
	.IF $SRC EQ SYDEV .SETT SRCDEV
	.SETS $SRC $SRC+":"
.SRCOK:	.SETF Q
	.IFDF $LST .AND .IFDF $MP .GOTO CHKMP
	.ASK Q Generate listings
	.IFT Q .SETS $LST ""
	.IFF Q .SETS $LST "NL:"
	.SETF Q
	.ASK Q Generate maps
	.IFT Q .SETS $MP ""
	.IFF Q .SETS $MP "NL:"
.CHKMP:	;
	SLP @'$SRC''<UIC>'COR.COR
	MAC COR,'$LST'COR/-SP=LB:[1,1]EXEMC/ML,[11,10]RSXMC,SY:'<UIC>'COR
	SLP @'$SRC''<UIC>'SPC4.COR
	MAC SPC,'$LST'SPC/-SP=LB:[1,1]EXEMC/ML,[11,10]RSXMC,SY:'<UIC>'SPC4
	PIP COR.MAC;*/DE,SPC4.MAC;*
	.OPEN CORTKB.CMD
	.DATA COR/PR/CP,'$MP'COR/-SP=COR,LB:[1,54]RSX11M.STB/SS
	.DATA /
	.DATA STACK=90
	.DATA TASK=...COR
	.DATA ASG=TI:1
	.DATA UNITS=1
	.DATA ACTFIL=1
	.DATA //
	.CLOSE
	.OPEN SPCTKB.CMD
	.DATA SPC/PR/MM/CP/AL/-FP,'$MP'SPC/-SP=SPC
	.DATA LB:[1,54]RSX11M.STB,[1,1]EXELIB/LB
	.DATA /
	.DATA WNDWS=2
	.DATA TASK=...SPC
	.DATA STACK=10
	.DATA PRI=105
	.DATA UNITS=0
	.DATA //
	.CLOSE
	'$TKB' @CORTKB
	'$TKB' @SPCTKB
	PIP CORTKB.CMD;*/DE,COR.OBJ;*,SPCTKB.CMD;*,SPC.OBJ;*
