	.ENABLE SUBSTITUTION
	.ENABLE GLOBAL
	.ENABLE ESCAPE
.;***************************************************************
.;*								*
.;*		COMMAND FILE FOR WIRAP				*
.;*								*
.;*	COMPILE, MAKE LIBRARY, AND BUILD			*
.;*								*
.;*	CREATED: 8-MAR-79	AUTHOR: R. L. AURBACH		*
.;*	TASK NAME:  ...WIR					*
.;*								*
.;***************************************************************
	;
	; WIRAP GENERATION BUILD FILE.
	;
	; INVOKATION PROCEDURE:
	;
	; MCR>SET /UIC=[317,300]
	; MCR>@WIRGEN
	;
.WIR01:
	;
	; WIRAP OPTIONS SELECTION
	;
	.SETF	$DIA			!NO DIALOG!
	.SETF	$OVR			!NO OVERRIDE!
	.SETT	$PAS			!START ON PASS ONE!
	.SETS	$LI "SY:"		!ESTABLISH LISTING DEVICE!
	.SETS	$MP "SY:"		!ESTABLISH MAP DEVICE!
	.SETS	$LISW "/-SP"		!NO LISTING SWITCHES!
	.SETS	$MPSW "/-SP/CR"		!DO CREF ON MAP!
	.SETF	ROT
	.SETF	FIO
	.SETF	STR
	.SETF	UTL
	.SETF	LEX
	.SETF	PH0
	.SETF	PH1
	.SETF	PH2
	.SETF	PH3
	.SETF	PH4
.WIR02:
	;
	; IF YOU WISH DIALOG TO HELP YOU THROUGH THIS PROCEDURE,
	; ANSWER THE NEXT QUESTION "YES".
	;
	; IF YOU ANSWER "NO", YOU MAY REQUEST AN EXPLANATION OF
	; THE QUESTION BY TYPING ESCAPE.
	;
	.ASK $DIA DIALOG
	.IFT	<ESCAPE> .GOTO WIR02
	.IFF	$DIA  .GOTO WIR06
.WIR05:;
	; IF THE WIRAP SOURCES SHOULD BE COMPILED
	; ANSWER THE NEXT QUESTION "YES"
	;
.WIR06:
	.ASK	$WIRAS COMPILE WIRAP
	.IFT	<ESCAPE> .GOTO WIR05
	.IFF	$WIRAS .GOTO WIR20
	.IFF	$DIA .GOTO WIR11
.WIR10:;
	; IF YOU WISH TO ASSEMBLE ALL OF THE MODULES
	; OF WIRAP, ANSWER YES TO THE NEXT QUESTION
	;
.WIR11:	.ASK ALL COMPILE ALL MODULES
	.IFT	<ESCAPE> .GOTO WIR10
	.IFF	ALL .GOTO WIR12
	.SETT	ROT
	.SETT	FIO
	.SETT	STR
	.SETT	UTL
	.SETT	LEX
	.SETT	PH0
	.SETT	PH1
	.SETT	PH2
	.SETT	PH3
	.SETT	PH4
	.GOTO WIR20
.WIR12:
	;
	; TYPING ESCAPE IN RESPONSE TO ANY OF THE FOLLOWING QUESTIONS
	; WILL PREVENT THE REST OF THE MODULES FROM BEING COMPILED.
	;
	.ASK ROT COMPILE WIRROT
	.IFT <ESCAPE> .GOTO WIR20
	.ASK FIO COMPILE WIRFIO
	.IFT <ESCAPE> .GOTO WIR20
	.ASK STR COMPILE WIRSTR
	.IFT <ESCAPE> .GOTO WIR20
	.ASK UTL COMPILE WIRUTL
	.IFT <ESCAPE> .GOTO WIR20
	.ASK LEX COMPILE WIRLEX
	.IFT <ESCAPE> .GOTO WIR20
	.ASK PH0 COMPILE WIRPH0
	.IFT <ESCAPE> .GOTO WIR20
	.ASK PH1 COMPILE WIRPH1
	.IFT <ESCAPE> .GOTO WIR20
	.ASK PH2 COMPILE WIRPH2
	.IFT <ESCAPE> .GOTO WIR20
	.ASK PH3 COMPILE WIRPH3
	.IFT <ESCAPE> .GOTO WIR20
	.ASK PH4 COMPILE WIRPH4
