.;
.; GENPRJ.CMD
.; 	UNIVERSIAL GEN COMMAND FILE
.;
.; EDIT NUMBER = 0000
.;
.;
	.ENABLE GLOBAL
	.ENABLE SUBSTITUTION
	.SETS REFUIC "[76,12]"
.;
.; VARIABLES USED:
.;
.;	$PROC1 => PROCESS 1 (MAC ,PAS, ETC)
.;	$PROC2 => PROCESS 2 ( PROBALB ALWAYS MAC OR "")
.;	$DFOUC => DEFAULT UIC FOR PLACEMENT OF OLB FILES (ONLY IF AUTO)
.;	$DFSUC => DEFAULT UIC FOR AUTO ANSWERS (ONLY IF AUTO DEFINED)
.;	$AUTO => DO NOT ASK QUESTIONS
.;	$SRCLB => NAME OF SOURCE LIBRARY FILE
.;	$INFIL => NAME OF FILE OF NAMES
.;	$LSUIC => LISTING UIC
.;	$OBUIC => OBJECT UIC
.;	$SRUIC => SOURCE UIC
.;	$LSDEV => LIST DEVICE
.;	$OBDEV => OBJECT DEVICE
.;	$SRDEV => SOURCE DEVICE
.;	$LSOPT => LISTING OPTIONS
.;	$ASPRF => PREFIX FILES FOR ASSEMBLY
.;	$LIBNM => NAME OF OBJ LIBRARY
.;	$DNSFL => DEFAULT NAME OF ANSWER OUTPUT
.;	$DNANS => DEFAULT NAME OF ANSWER SOURCE
.;	$GRUP => GROUP NUMBER
.;	$MEM  => MEMBER NUMBER
.;	$LIST => LISTING DESIRED
.;
.;	SET DEFAULT VALUES
	.SETS NEWANS ""
	.SETS ANSFIL ""
	.IFNDF $AUTO .SETS $DFOUC ""
	.IFNDF $AUTO .SETS $DFSUC ""
	.IFNDF $AUTO .SETF $AUTO
.;
	.PARSE <UIC> "[,]" A $GRUP $MEM A
	.SETS A ""
	.IFNDF $PRJPF .ASKS $PRJPF 3 CHARACTER PROCESS PREFIX
	@['$GRUP',200]'$PRJPF'INIT
	.IFT $AUTO .SETF WANS
	.IFT $AUTO .SETT RANS
	.IFT $AUTO .SETS ANSFIL $DNSFL
	.IFT $AUTO .GOTO AUTOQ
.NOANS:
	.ASK RANS DO YOU WANT TO USE A PREDEFINED ANSWER FILE
	.IFF RANS .GOTO NEXT
	.ASKS ANSFIL WHAT IS THE FILE NAME IF NOT '$DNSFL'
	.IF ANSFIL = "" .SETS ANSFIL $DNSFL
	.TESTFILE '$DFSUC' 'ANSFIL'
	.IF <FILERR> NE 1 .GOTO NOANS
.NEXT:
	.ASK WANS DO YOU WANT TO MAKE AN ANSWER FILE
	.IFT WANS .ASKS NEWANS WHAT IS THE FILE NAME IF NOT '$DNANS'
	.IF NEWANS = "" .SETS NEWANS $DNANS
.AUTOQ:
	.IFT RANS @'$DFSUC''ANSFIL'
.; ASK FOR ASSEMBLY INFORMATION
	@'REFUIC'ASMGEN

	.IFF WANS .GOTO ASSM
	.OPEN #0 'NEWANS'
.ENABLE DATA
 .;
 .; 'NEWANS' - SAVED ANSWER FILE
 .;
 	.SETS $INFIL "'$INFIL'"
	.SETS $LSUIC "'$LSUIC'"
	.SETS $OBUIC "'$OBUIC'"
	.SETS $SRUIC "'$SRUIC'"
	.SETS $LSDEV "'$LSDEV'"
	.SETS $OBDEV "'$OBDEV'"
	.SETS $SRDEV "'$SRDEV'"
	.SETS $LSOPT "'$LSOPT'"
	.SETS $ASPRF "'$ASPRF'"
	.SET'$LIST' $LIST
.DISABLE DATA
	.CLOSE #0
.ASSM:
.; EXTRACT FROM SRC LIBR
LBR @'$SRUIC''$PRJPF'EXT
.; ASSEMBLE 
	'$PROC1' @'$SRUIC''$PRJPF''$PROC1'
	.IF $PROC2 NE "" '$PROC2' @'$SRUIC''$PRJPF''$PROC2'
.; MERAGE OBJ FILES
	PIP @'$OBUIC''$PRJPF'PIP
.; BUILD LIBRARY
	LBR '$DFOUC''$LIBNM'='$OBDEV''$OBUIC''$PRJPF'OBJ.OOO
.; DELEATE MERGED OBJ FILE
	PIP '$OBDEV''$OBUIC''$PRJPF'OBJ.OOO;*/DE
.; DELETE SRC AND OBJ FILES
	PIP @'$SRUIC''$PRJPF'DEL
.; DELETE COMMAND FILES
	PIP '$SRUIC''$PRJPF''$PROC1'.CMD;*/DE,'$PRJPF'EXT;*,'$PRJPF'DEL;*
	PIP '$OBUIC''$PRJPF'PIP.CMD;*/DE
	.IF $PROC2 NE "" PIP '$SRUIC''$PRJPF''$PROC2'.CMD;*/DE
