SWITCH	BASIC
! RGTDOC.CMD
!
! Build documentation on RSTS/E, run as an indirect command file.
! Usage information has been removed as the library is pretty big already.
!
! Note: there is an error in RSTS/E V7.0 runoff (RNO.TSK) such that
! titles, chapter headings, and page numbers don't work together.
! Therefore, there is an incredable hack here to construct the proper
! page number.  Sorry.
!
! The following accounts are used:
!
ASSIGN	SY:[5,1]DOC
ASSIGN	SY:[5,4]OTSCOM
ASSIGN	SY:[5,5]OTSIO
!
! [6,1]		TOOLS
! [6,4]		LEX
!
! Note that GETRNO, GETKWK, FIXDOC, KWIK, RNOIDX, and SCAT must already have
! been built and stored on PUB:
!
$ ALLOW NO ERRORS
!
CRUN PUB:GETRNO -R       >KIT.TMP    -H DOC:KIT.RNO
CRUN PUB:GETRNO -R       >NEW.TMP    -H DOC:NEW.RNO
CRUN PUB:GETRNO -R -M    >NORM.TMP   -H DOC:CLIBHD.RNO OTSCOM:*.MAC OTSIO:*.MAC
CRUN PUB:GETRNO -R -M -W >WIZ.TMP    -H DOC:CLIBHD.RNO OTSCOM:*.MAC OTSIO:*.MAC
CRUN PUB:GETRNO -R       >CC.TMP     -H DOC:CC.RNO
CRUN PUB:GETRNO -R	 >HNORM.TMP  -H DOC:CLIHDR.RNO DOC:*.H
CRUN PUB:GETRNO -R -W    >HWIZ.TMP   -H DOC:CLIHDR.RNO DOC:*.H
!
CRUN PUB:GETKWK	>KWNORM.TMP	OTSCOM:*.MAC OTSIO:*.MAC
CRUN PUB:GETKWK >KWIZRD.TMP -W	OTSCOM:*.MAC OTSIO:*.MAC
!
DEASSIGN	OTSCOM
DEASSIGN	OTSIO
ASSIGN	SY:[6,1]TOOLS
ASSIGN	SY:[6,4]LEX
!
CRUN PUB:GETRNO -R    >TOOLS.TMP  -H DOC:TOOLHD.RNO -C TOOLS:*.C LEX:LEX.C
CRUN PUB:GETKWK       >KWTOOL.TMP		    -C TOOLS:*.C LEX:LEX.C
CRUN PUB:GETRNO -R    >LEX.TMP    -H LEX:LEX.RNO
!
! Build the keyword indexes
!
CRUN PUB:KWIK -T 10 -W 64 <KWNORM.TMP >IXNORM.TMP
PIP KWNORM.TMP/DE
CRUN PUB:RNOIDX <IXNORM.TMP >IXNORM.FIX
PIP IXNORM.TMP/DE
CRUN PUB:KWIK -T 10 -W 64 <KWIZRD.TMP >IWIZRD.TMP
PIP KWIZRD.TMP/DE
CRUN PUB:RNOIDX <IWIZRD.TMP >IWIZRD.FIX
PIP IWIZRD.TMP/DE
CRUN PUB:KWIK -T 10 -W 64 <KWTOOL.TMP >IXTOOL.TMP
PIP KWTOOL.TMP/DE
CRUN PUB:RNOIDX <IXTOOL.TMP >IXTOOL.FIX
PIP IXTOOL.TMP/DE
!
! Concatenate files to create runoff source
!
$ ALLOW WARNING ERRORS
PIP NORMAL.TMP=SY:NORM.TMP,SY:HNORM.TMP,DOC:IXLIBR.RNO,SY:IXNORM.FIX/AS
PIP NORM.TMP/DE
PIP HNORM.TMP/DE
PIP IXNORM.FIX/DE
PIP WIZARD.TMP=SY:WIZ.TMP,SY:HWIZ.TMP,DOC:IXLIBR.RNO,SY:IWIZRD.FIX/AS
PIP WIZ.TMP/DE
PIP HWIZ.TMP/DE
PIP IWIZRD.FIX/DE
PIP TOOLS.TMP=SY:TOOLS.TMP,DOC:IXTOOL.RNO,SY:IXTOOL.FIX/AS
PIP IXTOOL.FIX/DE
PIP CC.TMP=CC.TMP,DOC:CBUGS.RNO/AS
$ ALLOW NO ERRORS
!
! Make the documentation
!
DEASSIGN	TOOLS
DEASSIGN	LEX
ASSIGN	C:	OUT
!
! Note that KIT.DOC and README.1ST (system generation information)
! goes onto DOC:, not C:
!
$ ALLOW FATAL ERRORS
RNO DOC.TMP/-SP=DOC:README.RNO/-HY/UL:N
$ ALLOW NO ERRORS
CRUN PUB:FIXDOC <DOC.TMP >DOC:README.1ST
PIP DOC.TMP/DE
!
$ ALLOW FATAL ERRORS
RNO DOC.TMP/-SP=KIT.TMP/-HY/UL:N
$ ALLOW NO ERRORS
PIP KIT.TMP/DE
CRUN PUB:FIXDOC <DOC.TMP >DOC:KIT.DOC
PIP DOC.TMP/DE
!
$ ALLOW FATAL ERRORS
RNO DOC.TMP/-SP=NEW.TMP/-HY/UL:L
$ ALLOW NO ERRORS
PIP DOC.TMP/DE
CRUN PUB:FIXDOC <DOC.TMP >OUT:NEW.DOC
PIP DOC.TMP/DE
!
$ ALLOW FATAL ERRORS
RNO DOC.TMP/-SP=CC.TMP/-HY/UL:L
$ ALLOW NO ERRORS
PIP CC.TMP/DE
CRUN PUB:FIXDOC <DOC.TMP >OUT:CC.DOC
PIP DOC.TMP/DE
!
$ ALLOW FATAL ERRORS
RNO OUT:AS/-SP=DOC:AS/-HY/UL:L
$ ALLOW NO ERRORS
!
$ ALLOW FATAL ERRORS
RNO DOC.TMP/-SP=NORMAL.TMP/-HY/UL:L
$ ALLOW NO ERRORS
PIP NORMAL.TMP/DE
CRUN PUB:FIXDOC <DOC.TMP >OUT:CLIB.DOC
PIP DOC.TMP/DE
!
$ ALLOW FATAL ERRORS
RNO DOC.TMP/-SP=WIZARD.TMP/-HY/UL:L
$ ALLOW NO ERRORS
PIP WIZARD.TMP/DE
CRUN PUB:FIXDOC <DOC.TMP >OUT:WIZARD.DOC
PIP DOC.TMP/DE
!
$ ALLOW FATAL ERRORS
RNO OUT:CBUGS.DOC/-SP=DOC:CBUGS.RNO/-HY/UL:N
$ ALLOW NO ERRORS
!
$ ALLOW FATAL ERRORS
RNO DOC.TMP/-SP=TOOLS.TMP/-HY/UL:L
$ ALLOW NO ERRORS
PIP TOOLS.TMP/DE
CRUN PUB:FIXDOC <DOC.TMP >OUT:TOOLS.DOC
PIP DOC.TMP/DE
!
$ ALLOW FATAL ERRORS
RNO DOC.TMP/-SP=LEX.TMP/-HY/UL:L
$ ALLOW NO ERRORS
PIP LEX.TMP/DE
CRUN PUB:FIXDOC <DOC.TMP >OUT:LEX.DOC
PIP DOC.TMP/DE
!
! Copy help file and make all .DOC files accessable
!	Note: you may have to edit the help files to make
!	them compatible with RSTS/E standards.
PIP OUT:DECUSC.HLP<40>=DOC:DECUSC.HLP
PIP OUT:CTOOLS.HLP<40>=DOC:CTOOLS.HLP
PIP OUT:*.DOC<40>=OUT:*.DOC/RE
!
! Documentation built (deep breath).
!