.WIR20:
	.IFF	$DIA .GOTO WIR08
.WIR07:;
	; IF THE TASK SHOULD BE BUILT
	; ANSWER THE NEXT QUESTION "YES"
	;
.WIR08:	.ASK	$WIRBL BUILD WIRAP
	.IFT	<ESCAPE> .GOTO WIR07
	.IFF $WIRBL .SETF $LIB
	.IFF $WIRBL .GOTO WIR39
	.IFF $DIA .GOTO WIR28
.WIR27:;
	; IF YOU WISH, WIRAP MAY BE LINKED TO A RESIDENT FCS LIBRARY
	; CALLED FCSRES.  IF YOU WISH THIS TO OCCUR, ANSWER THE
	; NEXT QUESTION "YES".
	;
.WIR28:	.ASK $LIB LINK TO FCSRES
	.IFT <ESCAPE> .GOTO WIR27
.WIR39:	.IFF $DIA .GOTO WIR18
.WIR17:;
	; IF YOU WISH A USERS MANUAL GENERATED,
	; ANSWER THE NEXT QUESTION "YES".
	;
.WIR18:	.ASK $WIRDC GENERATE MANUAL
	.IFT <ESCAPE> .GOTO WIR17
.;
.; GET POSSIBLE OPTIONAL DEVICES AND SWITCHES AS NECESSARY
.;
	.IFF	$WIRAS .SETF LISTER
	.IFF	$WIRAS .GOTO WIR35
	.IFF	$DIA .GOTO WIR25
.WIR24:
	;
	; IF YOU WISH THE COMPILER TO GENERATE LISTINGS
	; OF THE WIRAP MODULES, ANSWER THE NEXT QUESTION "YES"
	;
	; LISTINGS WILL NOT BE SPOOLED, HOWEVER.
	;
.WIR25:	.ASK LISTER DO YOU WISH LISTINGS GENERATED
	.IFT	<ESCAPE> .GOTO WIR24
.WIR35:	.IFF LISTER .SETS $LI ""
	.IFF $WIRBL .SETF MAPPER
	.IFF $WIRBL .GOTO WIR36
	.IFF $DIA .GOTO WIR29
.WIR26:;
	; IF YOU WISH THE TASK-BUILDER TO GENERATE A MEMORY ALLOCATION
	; MAP, ANSWER THE NEXT QUESTION "YES"
	;
	; THE "WIR.MAP" FILE WILL NOT BE SPOOLED, HOWEVER.
	;
.WIR29:	.ASK MAPPER DO YOU WISH THE BUILD MAP GENERATED
	.IFT	<ESCAPE> .GOTO WIR26
.WIR36:	.IFF MAPPER .SETS $MP ""
.;
.;****************************************************************
.;*       ASSEMBLE AND BUILD AS SPECIFIED IN PASS ONE            *
.;****************************************************************
.;
.WIR50:	.IFNDF	$WIR .SETF $PAS
	.IFT	$PAS .GOTO WIR99
	;
	; WIRAP ASSEMBLE AND BUILD
	;
.;
.; BE SURE SYSTEM CUSPS ARE INSTALLED
.;
	.IFNINS ...F4P INS $F4P/INC=10000.
	.IFNINS ...LBR INS $LBR/INC=10000.
	.IFNINS ...TKB INS $TKB
	.IFNINS CRF... INS $CRF
	.IFNINS ...PIP INS $PIP
	.IFNINS ...RNO INS $RNO
.;
.; OVERRIDE SYSTEM WIDE DEFAULT LISTING AND MAP SWITCHES IF
.; USER SELECTED TO DO SO ON FIRST PASS
.;
	.IFDF	$WIRL1 .SETS TEMP1 $LI
	.IFDF	$WIRL1 .SETS $LI $WIRL1
	.IFDF	$WIRL2 .SETS TEMP2 $LISW
	.IFDF	$WIRL2 .SETS $LISW WIRL2
	.IFDF	$WIRM1 .SETS TEMP3 $MP
	.IFDF	$WIRM1	.SETS $MP $WIRM1
	.IFDF	$WIRM2 .SETS TEMP4 $MPSW
	.IFDF	$WIRM2 .SETS $MPSW $WIRM2
	TIM
