Trailing-Edge
-
PDP-10 Archives
-
tops20tools_v6_9-jan-86_dumper
-
tools/compil2/load.com
There are 5 other files named load.com in the archive. Click here to see a list.
$ ! LOAD.COM - link together .OBJ's only if .EXE is stale
$ SAVE_VERIFY := 'COMMAND$DEBUG ! COMMAND$DEBUG == 1 to see more
$ SAVE_VERIFY = 'F$VERIFY( SAVE_VERIFY .AND. F$VERIFY( ) ) ! economize logs
$ COMMAND$DEBUG := 'COMMAND$DEBUG
$ GOTO START ! even in VERIFY mode, economize logging
$ ! This command COMPILE's programs and then conditionally LINK's programs,
$ ! by checking the revision date of the first-named .EXE against the dates
$ ! of the listed names' .OBJ files. If any newer .OBJ noticed, LINK!
$ !
$ ! To use:
$ ! $ @LOAD progid
$ ! or:
$ ! $ @LOAD progid1,progid2,...,progidn
$ ! or:
$ ! $ @LOAD @progid.lst
$ ! In the latter case, all the progid's in the indirect file are
$ ! conditionally LOADed.
$ !
$ ! REVISION HISTORY
$ !
$ ! 6-Sep-84 PFK added comma-separated list parameter handling
$ ! added "?" help
$ ! fixed up some comments
$ ! Peter F. Klammer
$ !
$ ! 20-Sep-84 PFK same global symbol for COMPILE, LOAD, and EXECUTE
$ !
$ ! 20-Sep-84 PFK p2 parameter: EXECUTE call, then no extra COMPILE
$ !
$ ! 26-Sep-84 PFK changed ".OBJ.*" to ".OBJ;0" for search filespec
$ !
$ ! 2-Oct-84 PFK p2 parameter: /COMPILE forced compile, passed on.
$ !
$ ! 2-Oct-84 PFK for debugging only, COMMAND$DEBUG == 1;
$ ! for full trace, COMMAND$DEBUG == 1 and SET VERIFY;
$ ! SET VERIFY alone, default for batch, is suppressed
$ !
$ ! 23-OCT-1984 PFK show full filespec in "up-to-date" message
$ ! if @filespec, do the LINK filespec/OPT
$ !
$ ! END REVISION HISTORY
$START:
$ STATUS = 1
$ ON CONTROL_Y THEN GOTO ABORT
$ ON ERROR THEN GOTO ABORT
$ PV := 'COMPILE$LOAD$EXECUTE$FILESPEC ! was there any previous value?
$ IF PV .EQS. "" THEN COMPILE$LOAD$EXECUTE$FILESPEC == "" ! global now exists
$TRYP1:
$ IF p1 .EQS. "" THEN p1 = COMPILE$LOAD$EXECUTE$FILESPEC ! {RET} given, use global memory
$ IF p1 .NES. "?" THEN GOTO GETP1
$ WRITE SYS$OUTPUT "$ LOAD (programs) ?"
$ TYPE SYS$INPUT:
PROGID name of a source and object module to conditionally LINK
or,
PROGI1,PROGI1,... list of names, for PROGI1.EXE
or,
@PROGID.LST filename of a list of modules, for PROGID.EXE
or,
{RETURN} remembers previous LOAD parameter
$ p1 = ""
$GETP1:
$ IF p1 .NES. "" THEN GOTO GOTP1 ! if no parameter yet, keep trying
$ INQUIRE/NOPUNCT p1 "$ LOAD (programs) "
$ GOTO TRYP1
$GOTP1:
$ COMPILE$LOAD$EXECUTE$FILESPEC == p1 ! global now set
$ IF p2 .NES. "EXECUTE$CALLING" THEN $ COMPILE 'p1 'p2 ! first get all compiled
$ FILE = ""
$ LINE = p1
$ IF F$EXTRACT(0,1,p1) .NES. "@" THEN GOTO GETPROGID
$ FILE = p1 - "@"
$ OPEN/READ AT &FILE
$READP1:
$ READ/END=EOF AT LINE
$ IF COMMAND$DEBUG THEN WRITE SYS$OUTPUT " [LOAD: indirect file line:''LINE']"
$ LINE = LINE - "-"
$GETPROGID:
$ IF COMMAND$DEBUG THEN WRITE SYS$OUTPUT " [LOAD: now line has:''LINE']"
$ IF LINE .EQS. "" THEN GOTO READP1
$ PROGID = F$EXTRACT(0,F$LOCATE(",",LINE),LINE)
$ LINE = LINE - PROGID
$ LINE = LINE - ","
$ IF COMMAND$DEBUG THEN WRITE SYS$OUTPUT " [LOAD: next module is:''PROGID']"
$DOPROGID:
$ EXENAME := 'EXENAME
$ IF EXENAME .NES. "" THEN GOTO GOTEXE
$ EXENAME = PROGID
$ EXESPEC = F$SEARCH(EXENAME+".EXE")
$ EXESTAMP = "0000-00-00 00:00:00"
$ IF EXESPEC .NES. "" THEN EXESTAMP = F$CVTIME(F$FILE_ATTRIBUTE(EXESPEC,"RDT"))
$GOTEXE:
$ PARSPEC = F$PARSE(PROGID,,,"NAME") + ".OBJ;0"
$ IF COMMAND$DEBUG -
THEN WRITE SYS$OUTPUT " [LOAD: searching for ''PARSPEC']"
$ FILESPEC = F$SEARCH(PARSPEC)
$ IF COMMAND$DEBUG -
THEN WRITE SYS$OUTPUT " [LOAD: next filespec is: ''FILESPEC']"
$ IF FILESPEC .EQS. "" THEN GOTO DIDPROGID
$ TYPE = F$PARSE(FILESPEC,,,"TYPE") - "."
$ TIMESTAMP = F$CVTIME(F$FILE_ATTRIBUTE(FILESPEC,"RDT"))
$ IF TIMESTAMP .GTS. EXESTAMP THEN GOTO LINK
$ IF ( LINE .NES. "" ) .OR. ( FILE .NES. "" ) THEN GOTO GETPROGID
$EOF:
$ WRITE SYS$OUTPUT " [LOAD: no LINK; ''EXESPEC' up-to-date.]"
$ GOTO END
$LINK:
$ LINKING = p1
$ IF FILE .NES. "" THEN LINKING = FILE + "/OPT"
$ WRITE SYS$OUTPUT "$ LINK ''LINKING'"
$ LINK 'LINKING'
$ GOTO END
$ABORT:
$ SET NOCONTROL=Y ! be sure control-Y trapping cleared
$ SET CONTROL=Y
$ STATUS = 4 + %X10000000 ! failure + message already shown
$END:
$ CLOSE/ERROR=IGNORE AT
$IGNORE:
$ SAVE_VERIFY := 'F$VERIFY(SAVE_VERIFY)'
$ EXIT STATUS