]> sjero.net Git - wget/blob - vms/DESCRIP_MKDEPS.MMS
NEWS: cite --start-pos
[wget] / vms / DESCRIP_MKDEPS.MMS
1 #                                               23 September 2009.  SMS.
2 #
3 #    Wget 1.12 for VMS - MMS Dependency Description File.
4 #
5 #    MMS /EXTENDED_SYNTAX description file to generate a C source
6 #    dependencies file.  Unsightly errors result when /EXTENDED_SYNTAX
7 #    is not specified.  Typical usage:
8 #
9 #    $ MMS /EXTEND /DESCRIP = [-.VMS]DESCRIP_MKDEPS.MMS /SKIP
10 #
11 #    which discards individual source dependency files, or:
12 #
13 #    $ MMS /EXTEND /DESCRIP = [-.VMS]DESCRIP_MKDEPS.MMS /MACRO = NOSKIP=1
14 #
15 #    which retains them.  Retaining them can save time when doing code
16 #    development.
17 #
18 #
19 # The default target is the comprehensive source dependency file,
20 # $(DEPS_FILE) = "DESCRIP_DEPS.MMS".
21 #
22 # Other targets:
23 #
24 #    CLEAN      deletes the individual source dependency files,
25 #               *.MMSD;*, but leaves the comprehensive source dependency
26 #               file.
27 #
28 #    CLEAN_ALL  deletes all source dependency files, including the
29 #               individual *.MMSD;* files and the comprehensive file,
30 #               DESCRIP_DEPS.MMS.*.
31 #
32 # MMK users without MMS will be unable to generate the dependencies file
33 # using this description file, however there should be one supplied in
34 # the kit.  If this file has been deleted, users in this predicament
35 # will need to recover it from the original distribution kit.
36 #
37 # Note:  This dependency generation scheme assumes that the dependencies
38 # do not depend on host architecture type or other such variables. 
39 # Therefore, no "#include" directive in the C source itself should be
40 # conditional on such variables.
41 #
42 # This description file uses this command procedure:
43 #
44 #    [-.VMS]COLLECT_DEPS.COM
45 #
46
47 # Include the source file lists (among other data).
48
49 INCL_DESCRIP_SRC = 1
50 .INCLUDE DESCRIP_SRC.MMS
51
52 # Required command procedures.
53
54 COLLECT_DEPS = [-.$(DIR_VMS)]COLLECT_DEPS.COM
55
56 COMS = $(COLLECT_DEPS)
57
58 # The ultimate individual product, a comprehensive dependency list.
59
60 DEPS_FILE = DESCRIP_DEPS.MMS
61
62 # Detect valid qualifier and/or macro options.
63
64 .IF $(FINDSTRING Skip, $(MMSQUALIFIERS)) .eq Skip
65 DELETE_MMSD = 1
66 .ELSIF NOSKIP
67 PURGE_MMSD = 1
68 .ELSE # [complex]
69 UNK_MMSD = 1
70 .ENDIF # [else, complex]
71
72 # Dependency suffixes and rules.
73 #
74 # .FIRST is assumed to be used already, so the MMS qualifier/macro check
75 # is included in each rule (one way or another).
76
77 .SUFFIXES_BEFORE .C .MMSD
78
79 .C.MMSD :
80 .IF UNK_MMSD                    # UNK_MMSD
81         @ write sys$output -
82  "   /SKIP_INTERMEDIATES is expected on the MMS command line."
83         @ write sys$output -
84  "   For normal behavior (delete .MMSD files), specify ""/SKIP""."
85         @ write sys$output -
86  "   To retain the .MMSD files, specify ""/MACRO = NOSKIP=1""."
87         @ exit %x00000004
88 .ENDIF                          # UNK_MMSD
89         $(CC) $(CFLAGS_ARCH) $(CFLAGS_INCL) $(CFLAGS_SPEC) -
90          /define = ($(CDEFS)) $(MMS$SOURCE) -
91          /NOLIST /NOOBJECT  /MMS_DEPENDENCIES = (FILE = $(MMS$TARGET))
92
93 # List of MMS dependency files.
94
95 # In case it's not obvious...
96 # To extract module name lists from object library module=object lists:
97 # 1.  Transform "module=[.dest]name.OBJ" into "module=[.dest] name".
98 # 2.  For a subdirectory, add "[.subdir]".
99 # 3.  Delete "*]" words.
100
101 # Complete list of C object dependency file names.
102
103
104 #    LIB.
105                                 
106 .IFDEF MODS_OBJS_LIB_LIB        # MODS_OBJS_LIB_LIB
107
108 SUBSIDIARY = 1
109
110 MODS_LIB_LIB = $(FILTER-OUT *], \
111  $(PATSUBST *]*.OBJ, *] *, $(MODS_OBJS_LIB_LIB)))
112
113 DEPS = $(FOREACH NAME, $(MODS_LIB_LIB), $(NAME).MMSD)
114
115 .ENDIF                          # MODS_OBJS_LIB_LIB
116
117
118 #    MD5.
119                                 
120 .IFDEF MODS_OBJS_LIB_MD5        # MODS_OBJS_LIB_MD5
121
122 SUBSIDIARY = 1
123
124 MODS_LIB_MD5 = $(FILTER-OUT *], \
125  $(PATSUBST *]*.OBJ, *] *, $(MODS_OBJS_LIB_MD5)))
126
127 DEPS = $(FOREACH NAME, $(MODS_LIB_MD5), $(NAME).MMSD)
128
129 .ENDIF                          # MODS_OBJS_LIB_MD5
130
131
132 #    SRC.
133                                 
134 .IFDEF MODS_OBJS_LIB_SRC        # MODS_OBJS_LIB_SRC
135
136 SUBSIDIARY = 1
137
138 MODS_LIB_SRC = $(FILTER-OUT *], \
139  $(PATSUBST *]*.OBJ, *] *, $(MODS_OBJS_LIB_SRC)))
140
141 DEPS = $(FOREACH NAME, $(MODS_LIB_SRC), $(NAME).MMSD)
142
143 .ENDIF                          # MODS_OBJS_LIB_SRC
144
145
146 # Rules and actions depend on circumstances, main or subsidiary.
147
148 .IFDEF SUBSIDIARY               # SUBSIDIARY
149
150 # Default target is the comprehensive dependency list.
151
152 $(DEPS_FILE) : $(DEPS) $(COMS)
153 .IF UNK_MMSD                        # UNK_MMSD
154         @ write sys$output -
155  "   /SKIP_INTERMEDIATES is expected on the MMS command line."
156         @ write sys$output -
157  "   For normal behavior (delete individual .MMSD files), specify ""/SKIP""."
158         @ write sys$output -
159  "   To retain the individual .MMSD files, specify ""/MACRO = NOSKIP=1""."
160         @ exit %x00000004
161 .ENDIF                              # UNK_MMSD
162 #
163 #       Note that the space in P3, which prevents immediate macro
164 #       expansion, is removed by COLLECT_DEPS.COM.
165 #
166         @$(COLLECT_DEPS) "Wget for VMS" "$(MMS$TARGET)" -
167          "[...]*.MMSD" "[.$ (DEST)]" $(MMSDESCRIPTION_FILE) -
168          "[-." $(DEST)
169         @ write sys$output -
170          "Created a new dependency file: $(MMS$TARGET)"
171 .IF DELETE_MMSD                     # DELETE_MMSD
172         @ write sys$output -
173          "Deleting intermediate .MMSD files..."
174         if (f$search( "[...]*.MMSD") .nes. "") then -
175          delete /log [...]*.MMSD;*
176 .ELSE                               # DELETE_MMSD
177         @ write sys$output -
178          "Purging intermediate .MMSD files..."
179         if (f$search( "[...]*.MMSD") .nes. "") then -
180          purge /keep = 2 /log [...]*.MMSD
181 .ENDIF                              # DELETE_MMSD [else]
182
183 # CLEAN target.  Delete the individual C dependency files.
184
185 CLEAN :
186         if (f$search( "[...]*.MMSD") .nes. "") then -
187          delete [...]*.MMSD;*
188
189 # CLEAN_ALL target.  Delete:
190 #    The individual C dependency files.
191 #    The collected source dependency file.
192
193 CLEAN_ALL :
194         if (f$search( "[...]*.MMSD") .nes. "") then -
195          delete [...]*.MMSD;*
196         if (f$search( "DESCRIP_DEPS.MMS") .nes. "") then -
197          delete DESCRIP_DEPS.MMS;*
198
199 .ELSE                           # SUBSIDIARY
200
201 #
202 # Main target is the specified target, everywhere.
203 #
204 # Note that the first actions use the normal description file to create
205 # some generated header files, before they are referenced.
206 #
207 # Generated headers must not be generated for any of the CLEAN* targets,
208 # because the CLEAN* actions may remove the required
209 # [.INC]DESCRIP_DEPS.MMS file.  The trick/mess here using "TARGET_xxx"
210 # does the job.
211 #
212 TARGET_CLEAN = X
213 TARGET_CLEAN_ALL = X
214 TARGET_CLEAN_EXE = X
215 TARGET_CLEAN_OLB = X
216
217 .IFDEF TARGET_$(MMSTARGETS)         # TARGET_xxx
218 .ELSE                               # TARGET_xxx
219 MAKE_GENERATED_HEADERS = X
220 .ENDIF                              # TARGET_xxx [else]
221
222 ALL, CLEAN, CLEAN_ALL, CLEAN_EXE, CLEAN_OLB :
223         set default 'f$parse( "$(MMSDESCRIPTION_FILE)", , , "DIRECTORY")'
224         show default
225         @ write sys$output ""
226         $(MMS) /description = [-.VMS]DESCRIP.MMS $(MMSQUALIFIERS) -
227          GENERATED_HEADERS
228         set default [-.$(DIR_LIB)]
229         show default
230         @ write sys$output ""
231         $(MMS) /description = $(MMSDESCRIPTION_FILE) $(MMSQUALIFIERS) -
232          $(MMSTARGETS)
233 .IFDEF MAKE_GENERATED_HEADERS       # MAKE_GENERATED_HEADERS
234         $(MMS) /description = [-.VMS]DESCRIP.MMS $(MMSQUALIFIERS) -
235          $(MMSTARGETS)
236 .ENDIF                              # MAKE_GENERATED_HEADERS
237         set default [-.$(DIR_LIB)]
238         show default
239         @ write sys$output ""
240         $(MMS) /description = $(MMSDESCRIPTION_FILE) $(MMSQUALIFIERS) -
241          $(MMSTARGETS)
242         set default [-.$(DIR_MD5)]
243         show default
244         @ write sys$output ""
245         $(MMS) /description = $(MMSDESCRIPTION_FILE) $(MMSQUALIFIERS) -
246          $(MMSTARGETS)
247         set default [-.$(DIR_SRC)]
248         show default
249         @ write sys$output ""
250         $(MMS) /description = $(MMSDESCRIPTION_FILE) $(MMSQUALIFIERS) -
251          $(MMSTARGETS)
252
253 .ENDIF                          # SUBSIDIARY [else]
254