.;
.; IF NO COMPILATION IS CALLED FOR, SKIP DIRECTLY TO BUILD STEP
.;
	.IFF	$WIRAS .GOTO WIR60
.;
.; CREATE THE COMMAND FILE "COMPILE.CMD"
.;
	.DISABLE SUBSTITUTION
	.OPEN COMPILE.CMD
.DATA .;
.DATA .; COMMAND FILE TO COMPILE FORTRAN IV-PLUS SOURCE FILE
.DATA .;
.DATA .; CALL WITH:	$FILES	= SOURCE FILENAME
.DATA .;		$LI	= LISTING OUTPUT DEVICE
.DATA .;		$LISW	= LISTING SWITCHES
.DATA .;
.DATA .ENABLE GLOBAL
.DATA .ENABLE SUBSTITUTION
.DATA .;
.DATA .; SETUP SPECIFICATION SYMBOLS
.DATA .;
.DATA .SETS DEST "SY:"
.DATA .IF $LI NE "" .SETS LIST ",'$LI''$FILES''$LISW'"
.DATA .IF $LI EQ "" .SETS LIST ""
.DATA .;
.DATA .; NOW COMPILE THE MODULE
.DATA .;
.DATA F4P 'DEST''$FILES''LIST'='$FILES'
.DATA .;
	.CLOSE
	.ENABLE SUBSTITUTION
.;
.; IF COMPILING EVERYTHING, GET RID OF OLD OBJECT, LISTING, AND LIBRARY FILES
.;
	.IFF	ALL .GOTO WIR21
	PIP *.OBJ;*/DE
	PIP *.LST;*/DE
	PIP *.OLB;*/DE
.;
.; NOW COMPILE THE MODULES
.;
.WIR21:
	.IFT	ROT .SETS $FILES "WIRROT"
	.IFT	ROT @COMPILE.CMD
	.IFT	FIO .SETS $FILES "WIRFIO"
	.IFT	FIO @COMPILE.CMD
	.IFT	STR .SETS $FILES "WIRSTR"
	.IFT	STR @COMPILE.CMD
	.IFT	UTL .SETS $FILES "WIRUTL"
	.IFT	UTL @COMPILE.CMD
	.IFT	LEX .SETS $FILES "WIRLEX"
	.IFT	LEX @COMPILE.CMD
	.IFT	PH0 .SETS $FILES "WIRPH0"
	.IFT	PH0 @COMPILE.CMD
	.IFT	PH1 .SETS $FILES "WIRPH1"
	.IFT	PH1 @COMPILE.CMD
	.IFT	PH2 .SETS $FILES "WIRPH2"
	.IFT	PH2 @COMPILE.CMD
	.IFT	PH3 .SETS $FILES "WIRPH3"
	.IFT	PH3 @COMPILE.CMD
	.IFT	PH4 .SETS $FILES "WIRPH4"
	.IFT	PH4 @COMPILE.CMD
.;
.; NOW CREATE THE NEW LIBRARY
.;
	PIP ALL.OBS=*.OBJ
	LBR WIR/CR:250.:128.:128.:OBJ=ALL.OBS
	PIP ALL.OBS;*/DE
.;
.; TIME TO BUILD IF THAT WAS SELECTED
.;
.WIR60:
	.IFF	$WIRBL .GOTO WIR94
	.IF	$MP NE "" .SETS MAP ",'$MP'WIR'$MPSW'"
	.IF	$MP EQ "" .SETS MAP ""
	.OPEN	WIRBLD.CMD
	.ENABLE	DATA
