.ENABLE SUBSTITUTION
.ENABLE GLOBAL
.;
	.SETS commnt ".;"			! Initialize to no compile.
	.IFNDF $CMPIL .GOTO Next		! Don't recompile.
		.IFT $CMPIL .SETS commnt ""	! Recompile all.
.Next:
	.SETS swtlbr "/RP"			! Initialize LBR switch.
	.SETS lbrnam "SBT.OLB"
	.TESTFILE 'lbrnam'			! Check for library existance.
	.IF <filerr> = 1 .GOTO Compl		! Library exists.
		.SETS swtlbr "/CR::::OBJ"	! Force creation switch first.
		.SETS commnt ""			! Force recompile.
.Compl:
	.SETS commnt ""				! Use these to force compile
.;	.SETS commnt ".;"			! or no compile.
.;
.; Make file list;  mark with blank at end.
.;
'commnt'.SETS fil1 "SBT.FTN"
.;'commnt'.SETS fil2 "NETTLK.FTN"
.;'commnt'.SETS fil4 "GETLOG.FTN"
'commnt'.SETS fil3 "GETSWT.FTN"
.;'commnt'.SETS fil5 "PARSE.FTN"
.;'commnt'.SETS fil6 "FUNCTNS.FTN"
.;'commnt'.SETS fil8 "PROMPT.FTN"
.;'commnt'.SETS fil9 "GETLST.FTN"
.;'commnt'.SETS fil10 "PRSFIL.FTN"
.;'commnt'.SETS fil11 "TEST.FTN"
.;'commnt'.SETS fil12 "GETDEF.FTN"
.;'commnt'.SETS fil13 "INSZIP.FTN"
'commnt'.SETS fil14 "SETBUF.FTN"
.;'commnt'.SETS fil15 "CHGLST.FTN"
.;'commnt'.SETS fil16 "MCRSPW.FTN"
.;'commnt'.SETS fil17 "SPWNFT.FTN"
.;'commnt'.SETS fil18 "UPCASE.FTN"
.;'commnt'.SETS fil19 "TBUILT.MAC"
	.SETS fil20 ""
.;
	.SETS libop "LIBR=F4PRES:RO"	! -- USE F4PRES
	.IFDF $libop .SETS libop $libop	! -- UNLESS ANOTHER SELECTED
	.SETS for "F4P"
	.SETS swtfor "/RO/TR"
	.SETS swttkb "/FP/MU/ID"
	.SETN n 1
	.SETD n
.Loop:
	.IFNDF fil'n' .GOTO Incr			! Skip non-existant
.;							! file names.
	.IF fil'n' = "" .GOTO Build			! No more file names.
		.PARSE fil'n' "." name ext		! Parse file name.
		.IF ext = "MAC" .GOTO Macbld		! Assemble or compile?
			'for' 'name'='name''swtfor'	! Compile module.
			.GOTO Lbrins			! Insert into library.
.Macbld:	MAC 'name'='name'			! Assemble module.
.Lbrins:	.IF <exstat> <> 1 .GOTO Xit		! Error compiling.
		LBR 'lbrnam''swtlbr'='name'		! Enter into library.
		.IF <exstat> <> 1 .GOTO Xit		! Error entering into
.;							! library.
		.IF swtlbr = "/CO" .SETS swtlbr "/RP"	! Reset to replace.
		PIP 'name'.OBJ;*/DE/NM			! Kill object module.
.Incr:
		.INC n					! Inc file count.
		.GOTO Loop				! Try for next one.
.Build:
	.OPEN SBTBLD.BLD
	.DATA SBT'swttkb'=SBT/LB:SBT,SBT/LB,
	.DATA LB:[1,1]NETFOR/LB,F4POTS/LB,SYSLIB/LB
	.DATA /
	.DATA 'libop'
	.DATA UNITS=6
	.DATA STACK=128
	.DATA TASK=...SBT
	.DATA //
	.CLOSE
	TKB @SBTBLD.BLD
	PIP SBTBLD.BLD;*/DE/NM
	PIP SBT.TSK/PU
.Xit:
	.Exit
