DataMuseum.dk

Presents historical artifacts from the history of:

Rational R1000/400 Tapes

This is an automatic "excavation" of a thematic subset of
artifacts from Datamuseum.dk's BitArchive.

See our Wiki for more about Rational R1000/400 Tapes

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - download
Index: ┃ M T

⟦c8e5740bb⟧ TextFile

    Length: 43883 (0xab6b)
    Types: TextFile
    Names: »MAKEFILE_COM«

Derivation

└─⟦d10a02448⟧ Bits:30000409 8mm tape, Rational 1000, ENVIRONMENT, D_12_7_3
    └─ ⟦fc9b38f02⟧ »DATA« 
        └─⟦8e9e227a9⟧ 
            └─⟦this⟧ 

TextFile

$!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
$!--Makefile.Com - Compile, Load, and Install the Rational RXI program.
$!
$! @Makefile <what>
$!
$! Customer Editing Instructions (for full Source recompilation only) :
$!
$! 1) Uncomment the appropriate defintition for TCP_IP below.  Define it as
$!    either ULTRIXCONNECTION, WOLLONGONG, or MULTINET depending upon which
$!    set of TCP/IP libraries you are using.  (NOTE: MULTINET is no longer
$!    actively supported.)
$!
$! 2) Check the definitions below for either:
$!	UltrixConnection => UC_Olb.
$!	Wollongong => Wollongong_Olb, WollNetINet,  and WollSys.
$!      MultNet    => Multinet_Olb,   MultiNetINet, and MultiSys, or else
$!    These are the directories containing the linkable object library
$!    and the various *.h include files for the TCP/IP software that you are
$!    using.
$!
$! 3) Check the definitions below of BINDIR/BINPROT, HELPLIB/HELPPROT,
$!    FONTDIR/FONTPROT, and XAPPLOADDIR/XAPPPROT.  Make sure that they are
$!    appropriate for your system(s).
$!
$! Customer Editing Instructions (for simple binary installation only) :
$!
$! 1) Check the definitions below of BINDIR/BINPROT, HELPLIB/HELPPROT,
$!    FONTDIR/FONTPROT, and XAPPLOADDIR/XAPPPROT.  Make sure that they are
$!    appropriate for your system(s).
$!
$! Available Makefile commands :
$!
$!   Regeneration and Installation of RXI from sources :
$!
$!   install		- Installs just the rxi executables and data files.
$!   install.help	- Installs just the rxi help information.
$!   install.fonts	- Installs just the fonts that rxi needs
$!   install.all	- Does install, install.help, and install.fonts.
$!
$!   relink		- Relinks the rxi executables with local workstation
$!			  libraries (perhaps cause the use of shared
$!			  libraries, a desirable situation.)
$!   clean		- "Cleans" the directory so that you can rebuild
$!			  rxi from sources.
$!   all			- Creates all rxi executables (from sources if
$!			  necessary, do this after a "make clean").
$!   install.fonts.fallback- If the normal install.fonts process fails (some
$!			  important system program is missing for instance)
$!			  then this can be used to attempt to install the
$!			  fonts using programs supplied by Rational.
$!
$!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
$!--EDIT STEP ONE : First, which TCP/IP code are we using?
$!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
$!
$    on warning then exit 4
$!   TCP_IP := MULTINET
$!   TCP_IP := WOLLONGONG
$   TCP_IP := ULTRIXCONNECTION
$!
$!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
$!--EDIT STEP TWO : Excelan MultiNet Release 2.0 or later.
$!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
$
$ if TCP_IP .eqs. "MULTINET"
$ then
$ define/process Multinet_Olb	Sys$SysRoot:[Multinet.Library]
$
$ define/process MultiInclude	Sys$SysRoot:[Multinet.Include]
$ define/process MultiNetINet	Sys$SysRoot:[Multinet.Include.NetINet]
$ define/process MultiSys	Sys$SysRoot:[Multinet.Include.Sys]
$
$ endif
$
$!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
$!--EDIT STEP TWO : Wollongong WIN/TCP release 5.0.2 or later.
$!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
$
$ if TCP_IP .eqs. "WOLLONGONG"
$ then
$ if f$trnlnm("Twg$Tcp") .nes. "" .or. f$parse("Twg$Tcp:[Netdist]") .nes. "" -
	then goto Twg_Ok
$    write sys$output "Logical name Twg$Tcp is not defined?"
$    exit 4
$ Twg_Ok :
$ define/process Wollongong_Olb	Twg$Tcp:[Netdist.Lib]
$
$ define/process WollInclude	Twg$Tcp:[Netdist.Include]
$ define/process WollNetINet	Twg$Tcp:[Netdist.Include.NetINet]
$ define/process WollSys	Twg$Tcp:[Netdist.Include.Sys]
$
$ define/process Sys		WollSys:
$
$ endif
$
$!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
$!--EDIT STEP TWO : Digital ULTRIXConnection 1.3A or later.
$!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
$
$ if TCP_IP .eqs. "ULTRIXCONNECTION"
$ then
$ define/process UC_Olb		Sys$Library:
$
$ endif
$
$!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
$!--EDIT STEP THREE : Generated items are installed into these directories.
$!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
$
$!--All installed/created executables, help files, and fonts will be created
$!  with this username attached as the owner.
$
$    OWNER := SYSTEM
$
$!--Binary executables go here with this set of protections.  Use the SYSEXE
$!  directory located within SYS$SYSTEM:
$!	SHOW LOGICAL SYS$SYSTEM
$
$    BINDIR      := SYS$COMMON:[SYSEXE]
$    BINPROT     := SYSTEM:RWED,OWNER:RWED,GROUP:RE,WORLD:RE
$
$!--Help text goes in this file.  Probably the system wide help file called
$!  SYS$HELP:HELPLIB.HLB
$!	SHOW LOGICAL SYS$HELP
$!	DIR SYS$HELP:HELP*.*
$
$    HELPLIB     := SYS$HELP:HELPLIB.HLB
$    HELPPROT    := SYSTEM:RWED,OWNER:RWED,GROUP:R,WORLD:R
$
$!--RXI default resource files go here with this set of protections.  Use the
$!  DECW$DEFAULTS.SYSTEM directory located in DECW$SYSTEM_DEFAULTS:
$!	SHOW LOGICAL DECW$SYSTEM_DEFAULTS:
$
$    XAPPLOADDIR := SYS$COMMON:[DECW$DEFAULTS.SYSTEM]
$    XAPPPROT    := SYSTEM:RWED,OWNER:RWED,GROUP:R,WORLD:R
$
$!--Fonts for RXI usable by the server go here with this set of protections.
$!  Use one of the User_* elements in the search path named DECW$FONT:.
$!  The one you use is determined by the type of screen you have.  DECW$FONT
$!  should already be set up for your hardware so just use the one mentioned
$!  there.
$!	SHOW LOGICAL/TABLE=DECW$SERVER0_TABLE DECW$FONT
$
$    FONTDIR     := SYS$COMMON:[SYSFONT.DECW.USER_75DPI]
$!   FONTDIR     := SYS$COMMON:[SYSFONT.DECW.USER_100DPI]
$    FONTPROT    := SYSTEM:RWED,OWNER:RWED,GROUP:R,WORLD:R
$
$!--"Standard" installations sometimes need to create directories.  They are
$!   created with owner=SYSTEM and these protections.
$
$    DIRPROT	 := SYSTEM:RWED,OWNER:RWED,GROUP:RE,WORLD:RE
$
$!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
$!*****************************************************************************
$! **** DO NOT EDIT BELOW THIS LINE **** DO NOT EDIT BELOW THIS LINE ****
$!*****************************************************************************
$!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
$!--Fix a bug in the DECwindows FONT compiler.  Make sure that SET DEFAULT
$!  is to a devce:[directory] and never ever to a concealed:[directory].
$!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
$
$    DEF = f$environment("DEFAULT")			! Get Show Default
$    DEF = f$parse( DEF, , , , "NO_CONCEAL" )
$ Next_Level :						! Remove all ".]["'s
$    CMD = f$locate( ".][", DEF )
$    if CMD .ge. f$length(DEF) then goto Reset_Default
$    DEF = f$extract( 0, CMD, DEF) + "." + -
	   f$extract( CMD + 3, f$length(DEF), DEF )
$    goto Next_Level
$
$ Reset_Default :
$    CMD = "set default " + f$parse( DEF, , , "DEVICE" ) + -
			    f$parse( DEF, , , "DIRECTORY" )
$    write sys$output CMD
$    CMD
$
$!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
$!--Logical names we need in order to function.
$!  RxiX11	- Where the RXI include files are located. "[], [.X11]"
$!  X11		- Where the VMS X11 include files may be found
$!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
$
$ CMD = f$environment("DEFAULT")
$ if f$length(CMD) .gt. f$locate("]",CMD)
$ then
$    CMD = f$extract( 0, f$locate("]",CMD), CMD ) + ".X11]"
$ else
$    if f$length(CMD) .gt. f$locate(">",CMD)
$    then
$       CMD = f$extract( 0, f$locate(">",CMD), CMD ) + ".X11>"
$    else
$       write sys$error "?SHOW DEFAULT has neither a ] nor a > in it?"
$       write sys$error " Default => ", f$environment("DEFAULT")
$       exit 4
$    endif
$ endif
$ CMD = "define/process RxiX11 " + f$environment("DEFAULT") + ", " + CMD
$ CMD
$ define/process X11		RxiX11:, DecW$Include:
$
$!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
$!--Make sure that we got our argument so we know what to do.
$!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
$
$ if P1 .nes. "" then goto Have_Argument
$ type sys$input
Makefile.Com requires an argument.

  @Makefile <what>

  <what> = all		  - do everything but install steps; compile and load
  <what> = install	  - do all plus install the program
  <what> = install.fonts  - just install fonts
  <what> = install.help	  - just install the help
  <what> = install.all	  - do all plus install program, fonts, and help
  <what> = clean	  - destroy all created files
  <what> = relink	  - just relink the program; no recompilations
  <what> = a .c file	  - just recompile that one file

$ Exit 1
$
$!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
$! Define all of the local symbols that we will be needing
$!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
$
$ Have_Argument :
$
$!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
$! Compiler and Linker switches
$!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
$
$    CCFLAGS	:= /OPTIMIZE
$!   CCFLAGS	:= /NOOPTIMIZE /DEBUG /LIST /SHOW=(INCLUDE,EXPANSION)
$
$ if TCP_IP .eqs. "MULTINET"
$ then
$    DEFINES = "/DEFINE=(" + -
			"""" + TCP_IP + """" + -
			")"
$ endif
$ if TCP_IP .eqs. "WOLLONGONG"
$ then
$    DEFINES	= "/DEFINE=(" + -
			"""" + TCP_IP + """" + -
			")"
$ endif
$ if TCP_IP .eqs. "ULTRIXCONNECTION"
$ then
$    DEFINES	= "/DEFINE=(" + -
			"""" + TCP_IP + """" + -
			")"
$ endif
$
$    LINKFLAGS	:= /NOTRACEBACK
$!   LINKFLAGS	:= /TRACEBACK /DEBUG /MAP /FULL
$!   LINKFLAGS	:= /TRACEBACK /MAP /FULL
$
$    BACKUPFLAGS:= /NOTRACEBACK
$
$    INCLUDES	:= /INCLUDE=( RxiX11:, SYS$LIBRARY: )
$
$    VAXCRTL    := SYS$SHARE:VAXCRTL.EXE/SHAREABLE
$    BACKUPCRTL := SYS$LIBRARY:VAXCRTL.OLB/LIBRARY
$
$ if TCP_IP .eqs. "MULTINET"
$ then
$    LINKLIBS	:= MULTINET_OLB:LIB.OLB/LIBRARY, -
		   SYS$COMMON:[SYSLIB]DECW$DWTLIBSHR.EXE/SHAREABLE, -
		   SYS$COMMON:[SYSLIB]DECW$XLIBSHR.EXE/SHAREABLE
$    LINKLIBS = LINKLIBS+", " + f$environment("DEFAULT") + "MULTI.OLB/LIBRARY"
$ endif
$ if TCP_IP .eqs. "WOLLONGONG"
$ then
$    LINKLIBS	:= WOLLONGONG_OLB:LIBNET.OLB/LIBRARY, -
		   WOLLONGONG_OLB:LIBNETACC.OLB/LIBRARY, -
		   WOLLONGONG_OLB:LIBNET.OLB/LIBRARY, -
		   SYS$COMMON:[SYSLIB]DECW$DWTLIBSHR.EXE/SHAREABLE, -
		   SYS$COMMON:[SYSLIB]DECW$XLIBSHR.EXE/SHAREABLE