WIRAP/FP'MAP'=WIRBLD.ODL/MP
ACTFIL=6
UNITS=7
TASK=...WIR
ASG=SY:1:2:3:4:6:7
ASG=TI:5
PRI=50
.DISABLE DATA
.IFF $LIB .GOTO WIR65
.ENABLE DATA
LIBR=FCSRES:RO
.DISABLE DATA
.WIR65:
.ENABLE DATA
//
.DISABLE DATA
	.CLOSE
.;
.; CREATE THE ODL FILE
.;
	.SETS LIB "SY:"
	.OPEN WIRBLD.ODL
	.ENABLE DATA
	.NAME WIR
	.PSECT WORK,RW,GBL,REL,OVR
ROOT:	.ROOT WIR-'LIB'WIR/LB:WIRAP:.DATA.-WORK-C-*(S1,S2,S3,S4)
;
; DEFINE OVERLAY SEGMENTS
;
S1:	.FCTR (S11,S12,S13)
S11:	.FCTR 'LIB'WIR/LB:INIT:FILIO:INCSET:MSGPRT:STATS
S12:	.FCTR S12A-S12B
S12A:	.FCTR 'LIB'WIR/LB:COVER:TITSET:COMENT:CREATE:REVISE:SLKSET
S12B:	.FCTR 'LIB'WIR/LB:CLRSET:MSGSET:LISTER:CHOP
S13:	.FCTR 'LIB'WIR/LB:LIBIN:WIRLEN:ISLACK
S2:	.FCTR (S21-S31,S22)
S21:	.FCTR 'LIB'WIR/LB:CONFIG:CHACHK
S22:	.FCTR 'LIB'WIR/LB:EDCHAN:CHACHP
S31:	.FCTR 'LIB'WIR/LB:MINI:MINLEN:LENGTH:INDX
S3:	.FCTR 'LIB'WIR/LB:COLOUR:NEXT:CREF:WIRLST:FSLACK
S4:	.FCTR 'LIB'WIR/LB:ALLOCC:ALLOCE:ALLOCS-(S41,S42,S43-S44,S45)
S41:	.FCTR S41A-S41B
S41A:	.FCTR 'LIB'WIR/LB:BUILDS:BUILDE:BUILDC:GETNUM
S41B:	.FCTR 'LIB'WIR/LB:ROTATE:NROTX:NROTY:SRCHI
S42:	.FCTR 'LIB'WIR/LB:CNECTR
S43:	.FCTR 'LIB'WIR/LB:MAP
S44:	.FCTR 'LIB'WIR/LB:PLANE
S45:	.FCTR 'LIB'WIR/LB:NEARPL-(S45A,S45B)
S45A:	.FCTR 'LIB'WIR/LB:PLCHAN:PLDFLT:JMPLST:COMPLE
S45B:	.FCTR 'LIB'WIR/LB:RDCHAN:ICHECK
C:	.FCTR C0-C1-C2-C3
C0:	.FCTR 'LIB'WIR/LB:GETLEX:GETLIN:PUSH:POP:TRANSF
C1:	.FCTR 'LIB'WIR/LB:MSG:DSKMSG:RESLIN:SAVLIN
C2:	.FCTR 'LIB'WIR/LB:HDR:HDRCHK:LINCLR:SEARCH:COMPAR
C3:	.FCTR 'LIB'WIR/LB:TRANS:TRANS4:PNSPEC:SAVE:RESTOR
	.END
.DISABLE DATA
	.CLOSE
	TKB @WIRBLD.CMD
.WIR94:
.;
.; NOW GENERATE THE USERS MANUAL
.;
	.IFT $WIRDC RNO WIRAP/-SP=WIRAP
.WIR95:
.;
.; CLEAN UP AND RETURN THE GLOBAL VALUES TO THEIR DEFAULTS
.; IF NECESSARY
.;
	PIP *.*/PU
	TIM
.;
.; RESET GLOBAL VALUES IF NECESSARY
.;
	.IFDF	$WIRL1 .SETS $LI TEMP1
	.IFDF	$WIRL2 .SETS $LISW TEMP2
	.IFDF	$WIRM1 .SETS $MP TEMP3
	.IFDF	$WIRM2 .SETS $MPSW TEMP4
.;
.; END OF THIS PROCEDURE
.;
.WIR99:
