3 $! Collect all source file dependencies specified by P2,
5 $! Convert absolute dependencies to relative from P4.
6 $! P1 = output file specification.
8 $! MMS /EXTENDED_SYNTAX can't easily pass a macro invocation for P3, so
9 $! we remove any internal spaces which might have been added to prevent
10 $! immediate evaluation of a macro invocation.
12 $ prefix = f$edit( p3, "COLLAPSE")
14 $ dev_lose = f$parse( p4, , , "DEVICE", "SYNTAX_ONLY")
15 $ dir_lose = f$parse( p4, , , "DIRECTORY", "SYNTAX_ONLY")
17 $ suffix_loc = f$locate( suffix, dir_lose)
18 $ if (suffix_loc .lt f$length( dir_lose))
20 $ dev_dir_lose = dev_lose+ dir_lose- suffix
22 $ dev_dir_lose = dev_lose+ dir_lose- "]"
25 $!!! write sys$output " d_d_l: ""''dev_dir_lose'""."
27 $! For portability, make the output file record format Stream_LF.
29 $ create /fdl = sys$input 'p1'
31 Carriage_Control carriage_return
34 $ open /read /write /error = end_main deps_out 'p1'
35 $ on error then goto loop_main_end
37 $! Include proper-inclusion-check preface.
39 $ incl_macro = "INCL_"+ f$parse( p1, , , "NAME", "SYNTAX_ONLY")
41 $ write deps_out "# Wget for VMS - MMS (or MMK) Source Dependency File."
45 "# This description file is included by other description files. It is"
47 "# not intended to be used alone. Verify proper inclusion."
49 $ write deps_out ".IFDEF ''incl_macro'"
50 $ write deps_out ".ELSE"
52 "$$$$ THIS DESCRIPTION FILE IS NOT INTENDED TO BE USED THIS WAY."
53 $ write deps_out ".ENDIF"
56 $! Actual dependencies from individual dependency files.
59 $ file = f$search( p2)
60 $ if (file .eqs. "") then goto loop_main_end
62 $ open /read /error = end_subs deps_in 'file'
64 $ read /error = loop_subs_end deps_in line
65 $ line_reduced = f$edit( line, "COMPRESS, TRIM")
66 $ colon = f$locate( " : ", line_reduced)
67 $ if (colon .ge. f$length( line_reduced)) then goto loop_subs_top
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
76 $ write deps_out "''prefix'"+ "''line'"