$ endif
$ if TCP_IP .eqs. "ULTRIXCONNECTION"
$ then
$    LINKLIBS	:= Sys$Library:UCX$IPC.OLB/LIBRARY, -
		   SYS$COMMON:[SYSLIB]DECW$DWTLIBSHR.EXE/SHAREABLE, -
		   SYS$COMMON:[SYSLIB]DECW$XLIBSHR.EXE/SHAREABLE
$!   LINKLIBS = LINKLIBS+", " + f$environment("DEFAULT") + "MULTI.OLB/LIBRARY"
$ endif
$		
$
$    PGM	:= rxi.exe
$    OBJS	:= -
		main.obj,input.obj,charproc.obj,VTPrsTbl.obj,cursor.obj, -
		tabs.obj,screen.obj,misc.obj,data.obj,scrollbar.obj, -
		button.obj,menu.obj,util.obj,-
		RMCommand.obj,RMForm.obj,-
		ratmenu.obj,RMShell.obj,RMLabel.obj,RMSub.obj,rxitelnet.obj, -
		[.X11]AsciiSink.obj,[.X11]AsciiText.obj,[.X11]Atoms.obj, -
		[.X11]CvtStdSel.obj,[.X11]DefErrMsg.obj,[.X11]Dialog.obj, -
		[.X11]DiskSrc.obj,[.X11]GrayPixmap.obj,[.X11]Label.obj, -
		[.X11]Lower.obj,[.X11]Scroll.obj,[.X11]Simple.obj, -
		[.X11]StringSrc.obj,[.X11]StrToJust.obj, -
		[.X11]StrToOrnt.obj,[.X11]StrToWidg.obj,[.X11]Text.obj, -
		[.X11]TextTr.obj
$
$    PGM2	:= rxi_detached.exe
$    OBJS2	:= rxi_detached.obj
$
$    PGM3	:= xallkeys.exe
$    OBJS3	:= xallkeys.obj
$
$    PGM4	:= xdumpfp.exe
$    OBJS4	:= xdumpfp.obj
$
$    PGM5	:= xsetfp.exe
$    OBJS5	:= xsetfp.obj
$
$!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
$! Dispatch and do whatever we were requested to do.
$!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
$
$    DOT = f$locate( ".", P1 )
$    if DOT .eq. f$length( P1 ) - 1 then goto Dot_File
$    if DOT .lt. f$length( P1 ) then goto Dot_Target
$	gosub 'P1'
$	write sys$output "@makefile ", P1," Done."
$	exit 1
$ Dot_File :
$     gosub 'f$extract( 0, DOT, P1 )'
$	write sys$output P1," Done."
$     exit 1
$ Dot_Target :
$     P1 = f$extract( 0, DOT, P1 ) + "_" + f$extract( DOT+1, 100, P1 )
$     gosub 'P1'
$     exit 1
$
$!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
$! Common composite requests
$!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
$
$!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
$! Compile and link the PGM.
$!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
$
$ maint:
$ all:
$    write sys$output "@makefile ALL"
$    gosub Compile_All
$    PGMNAME = PGM
$    DEPS = OBJS
$    gosub Link_Pgm
$    gosub Rxi_Detached
$    gosub Xallkeys
$    gosub Xdumpfp
$    gosub Xsetfp
$    return
$
$!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
$! Compile and link the RXI_DETACHED program.
$!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
$
$ rxi_detached :
$    write sys$output "@makefile RXI_DETACHED"
$    NAME := rxi_detached
$    DEPS := ""
$    SAVE_DEFINES = DEFINES
$    DEFINES = "/DEFINE=(""BINDIR=""""" + BINDIR + """"""",""PGM=""""" + -
		PGM + """"""")"
$    gosub Compile_C_File
$    DEFINES = SAVE_DEFINES
$    PGMNAME = PGM2
$    DEPS    = OBJS2
$    gosub Link_Pgm
$    return
$
$
$!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
$! Compile and link the XALLKEYS program.
$!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
$
$ xallkeys :
$    write sys$output "@makefile XALLKEYS"
$    NAME := xallkeys
$    DEPS := ""
$    SAVE_DEFINES = DEFINES
$    DEFINES = "/DEFINE=(""BINDIR=""""" + BINDIR + """"""",""PGM=""""" + -
		PGM + """"""")"
$    gosub Compile_C_File
$    DEFINES = SAVE_DEFINES
$    PGMNAME = PGM3
$    DEPS    = OBJS3
$    gosub Link_Pgm
$    return
$
$
$!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
$! Compile and link the XDUMPFP program.
$!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
$
$ xdumpfp :
$    write sys$output "@makefile XDUMPFP"
$    NAME := xdumpfp
$    DEPS := ""
$    SAVE_DEFINES = DEFINES
$    DEFINES = "/DEFINE=(""BINDIR=""""" + BINDIR + """"""",""PGM=""""" + -
		PGM + """"""")"
$    gosub Compile_C_File
$    DEFINES = SAVE_DEFINES
$    PGMNAME = PGM4
$    DEPS    = OBJS4
$    gosub Link_Pgm
$    return
$
$
$!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
$! Compile and link the XSETFP program.
$!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
$
$ xsetfp :
$    write sys$output "@makefile XSETFP"
$    NAME := xsetfp
$    DEPS := ""
$    SAVE_DEFINES = DEFINES
$    DEFINES = "/DEFINE=(""BINDIR=""""" + BINDIR + """"""",""PGM=""""" + -
		PGM + """"""")"
$    gosub Compile_C_File
$    DEFINES = SAVE_DEFINES
$    PGMNAME = PGM5
$    DEPS    = OBJS5
$    gosub Link_Pgm
$    return
$
$
$!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
$! Compile, link, and install the PGM.
$!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
$
$ install:
$    write sys$output "@makefile INSTALL"
$    gosub all
$    gosub Install_Pgm
$    return
$
$!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
$! Just relink PGM
$!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
$
$ relink:
$    write sys$output "@makefile RELINK"
$    gosub Compile_All
$    if f$search( PGM ) .nes. "" then delete 'PGM';*
$    PGMNAME = PGM
$    DEPS = OBJS
$    gosub Link_Pgm
$    gosub Rxi_Detached
$    gosub Xallkeys
$    gosub Xdumpfp
$    gosub Xsetfp
$    return
$
$ backup_relink :
$    LINKFLAGS = BACKUPFLAGS
$    VAXCRTL   = BACKUPCRTL
$    gosub relink
$    return
$
$!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
$! Install the fonts
$!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
$
$ install_fonts:
$    write sys$output "@makefile INSTALL.FONTS"
$    OBJ = FONTDIR
$    gosub Dir_Exists
$
$!--First we must compile all of the fonts and move them into the font
$!  directory.
$
$ Next_Font :
$    NAME = f$search( "fixed-screen-*.bdf" )
$    if NAME .eqs. "" then goto Fonts_Compiled
$	CMD = "font " + NAME + "/minbox"
$	write/symbol sys$output CMD
$	CMD
$	NAME = f$parse(NAME, , , "NAME") + ".DECW$FONT"
$	CMD = "copy " + NAME + " " + FONTDIR + NAME
$	write/symbol sys$output CMD
$	CMD
$       CMD = "set file/protection=(" + FONTPROT + ")/owner=" + OWNER + " " + -
		FONTDIR + NAME
