File: link.com

package info (click to toggle)
ftnchek 3.3.1-7
  • links: PTS
  • area: main
  • in suites: forky, sid, trixie
  • size: 8,684 kB
  • sloc: ansic: 21,908; fortran: 5,748; yacc: 4,071; sh: 3,035; makefile: 895; lisp: 322; f90: 118; perl: 76
file content (52 lines) | stat: -rw-r--r-- 1,360 bytes parent folder | download | duplicates (6)
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
51
52
$! 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.
$!
$ On Control_Y Then Exit 2
$ On Warning Then Exit 2
$ 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
$	on warning then exit
$	link 'p1'
$	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