1
$! 1 December 2006. SMS.
3
$! Info-ZIP VMS accessory procedure.
5
$! For the product named by P1,
6
$! collect all source file dependencies specified by P3,
8
$! Convert absolute dependencies to relative from one level above P5.
9
$! P2 = output file specification.
11
$! MMS /EXTENDED_SYNTAX can't easily pass a macro invocation for P4, so
12
$! we remove any internal spaces which might have been added to prevent
13
$! immediate evaluation of a macro invocation.
15
$ prefix = f$edit( p4, "COLLAPSE")
17
$ dev_lose = f$edit( f$parse( p5, , , "DEVICE", "SYNTAX_ONLY"), "UPCASE")
18
$ dir_lose = f$edit( f$parse( p5, , , "DIRECTORY", "SYNTAX_ONLY"), "UPCASE")
20
$ suffix_loc = f$locate( suffix, dir_lose)
21
$ if (suffix_loc .lt f$length( dir_lose))
23
$ dev_dir_lose = dev_lose+ dir_lose- suffix
25
$ dev_dir_lose = dev_lose+ dir_lose- "]"
28
$! For portability, make the output file record format Stream_LF.
30
$ create /fdl = sys$input 'p2'
32
Carriage_Control carriage_return
35
$ open /read /write /error = end_main deps_out 'p2'
36
$ on error then goto loop_main_end
38
$! Include proper-inclusion-check preface.
40
$ incl_macro = "INCL_"+ f$parse( p2, , , "NAME", "SYNTAX_ONLY")
42
$ write deps_out "# ''p1' for VMS - MMS (or MMK) Source Dependency File."
46
"# This description file is included by other description files. It is"
48
"# not intended to be used alone. Verify proper inclusion."
50
$ write deps_out ".IFDEF ''incl_macro'"
51
$ write deps_out ".ELSE"
53
"$$$$ THIS DESCRIPTION FILE IS NOT INTENDED TO BE USED THIS WAY."
54
$ write deps_out ".ENDIF"
57
$! Actual dependencies from individual dependency files.
60
$ file = f$search( p3)
61
$ if (file .eqs. "") then goto loop_main_end
63
$ open /read /error = end_subs deps_in 'file'
65
$ read /error = loop_subs_end deps_in line
66
$ line_reduced = f$edit( line, "COMPRESS, TRIM, UPCASE")
67
$ colon = f$locate( " : ", line_reduced)
68
$ d_d_l_loc = f$locate( dev_dir_lose, -
69
f$extract( (colon+ 3), 1000, line_reduced))
70
$ if (d_d_l_loc .eq. 0)
72
$ front = f$extract( 0, (colon+ 3), line_reduced)
73
$ back = f$extract( (colon+ 3+ f$length( dev_dir_lose)), -
75
$ line = front+ "["+ back
77
$ write deps_out "''prefix'"+ "''line'"