$       write sys$output CMD
$       CMD
$    goto Next_Font
$ Fonts_Compiled :
$    if FONTDIR .eqs. f$environment("DEFAULT") then return
$    CMD = "delete *.DECW$FONT;*"
$    write/symbol sys$output CMD
$    CMD
$    type sys$input

*******************************************************************************
* You will have to reboot any DECwindows machines that share this font        *
* directory before those machines will be able to successfully run the RXI    *
* program.  You may also wish to purge the font directory.  Note that purging *
* old versions of fonts may cause running servers to be unable to find those  *
* fonts because the DECwindows server remembers not only file names but also  *
* version numbers.  A reboot causes a server to use the latest versions.      *
*******************************************************************************

$    return
$
$
$ backup_fonts:
$    FONTDIR = f$environment("DEFAULT")
$    OWNER   = f$getjpi("","UIC")
$    gosub install_fonts
$    return
$
$!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
$! Install the help files
$!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
$
$ install_help:
$    write sys$output "@makefile INSTALL.HELP"
$    OBJ = f$parse(HELPLIB,,,"NODE","SYNTAX_ONLY") + -
	   f$parse(HELPLIB,,,"DEVICE","SYNTAX_ONLY") + -
	   f$parse(HELPLIB,,,"DIRECTORY","SYNTAX_ONLY")
$    gosub Dir_Exists
$    gosub Version_Info
$    copy sys$input: rxi.tpu

	!---Get the version.info file in here.  Add spaces to the start of
	!   each and every line; so they don't give the librarian fits.
	ver_buffer := create_buffer( "version", "version.info" );
	position( beginning_of( ver_buffer ) );
	lines := get_info( ver_buffer, "record_count" );
	loop
	    exitif lines = 0;
	    copy_text( " " );
	    position( line_begin );
	    move_vertical( 1 );
	    lines := lines - 1;
	endloop;

	!---Now get the main help template file.
	main_buffer := create_buffer( "main", "rxi-man.tmpl" );

	!---Locate the @VERSION@ edit point and insert version info.
	position( beginning_of( main_buffer ) );
	theline := search( "@VERSION@", forward, exact );
	position( beginning_of( theline ) );
	erase( theline );
	copy_text( ver_buffer );

	!---Write out the result.
	write_file( main_buffer, "rxi-man.tmp" );
	quit;

$    CMD = "edit/tpu/nosection/nodisplay/command=rxi.tpu"
$    write sys$output CMD
$    CMD
$    delete rxi.tpu;*
$    CMD = "library/help/compress=(keysize:64)/output=temp.hlb " + HELPLIB
$    write sys$output CMD
$    CMD
$    CMD = "copy temp.hlb " + HELPLIB
$    write sys$output CMD
$    CMD
$    CMD = "set file/protection=(" + HELPPROT + ")/owner=" + OWNER + " " + -
		HELPLIB
