]> sjero.net Git - wget/blob - vms/COLLECT_DEPS.COM
Space before closing brace. Fixes paramcheck.pl output.
[wget] / vms / COLLECT_DEPS.COM
1 $!                                              12 April 2005.  SMS.
2 $!
3 $!    Collect all source file dependencies specified by P2,
4 $!    and add P3 prefix.
5 $!    Convert absolute dependencies to relative from P4.
6 $!    P1 = output file specification.
7 $!
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.
11 $!
12 $ prefix = f$edit( p3, "COLLAPSE")
13 $!
14 $ dev_lose = f$parse( p4, , , "DEVICE", "SYNTAX_ONLY")
15 $ dir_lose = f$parse( p4, , , "DIRECTORY", "SYNTAX_ONLY")
16 $ suffix = ".VMS]"
17 $ suffix_loc = f$locate( suffix, dir_lose)
18 $ if (suffix_loc .lt f$length( dir_lose))
19 $ then
20 $    dev_dir_lose = dev_lose+ dir_lose- suffix
21 $ else
22 $    dev_dir_lose = dev_lose+ dir_lose- "]"
23 $ endif
24 $!
25 $!!! write sys$output " d_d_l: ""''dev_dir_lose'""."
26 $!
27 $! For portability, make the output file record format Stream_LF.
28 $!
29 $ create /fdl = sys$input 'p1'
30 RECORD
31         Carriage_Control carriage_return
32         Format stream_lf
33 $!
34 $ open /read /write /error = end_main deps_out 'p1'
35 $ on error then goto loop_main_end
36 $!
37 $! Include proper-inclusion-check preface.
38 $!
39 $ incl_macro = "INCL_"+ f$parse( p1, , , "NAME", "SYNTAX_ONLY")
40 $ write deps_out "#"
41 $ write deps_out "# Wget for VMS - MMS (or MMK) Source Dependency File."
42 $ write deps_out "#"
43 $ write deps_out ""
44 $ write deps_out -
45    "# This description file is included by other description files.  It is"
46 $ write deps_out -
47    "# not intended to be used alone.  Verify proper inclusion."
48 $ write deps_out ""
49 $ write deps_out ".IFDEF ''incl_macro'"
50 $ write deps_out ".ELSE"
51 $ write deps_out -
52    "$$$$ THIS DESCRIPTION FILE IS NOT INTENDED TO BE USED THIS WAY."
53 $ write deps_out ".ENDIF"
54 $ write deps_out ""
55 $!
56 $! Actual dependencies from individual dependency files.
57 $!
58 $ loop_main_top:
59 $    file = f$search( p2)
60 $    if (file .eqs. "") then goto loop_main_end
61 $!
62 $    open /read /error = end_subs deps_in 'file'
63 $    loop_subs_top:
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)
71 $       then
72 $          front = f$extract( 0, (colon+ 3), line_reduced)
73 $          back = f$extract( (colon+ 3+ f$length( dev_dir_lose)), -
74             1000, line_reduced)
75 $          line = front+ "[-"+ back
76 $          write deps_out "''prefix'"+ "''line'"
77 $       endif
78 $    goto loop_subs_top
79 $!
80 $    loop_subs_end:
81 $    close deps_in
82 $!
83 $ goto loop_main_top
84 $!
85 $ loop_main_end:
86 $ close deps_out
87 $!
88 $ end_main:
89 $!