.; VALBLD - ASSEMBLE VAL ROUTINES AND INSERT IN LIBRARY UTYLIB
.; LAST EDIT:	19-NOV-81
.;
.; THIS ROUTINE BUILDS MODULES FOR THE TERMINAL I/O PACKAGE VAL.
.;
.;	EX:	@VALBLD <NAME>
.;
.; SWITCHES:	/VAL	- ASSEMBLE MODULE WITH VAL PREFIL FILE
.;			  THIS IS DEFAULT FOR NAMES BEGINNING 'VAL'
.;		/-EP	- INSERT MODULE IN UTYLIB/-EP
.;
.; COMMAND ARGUMENT MAY ALSO BE AN INDIRECT FILE NAME OR @TI: IN WHICH
.; CASE COMMANDS ARE COPIED FROM THE TREMINAL AND THEN EXECUTED.
.;
.; IF THE ARGUMENT IS 'ALL' COMMANDS ARE TAKEN FROM 'DD:VALSOURCE.CMD'
.;
.; IF NO COMMAND ARGUMENT IS GIVEN THE COMMAND IS PROMPTED FOR, IN ADITION
.; DEVICE ASSIGNMENTS ARE LISTED AND MAY BE MODIFIED.
.;
.;
	.ENABLE SUBSTITUTION
	.ENABLE GLOBAL
	.ENABLE QUIET
.;
	ASN SY:=DD:
	.IFNINS LBR	INS $LBR
	.IFNINS MAC	INS $BIGMAC
.;
	.SETS $CMD0 P1
	.SETF ALL
	.IF $CMD0 EQ "ALL" .SETT ALL
.;
	.SETS LST ""
	.IF $CMD0 EQ "" .ASKS LST LISTING DEVICE (NL:)
	.IF LST EQ "" .SETS LST "NL:"
	ASN 'LST'=LS:
	.SETS OBJ "DD:"
	.SETT T
	.IF LST NE "NL:" .ASK T PRODUCE OBJECT FILES
	.IFF T .SETS OBJ "NL:"
.;
	.SETS $PRMPT "NAME OF MODULE TO BUILD"
	.IFF ALL .GOTO NEXT
	.SETS $CMD0 "@DD:VALSOURCE"
	PIP DD:UTYLIB.OLB;*/DE/NM
	LBR DD:UTYLIB/CR:-50.
.;
.NEXT:	@INDGCL
	.IF <STRLEN> EQ 0 .GOTO END
	.DISABLE QUIET
	;
	; MODULE: '$CMD'
	.ENABLE QUIET
	.PARSE $CMD "/" $CMD SW1 SW2
	.SETS PREFIX ""
	.IF SW1 EQ "VAL" .OR .IF SW2 EQ "VAL"	.SETS PREFIX "DD:VALMFD,"
	.SETS LIBSW ""
	.IF SW1 EQ "-EP" .OR .IF SW2 EQ "-EP"	.SETS LIBSW "/-EP"
.;
	.SETS TYP $CMD[1:3]
	.IF TYP EQ "VAL" .SETS PREFIX "DD:VALMFD,"
.;
	MAC 'OBJ''$CMD',LS:'$CMD'/-SP='PREFIX'DD:'$CMD'
	.IF <EXSTAT> NE 1 .GOTO NEXT
	.IF OBJ EQ "NL:" .GOTO NEXT
	LBR DD:UTYLIB/RP'LIBSW'='$CMD'
	PIP DD:'$CMD'.OBJ;*/DE/NM
	.GOTO NEXT
.;
.END:	.IFF ALL .EXIT
	F4P VALTST=VALTST
	TKB @VALTST
	.IF <EXSTAT> NE 1 .EXIT
	INS VALTST
	.DISABLE QUIET
	;
	; PROGRAM VALTST SHOULD NOW BE READY TO RUN
	;
