.;		B L D . C M D
.;
.; The format for input into BLD.CMD is as follows
.;
.;	@BLD.CMD FILENAME COMMAND-LINE SCILIB ADGRFLIB TCSLIB F4PLIB
.;
.; WHERE:
.;	FILENAME	=1-9   Character filename with no extensions
.;	COMMAND-LINE	= TKB commandline (TSK=OBJ1,OBJ2....)
.;	SCILIB		= Y or N DEPENDING ON WHETHER SCI.OLB IS TO BE INCLUDED
.;	ADGRFLIB	= Y or N DEPENDING ON WHETHER AG.OLB IS TO BE INCLUDED
.;	TCSLIB		= Y or N DEPENDING ON WHETHER TCS.OLB IS TO BE INCLUDED
.;	F4PLIB		= Y or N DEPENDING ON WHETHER OR NOT IS F4P TASK
.;	OVRLAY		= Y or N DEPENDING ON WHETHER OR NOT TASK USES AN
.;				 ODL FILE.  IF "Y", NO LIBRARIES ARE USED.
.;
.;	If any of SCILIB,ADGRFLIB, or TCSLIB is defined, F4PLIB is defined 'Y'
.;	if ADGRF is defined 'Y', then TCS is defined  'Y'. If OVRLAY is 
.;	defined 'Y', then, SCILIB,ADGRFLIB,TCSLIB, and F4PLIB are defined 'N'
.;	and no reference is made to SYSLIB/LB.  Also the first '/' is then
.;	omitted from the command file.  Note that this version of BLD.CMD
.;	assumes that object module libraries SYSLIB, and F4POTS exist on the
.; 	device SL:.  SL: should be globally assigned to the fastest disk on
.;	the system.
.;
.; EXAMPLE:
.;         @BLD FOO FOO.TSK;1/CP/FP=FOO N N N Y
.;
.; THIS WILL PRODUCE A COMMAND FILE:  FOO.BLD;1
.; WHICH LOOKS LIKE
.;		   FOO.TSK;1/CP/FP=FOO,
.;		   SL:[1,1]F4POTS/LB
.;		   SL:[1,1]SYSLIB/LB
.;		   /
.;		   @FOO.OPT;1
.;		   //
.;
.;
	.ENABLE SUBSTITUTION
	.TEST COMMAN
	.IF <STRLEN> GT 79. 	.GOTO TOLONG
	.IF P1 EQ "" 		.GOTO NOFILE
	.TEST P1
	.IFF <ALPHAN> 		.GOTO NOEXTN
	.IF <STRLEN> GT 9. 	.GOTO BADNAM
	.SETN TOTLEN <STRLEN>
	.IF P2 EQ "" 		.GOTO NOCMD
	.SETS COMMA ""
	.SETF COMA
	.IF P7 EQ ""  .SETS P7 "N"
	.IF P7 EQ "Y" .SETS P3 "N"	! IF OVERLAY CALLED OUT
	.IF P7 EQ "Y" .SETS P4 "N"	!
	.IF P7 EQ "Y" .SETS P5 "N"	!
	.IF P7 EQ "Y" .SETS P6 "N"	!
	.IF P3 EQ "Y" .SETT COMA
	.IF P4 EQ "Y" .SETT COMA
	.IF P5 EQ "Y" .SETT COMA
	.IF P6 EQ "Y" .SETT COMA
	.IFT COMA .SETS COMMA ","
	.OPEN 'P1'.BLD;1
	.DATA 'P2''COMMA'
	.IF P3 EQ "Y" .DATA LB:[1,1]SCI/LB,
	.IF P3 EQ "Y" .SETS P6 "Y"
	.IF P4 EQ "Y" .DATA LB:[1,1]AG/LB,
	.IF P4 EQ "Y" .SETS P5 "Y"
	.IF P4 EQ "Y" .SETS P6 "Y"
	.IF P5 EQ "Y" .DATA LB:[1,1]TCS/LB,
	.IF P5 EQ "Y" .SETS P6 "Y"
	.IF P6 EQ "Y" .DATA SL:[1,1]F4POTS/LB
	.IF P7 EQ "N" .DATA SL:[1,1]SYSLIB/LB
	.IF P7 EQ "N" .DATA /
	.DATA @'P1'.OPT
	.DATA //
	.CLOSE
	.EXIT 1
.TOLONG:.DISABLE QUIET
	; ERROR(BLD.CMD) -- TOTAL COMMAND STRING IS TOO LONG
	.STOP 4
.NOFILE:.DISABLE QUIET
	; ERROR(BLD.CMD) -- FILE NAME NOT DEFINED
	.STOP 4
.NOEXTN:.DISABLE QUIET
	; ERROR(BLD.CMD) -- FILE NAME ONLY, NO EXTENSIONS
	.STOP 4
.BADNAM:.DISABLE QUIET
	; ERROR(BLD.CMD) -- FILE NAME TOO LONG(>9 CHARACTERS)
	.STOP 4
.NOCMD:	.DISABLE QUIET
	; ERROR(BLD.CMD) -- COMMAND LINE NOT PRESENT
	.STOP 4