$    write sys$output CMD
$    CMD
$    delete temp.hlb;*
$    CMD = "purge SYS$HELP:"
$    write sys$output CMD
$    CMD
$    CMD = "library/help/replace " + HELPLIB + " rxi-man.tmp"
$    write sys$output CMD
$    CMD
$    delete rxi-man.tmp;*
$    return
$
$
$!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
$ RXI Maintenance
$!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
$
$ backup:
$    write sys$output "@makefile BACKUP"
$    gosub backup_relink
$    gosub backup_fonts
$    gosub cvt_backup_to_exe
$    gosub cvt_exe_to_backup
$    copy nl: rxi-backup.bck
$    on warning then goto Vms_Can_Be_So_Silly
$    delete rxi-backup.bck;*, version.info;*, RXI.Tmp;*, RXI.Tmp2;*
$ Vms_Can_Be_So_Silly:
$    on warning then exit 4
$    open/write bk Backup.Com
$    CMD = f$parse( f$environment("DEFAULT"), , , "DIRECTORY" )
$    CMD = f$extract( 1, f$length(CMD)-2, CMD )
$    write bk "$ BACKUP_SAVE_SET = """ + CMD + """"
$    write bk "$ RESTORE_SAVE_SET = f$parse( f$environment(""DEFAULT"")," + -
	" , , ""DIRECTORY"")"
$    write bk "$ RESTORE_SAVE_SET = f$extract( 1," + -
	" f$length(RESTORE_SAVE_SET)-2, RESTORE_SAVE_SET )"
$    write bk "$ CMD = ""backup/log rxi-backup.bck/save_set/select=["" + -"
$    write bk "      BACKUP_SAVE_SET + ""...]  ["" + RESTORE_SAVE_SET + -"
$    write bk "      ""...]/new_version"
$    write bk "$ write sys$output CMD"
$    write bk "$ CMD"
$    close bk
$    purge [...]*.*
$    CMD = f$parse( f$environment("DEFAULT"), , , "DIRECTORY" )
$    CMD = f$extract( 1, f$length(CMD)-2, CMD )
$    CMD = "backup/interchange [" + CMD + "...]/exclude=(rxi-backup.*) " + -
	"rxi-backup.bck/save_set"
$    write sys$output CMD
$    CMD
$    CMD = "run cvt_backup_to_exe"
$    write sys$output CMD
$    CMD
$    CMD = "delete cvt_backup_to_exe.exe;*, cvt_backup_to_exe.obj;*, " + -
	"cvt_exe_to_backup.obj;*"
$    write sys$output CMD
$    CMD
$    return
$
$ restore:
$    write sys$output "@makefile RESTORE"
$    CMD = "run cvt_exe_to_backup"
$    write sys$output CMD
$    CMD
$    @Backup.Com
$    CMD = "rename *.hh *.h"
$    write sys$output CMD
$    CMD
$    wait 00:00:02
$    CMD = "copy *.obj *.obj"
$    write sys$output CMD
$    CMD
$    CMD = "copy [.X11]*.obj [.X11]*.obj"
$    write sys$output CMD
$    CMD
$    wait 00:00:02
$    CMD = "copy *.exe *.exe"
$    write sys$output CMD
$    CMD
$    CMD = "delete rxi-backup.exe;*, rxi-backup.bck;*, backup.com;*, " + -
	"cvt_exe_to_backup.exe;*"
$    write sys$output CMD
$    CMD
$    CMD = "purge [...]"
$    write sys$output CMD
$    CMD
$    return
$
$ deinstall:
$    CMD = "delete " + XAPPLOADDIR + "RXI*.*;*"
$    write sys$output CMD
$    CMD
$    CMD = "delete " + BINDIR + "RXI*.*;*"
$    write sys$output CMD
$    CMD
$    CMD = "delete " + FONTDIR + "fixed-screen-*.decw$font;*"
$    write sys$output CMD
$    CMD
$    CMD = "library/help/remove=(rxi) " + HELPLIB
$    write sys$output CMD
$    CMD
$    return
$
$ cvt_backup_to_exe:
$    write sys$output "@makefile CVT_BACKUP_TO_EXE"
$    copy nl: cvt_backup_to_exe.exe
$    copy nl: cvt_backup_to_exe.obj
$    delete cvt_backup_to_exe.exe;*, cvt_backup_to_exe.obj;*
$    NAME := cvt_backup_to_exe
$    DEPS := ""
$    gosub Compile_C_File
$    PGMNAME := cvt_backup_to_exe
$    DEPS    := cvt_backup_to_exe.obj
$    gosub Link_Pgm
$    return
$
$ cvt_exe_to_backup:
$    write sys$output "@makefile CVT_EXE_TO_BACKUP"
$    copy nl: cvt_exe_to_backup.exe
$    copy nl: cvt_exe_to_backup.obj
$    delete cvt_exe_to_backup.exe;*, cvt_exe_to_backup.obj;*
$    NAME := cvt_exe_to_backup
$    DEPS := ""
$    gosub Compile_C_File
$    PGMNAME := cvt_exe_to_backup
$    DEPS    := cvt_exe_to_backup.obj
$    gosub Link_Pgm
$    return
$
$!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
$! Clean up the compilation directory
$!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
$
$ clean:
$    write sys$output "@makefile CLEAN"
$    set noon
$    CMD = "delete " + PGM + ";*, *.bak;*, *.obj;*, *.log;*, *.map;*, " + -
	   "*.tmp;*, *.lis;*, *.decw$font;*, rxi-backup.*;*"
$    write/symbol sys$output CMD
$    CMD
$    set default [.x11]
$    CMD = "delete " + PGM + ";*, *.bak;*, *.obj;*, *.log;*, *.map;*, " + -
	   "*.tmp;*, *.lis;*, *.decw$font;*"
$    write/symbol sys$output CMD
$    CMD
$    set default [-]
$    return
$
$
$!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
$! Install the program
$!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
$
$ Install_Pgm :
$    write sys$output "@makefile INSTALL_PGM"
$    OBJ = BINDIR
$    gosub Dir_Exists
$    OBJ = XAPPLOADDIR
$    gosub Dir_Exists
$    CMD = "copy " + PGM + " " + BINDIR + PGM
$    write sys$output CMD
$    CMD
$    CMD = "set file/protection=(" + BINPROT + ")/owner=" + OWNER + " " + -
		BINDIR + PGM
$    write sys$output CMD
$    CMD
$    CMD = "copy " + PGM2 + " " + BINDIR + PGM2
$    write sys$output CMD
$    CMD
$    CMD = "set file/protection=(" + BINPROT + ")/owner=" + OWNER + " " + -
		BINDIR + PGM2
$    write sys$output CMD
$    CMD
$    gosub Rxi_Tmp
$    CMD = "copy rxi.tmp " + XAPPLOADDIR + "RXI.DAT"
$    write sys$output CMD
$    CMD
$    delete rxi.tmp;*
$    CMD = "set file/protection=(" + XAPPPROT + ")/owner=" + OWNER + " " + -
		XAPPLOADDIR + "RXI.DAT"
$    write sys$output CMD
$    CMD
$    gosub Rxi_Tmp2
$    CMD = "copy rxi.tmp2 " + XAPPLOADDIR + "RXI_Env_Menu."
$    write sys$output CMD
$    CMD
$    CMD = "set file/protection=(" + XAPPPROT + ")/owner=" + OWNER + " " + -
		XAPPLOADDIR + "RXI_Env_Menu"
$    write sys$output CMD
$    CMD
$    type sys$input

*******************************************************************************
* Please enter the following foreign-command definition into the SYS$MANAGER: *
* SYLOGIN.COM files for all machines that will be running RXI.  This command  *
* provides a simple command interface to RXI that runs RXI detached.          *
$    CMD = ""
$    CMD[0,79] := " "
$    CMD[0,1]  := "*"
$    CMD[78,1] := "*"
$    NAME = "RXI :== $ " + BINDIR + PGM2
$    CMD[10,f$length(NAME)] := 'NAME'
$    write sys$output CMD
$    type sys$input
*******************************************************************************

$    return
$
$
$!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
$! Create Version.Info by reading rcg.h producing Version.Info from the
$! RatRXIVersion array.
$!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
$
$ Version_Info :
$
$!--See if we need to (re)create the file.
$
$    OBJ  := version.info
$    DEPS := rcg.h, main.obj
$    FLAG = 1
$    if f$search( "main.obj" ) .nes. "" then gosub Check_Deps
$    if FLAG .eq. 0 then return
$
$!--Create it.
$
$    copy sys$input: rxi.tpu

	PROCEDURE remove_all(what)
	    !---Find and delete all instances of the what pattern.
	    on_error
		[TPU$_STRNOTFOUND] : return;
	    endon_error;
	    position( beginning_of( main_buffer ) );
	    loop
		theline := search( what, forward );
		erase( theline );
	    endloop;
	ENDPROCEDURE;

	PROCEDURE remove_line(what)
	    !---Find and delete all instances of the what pattern.
	    on_error
		[TPU$_STRNOTFOUND] : return;
	    endon_error;
	    loop
		position( beginning_of( main_buffer ) );
		theline := search( what, forward );
		position( beginning_of( theline ) );
		position( line_begin );
		start := mark( none );
		position( line_end );
		erase( create_range( start, mark( none ), none ) );
	    endloop;
	ENDPROCEDURE;

	!---First we get a buffer and read the rcg.h file.
	main_buffer := create_buffer( "main", "rcg.h" );

	!---Locate the RatRXIVersion[] array.
	position( beginning_of( main_buffer ) );
	theline := search( "RatRXIVersion[]", forward, exact );
	position( beginning_of( theline ) );
	position( line_begin );
	move_vertical( 1 );
	start := mark( none );
	position( beginning_of( main_buffer ) );
	erase( create_range( mark( none ), start, none ) );

	!---Locate the end of the array.
	theline := search( (SPAN("0 }") + ";") | "#ifdef ", forward );
	position( beginning_of( theline ) );
	position( line_begin );
	start := mark( none );
	position( end_of( main_buffer ) );
	erase( create_range( start, mark( none ), none ) );

	!---Remove all extraneous text.
	remove_all( SPAN(" ") + '"' );
	remove_all( '"' + SPAN(" ,") );

	!---Write out the result.
	write_file( main_buffer, "version.info" );
	quit;

$    CMD = "edit/tpu/nosection/nodisplay/command=rxi.tpu"
$    write sys$output CMD
$    CMD
$    delete rxi.tpu;*
$    return
$
$!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
$! Create Rxi.Tmp by editing RXI.XDefaults and replacing the definition of
$! menu.envMenuFile:, recognition:, and vt100.geometry: with values from rcg.h.
$!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
$
$ Rxi_Tmp :
$    gosub Version_Info
$    copy sys$input: rxi.tpu

	!----Procedure to locate a resource in a file and replace the value.
	PROCEDURE replace_resource(rname,value)
	    !---Locate the line we want to change.
	    position( beginning_of( main_buffer ) );
	    theline := search_quietly(
			 (rname @ thername) + SPAN(" 	<") + SCAN(">"),
			 forward, exact );
	    if theline = 0
	    then
		return;
	    endif;
	    !---Erase the old value of the resource.
	    position( end_of( thername ) );
	    move_horizontal( 1 );
	    start := mark( none );
	    position( line_end );
	    move_horizontal( -1 );
	    theline := create_range( start, mark( none ), none );
	    erase( theline );
	    !---Insert the new resource value.
	    copy_text( value );
	    return;
	ENDPROCEDURE

	!----Procedure to locate a line in a file and extract the value.
	PROCEDURE locate_value(rname)
	    !---Locate the line we want to change.
	    position( beginning_of( main_buffer ) );
	    theline := search( rname, forward, exact );
	    !---Get a range the value of the line.
	    position( end_of( theline ) );
	    move_horizontal( 1 );
	    start := mark( none );
	    position( line_end );
	    move_horizontal( -1 );
	    theline := create_range( start, mark( none ), none );
	    return theline;
	ENDPROCEDURE

$    open/append rxitpu rxi.tpu
$    write rxitpu "ENV := ""  " + XAPPLOADDIR + "RXI_Env_Menu"";"
$    close rxitpu
$    append sys$input: rxi.tpu

	WHITE := SPAN( " 	" );	! space and tab

	!---First we get a buffer and read the rcg.h file.
	main_buffer := create_buffer( "main", "rcg.h" );

	!---Locate resource values.
	RCG := locate_value( line_begin + "#define" + WHITE +
			     "defRV" + WHITE );
	RCG := "    " + substr( RCG, 2, length(RCG) - 2 );
	GEO := locate_value( line_begin + "#define" + WHITE +
			     "defGeometry" + WHITE );
	GEO := "    " + substr( GEO, 2, length(GEO) - 2 );

	!---Erase the buffer and read in the version.info file.
	erase( main_buffer );
	read_file( "version.info" );
	lines := get_info( main_buffer, "record_count" );
	position( beginning_of( main_buffer ) );
	loop
	    exitif lines = 0;
	    copy_text( "# " );
	    position( line_begin );
	    move_vertical( 1 );
	    lines := lines - 1;
	endloop;
	split_line;

	!---Add in the RXI.Xdefaults file.
	position( end_of( main_buffer ) );
	read_file( "RXI.Xdefaults" );

	!---Replace the various resources.
	replace_resource( line_begin + "*recognition:", RCG );
	replace_resource( line_begin + "*vt100.geometry:", GEO );
	replace_resource( line_begin + "*menu.envMenuFile:", ENV );

	!---Write out the result.
	write_file( main_buffer, "RXI.tmp" );
	quit;

$    CMD = "edit/tpu/nosection/nodisplay/command=rxi.tpu"
$    write sys$output CMD
$    CMD
$    delete rxi.tpu;*
$    return
$
$!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
$! Create Rxi.Tmp2 by editing RXI_Env_Menu and adding version.info to it.
$!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
$
$ Rxi_Tmp2 :
$    gosub Version_Info
$    copy sys$input: rxi.tpu

	!---First we get a buffer and read the version.info file.
	main_buffer := create_buffer( "main", "version.info" );

	!---Turn those lines into comments.
	lines := get_info( main_buffer, "record_count" );
	position( beginning_of( main_buffer ) );
	loop
	    exitif lines = 0;
	    copy_text( "/* " );
	    position( line_end );
	    copy_text( " */" );
	    position( line_begin );
	    move_vertical( 1 );
	    lines := lines - 1;
	endloop;
	split_line;

	!---Add in the RXI_Env_Menu file.
	position( end_of( main_buffer ) );
	read_file( "RXI_Env_Menu." );

	!---Write out the result.
	write_file( main_buffer, "RXI.tmp2" );
	quit;

$    CMD = "edit/tpu/nosection/nodisplay/command=rxi.tpu"
$    write sys$output CMD
$    CMD
$    delete rxi.tpu;*
$    return
$
$!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
$! Compile and Link everything; install everything.
$!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
$
$ install_all:
$    write sys$output "@makefile INSTALL.ALL"
$    gosub All
$    gosub Install_Pgm
$    gosub install_fonts
$    gosub install_help
$    return
$
$
$!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
$! Compile all .c files and produce all .obj files
$!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
$
$ Compile_All :
$
$!--Remove any blanks from the OBJS list.  Loop over all elements of the list.
$
$    OBJS	= f$edit( OBJS, "COLLAPSE" )
$    OBJI = 0
$ CA_Obj_Loop:
$    OBJ = f$element( OBJI, ",", OBJS )
$    if OBJ .eqs. "," then return
$
$!--Get the name of the .obj file, eg. scrollbar, and call the code that
$!  knows how to compile that file.
$
$    NAME = f$parse( OBJ, , , "NAME" )
$    gosub 'NAME'
$
$!--Loop for the next OBJ file.
$
$    OBJI = OBJI + 1
$    goto CA_Obj_Loop
$
$
$!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
$! PGMNAME = <program name, eg. rxi.exe>
$! DEPS = <object files, eg. main.obj,scroll.obj,...>
$! gosub Link_Pgm
$!
$! Link rxi together
$!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
$
$ Link_Pgm :
$    purge [...]*.*
$
$!--See if we need to link.
$
$    OBJ = PGMNAME
$    LNKS = f$edit( DEPS + "," + LINKLIBS + "," + VAXCRTL, "COLLAPSE" )
$    gosub Check_Deps
$    if FLAG .eq. 0 then return
$
$!--Put the .obj file list into a /OPTIONS file; the list is too long for the
$!  VMS command line.
$
$    on control_y then goto Abort_Link
$    NAME= f$parse( PGMNAME, , , "NAME" ) + ".tmp"
$    open/write link$options 'NAME'
$    LNKI = 0
$    LNK = f$element( LNKI, ",", LNKS )
$ Link_Loop:
$    LNKI = LNKI + 1
$    LNK2 = f$element( LNKI, ",", LNKS )
$    if LNK2 .eqs. "," then goto Link_Close
$    write link$options LNK, ",-"
$    LNK = LNK2
$    goto Link_Loop
$ Link_Close :
$    write link$options LNK
$    close link$options
$    on control_y then exit 4
$
$!--Now link it together.  Send the output to the LINK.LOG file.
$
$    CMD = "link /executable=" + PGMNAME + " " + LINKFLAGS + -
		" " + NAME + "/OPTIONS"
$    write/symbol sys$output CMD
$    type 'NAME'
$    on control_y then goto Abort_Link2
$    define sys$output link.log
$    CMD
$    LINK$SEVERITY = $SEVERITY
$    deassign sys$output
$    on control_y then exit 4
$
$!--If there were no error or warning then delete junque files.
$
$    if LINK$SEVERITY .ne. 1 then goto Link_Failure
$    delete 'NAME';*, link.log;*
$    return
$
$
$ Abort_Link :
$    close/error=Abort_Link2 link$options
$ Abort_Link2 :
$    exit 4
$
$ Abort_Link2 :
$    deassign sys$output
$ Link_Failure :
$    if f$search( PGMNAME ) .nes. "" then delete 'PGM';*
$    exit 4
$
$
$!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
$! Compilation of individual source files.
$!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
$
$ AsciiSink :
$    NAME := [.X11]AsciiSink
$    DEPS := rxios.h
$    gosub Compile_C_File
$    return
$
$ AsciiText :
$    NAME := [.X11]AsciiText
$    DEPS := rxios.h
$    gosub Compile_C_File
$    return
$
$ Atoms :
$    NAME := [.X11]Atoms
$    DEPS := rxios.h
$    gosub Compile_C_File
$    return
$
$ button :
$    NAME := button
$    DEPS := ptyx.h, data.h, error.h, menu.h, ratmenu.h, rxitelnet.h, rxios.h
$    gosub Compile_C_File
$    return
$
$ charproc :
$    NAME := charproc
$    DEPS := ptyx.h, VTparse.h, data.h, error.h, main.h, menu.h, ratmenu.h, -
	     rcg.h, rxitelnet.h, rxios.h
$    gosub Compile_C_File
$    return
$
$ RMCommand :
$    NAME := RMCommand
$    DEPS := RmCommandI.h, rxios.h, RMCommandP.h
$    gosub Compile_C_File
$    return
$ cursor :
$    NAME := cursor
$    DEPS := ptyx.h, rxios.h
$    gosub Compile_C_File
$    return
$
$ CvtStdSel :
$    NAME := [.X11]CvtStdSel
$    DEPS := rxios.h
$    gosub Compile_C_File
$    return
$
$ data :
$    NAME := data
$    DEPS := ptyx.h, data.h, rxios.h
$    gosub Compile_C_File
$    return
$
$ DefErrMsg :
$    NAME := [.X11]DefErrMsg
$    DEPS := rxios.h
$    gosub Compile_C_File
$    return
$
$ Dialog :
$    NAME := [.X11]Dialog
$    DEPS := rxios.h
$    gosub Compile_C_File
$    return
$
$ DiskSrc :
$    NAME := [.X11]DiskSrc
$    DEPS := rxios.h
$    gosub Compile_C_File
$    return
$
$ RMForm :
$    NAME := RMForm
$    DEPS := ratmenu.h, RMLabelP.h, RMLabel.h, RMSubP.h, RMSub.h, rxios.h, -
		RMCommandP.h, RMCommand.h, RMFormP.h, RMForm.h
$    gosub Compile_C_File
$    return
$
$ GrayPixmap :
$    NAME := [.X11]GrayPixmap
$    DEPS := rxios.h
$    gosub Compile_C_File
$    return
$
$ input :
$    NAME := input
$    DEPS := ptyx.h, data.h, ratmenu.h, rxitelnet.h, rxios.h
$    gosub Compile_C_File
$    return
$
$ Label :
$    NAME := [.X11]Label
$    DEPS := rxios.h
$    gosub Compile_C_File
$    return
$
$ Lower :
$    NAME := [.X11]Lower
$    DEPS := rxios.h
$    gosub Compile_C_File
$    return
$
$ main :
$    NAME := main
$    DEPS := ptyx.h, data.h, error.h, main.h, rcg.h, ratmenu.h, rxitelnet.h, -
		rxios.h
$    gosub Compile_C_File
$    return
$
$ menu :
$    NAME := menu
$    DEPS := menu.h, ptyx.h, data.h, rxios.h
$    gosub Compile_C_File
$    return
$
$ misc :
$    NAME := misc
$    DEPS := ptyx.h, data.h, error.h, gray.ic, wait.ic, waitmask.ic, -
		ratmenu.h, rxios.h
$    gosub Compile_C_File
$    return
$
$ ratmenu :
$    NAME := ratmenu
$    DEPS := ratmenu.h, RMShellP.h, RMShell.h, RMLabelP.h, RMLabel.h, -
	     RMSubP.h, RMSub.h, ptyx.h, data.h, menu.h, -
	     rxios.h, RMForm.h, RMCommand.h
$    gosub Compile_C_File
$    return
$
$ RMLabel :
$    NAME := RMLabel
$    DEPS := RMLabelP.h, RMLabel.h, rxios.h
$    gosub Compile_C_File
$    return
$
$ RMShell :
$    NAME := RMShell
$    DEPS := ratmenu.h, RMShellP.h, RMShell.h, rxios.h
$    gosub Compile_C_File
$    return
$
$ RMSub :
$    NAME := RMSub
$    DEPS := RMSubP.h, RMSub.h, rxios.h
$    gosub Compile_C_File
$    return
$
$ rxitelnet :
$    NAME := rxitelnet
$    DEPS := rxios.h
$    gosub Compile_C_File
$    return
$
$ screen :
$    NAME := screen
$    DEPS := ptyx.h, error.h, rxios.h
$    gosub Compile_C_File
$    return
$
$ Scroll :
$    NAME := [.X11]Scroll
$    DEPS := rxios.h
$    gosub Compile_C_File
$    return
$
$ Simple :
$    NAME := [.X11]Simple
$    DEPS := rxios.h
$    gosub Compile_C_File
$    return
$
$ scrollbar :
$    NAME := scrollbar
$    DEPS := ptyx.h, data.h, error.h, rxios.h
$    gosub Compile_C_File
$    return
$
$ StringSrc :
$    NAME := [.X11]StringSrc
$    DEPS := rxios.h
$    gosub Compile_C_File
$    return
$
$ StrToJust :
$    NAME := [.X11]StrToJust
$    DEPS := rxios.h
$    gosub Compile_C_File
$    return
$
$ StrToOrnt :
$    NAME := [.X11]StrToOrnt
$    DEPS := rxios.h
$    gosub Compile_C_File
$    return
$
$ StrToWidg :
$    NAME := [.X11]StrToWidg
$    DEPS := rxios.h
$    gosub Compile_C_File
$    return
$
$ tabs :
$    NAME := tabs
$    DEPS := ptyx.h, rxios.h
$    gosub Compile_C_File
$    return
$
$ Text :
$    NAME := [.X11]Text
$    DEPS := rxios.h
$    gosub Compile_C_File
$    return
$
$ TextTr :
$    NAME := [.X11]TextTr
$    DEPS := rxios.h
$    gosub Compile_C_File
$    return
$
$ util :
$    NAME := util
$    DEPS := ptyx.h, data.h, error.h, rxios.h
$    gosub Compile_C_File
$    return
$
$ VTPrsTbl :
$    NAME := VTPrsTbl
$    DEPS := VTparse.h, rxios.h
$    gosub Compile_C_File
$    return
$
$!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
$! Subroutines
$!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
$!
$!
$!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
$! OBJ = name of a directory
$! gosub Dir_Exists
$!
$! Called to make sure that a directory exists before we use it.
$!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
$
$ Dir_Exists:
$    if f$parse(OBJ) .nes. "" then return
$    CMD = "create/directory/protection=(" + DIRPROT + ")/owner=" + OWNER + -
		" " + OBJ
$    write sys$output CMD
$    CMD
$    return
$
$!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
$! NAME = name of a .C object, eg. "main"; no .c extension
$! DEPS = comma separated list of #include files, eg. "ptyx.h,data.h"
$! gosub Compile_C_File
$!
$! Called to create/update/check-on the 'NAME'.obj file.  If it does not exist
$! or if any file in DEPS is newer than 'NAME'.obj then recompile the 'NAME'.c
$! file.  We use the CC command-symbol defined above.
$!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
$
$ Compile_C_File :
$
$!--Does the .c file exist?  Fatal error if not.
$
$    SRC = NAME + ".c"
$    if f$search( SRC ) .nes. "" then goto CCF_Src_Ok
$	write sys$output "''NAME' is not a .c source file?"
$	exit 4
$ CCF_Src_Ok :
$
$!--Check the .obj file for existence and for dependencies.
$
$    OBJ = NAME + ".obj"
$    if DEPS .nes. "" then DEPS = SRC + "," + DEPS
$    if DEPS .eqs. "" then DEPS = SRC
$    gosub Check_Deps
$    if FLAG .eq. 0 then return
$
$!--One of the DEPS is newer than the OBJ or the OBJ does not exist, recompile
$!  the SRC file.
$
$ CCF_Compile:
$    CMD = "cc/OBJECT=" + OBJ + -
	   DEFINES + " " + CCFLAGS + " " + INCLUDES + " " + SRC
$    write/symbol sys$output CMD
$
$!--The silly CC compiler isn't smart enough to remove a .OBJ file if it is
$!  ^C'ed while running.  Get rid of the .OBJ file if we are interrupted.
$
$    on control_y then goto CCF_Failure
$    CMD
$    if $SEVERITY .ne. 1 then goto CCF_Failure
$    on control_y then exit 4
$    return
$
$ CCF_Failure :
$    if f$search( OBJ ) .nes. "" then delete 'OBJ';*
$    exit 4
$
$!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
$! OBJ  := name of a file, eg. main.obj or rxi.exe
$! DEPS := comma separated list of files, eg. "ptyx.h,gray.ic"
$! gosub Check_Deps
$! if FLAG .ne. 0 then <some file in DEPS is newer than the OBJ file>
$!
$! Called to see if any file contained in the DEPS list is newer than the OBJ
$! file.  Sets FLAG = 0 if OBJ is newer than DEPS and FLAG = 1 if OBJ is
$! older than some file from DEPS.  Also sets FLAG = 1 if OBJ does not exist.
$!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
$
$ Check_Deps :
$
$!--Does the OBJ file exist?
$
$    if f$search( OBJ ) .nes. "" then goto CD_Obj_Ok
$	FLAG = 1
$	return
$ CD_Obj_Ok :
$
$!--Get the last change date for the OBJ file to compare with the DEPS dates.
$!  Loop over all DEPS entries and check their dates.
$
$    ODATE = f$cvtime( f$file_attributes( OBJ, "RDT" ) )
$    DEPI = 0
$ CD_Dep_Loop:
$    DEP = f$element( DEPI, ",", DEPS )
$    if DEP .nes. "," then goto CD_Next_Dep
$	FLAG = 0
$	return
$ CD_Next_Dep :
$    DEPI = DEPI + 1
$
$!--If the DEP guy does not exist then complain.
$
$    if f$search( DEP ) .nes. "" then goto CD_Dep_Ok
$	write sys$output "''DEP', dependent file for ''OBJ' does not exist."
$	exit 4
$ CD_Dep_Ok :
$
$!--If the DEP is older than the OBJ then check the next DEP.
$
$    if f$cvtime( f$file_attributes( DEP, "RDT" ) ) .lts. ODATE then -
		goto CD_Dep_Loop
$
$!--One of the DEPS is newer than the OBJ, set FLAG and return.
$
$    FLAG = 1
$    return