File: link.com

package info (click to toggle)
ftnchek 2.11.2-2
  • links: PTS
  • area: main
  • in suites: potato
  • size: 5,392 kB
  • ctags: 2,790
  • sloc: ansic: 21,570; fortran: 2,921; yacc: 2,794; sh: 1,623; makefile: 693; lisp: 264; awk: 163
file content (50 lines) | stat: -rw-r--r-- 1,331 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
$! name: LINK.COM
$! author: R. Moniot
$! date: 14-Apr-87
$! purpose: bring C image up to date with its objects
$! usage:  @LINK OBJLIST
$!		Where OBJLIST is a comma-separated list of object files,
$!		OMITTING the extension .OBJ.
$!
$! Pick main module name from front of the list.  If .EXE file does not exist,
$! go to link.
$!
$ len = f$length(p1)
$ pos = f$locate(",",p1)
$ main = f$extract(0,pos,p1)
$ if f$search(main + ".EXE") .eqs. "" then goto Link
$!
$ exedate = f$cvtime(f$file_attributes(main + ".EXE","cdt")) 
$!
$!  Check against object module dates
$!
$ rest = p1
$ Loop:
$	len = f$length(rest)
$	pos = f$locate(",",rest)
$	module = f$extract(0,pos,rest)
$	if module .eqs. "" then goto Exit
$	if f$search(module + ".OBJ") .eqs. "" then goto NoSuchFile
$	objdate = f$cvtime(f$file_attributes(module + ".OBJ","cdt"))
$	if exedate .lts. objdate then goto Link
$	rest = f$extract(pos+1,len-pos-1,rest)
$ goto Loop
$!
$!	Image does not exist or is older than some objects: link
$!
$ Link:
$	write sys$output "LINK " + p1 + ",VAXC/OPT"
$	on warning then exit
$	link 'p1',vaxc/opt
$	exit
$!
$!	object is older than executable: all is OK
$!
$ Exit:
$	write sys$output main + ".EXE is up to date."
$	exit
$!
$ NoSuchFile:
$	write sys$output module + ".OBJ does not exist"
$! exit, and return control to command level
$	stop