1 # 23 September 2009. SMS.
3 # Wget 1.12 for VMS - MMS Dependency Description File.
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:
9 # $ MMS /EXTEND /DESCRIP = [-.VMS]DESCRIP_MKDEPS.MMS /SKIP
11 # which discards individual source dependency files, or:
13 # $ MMS /EXTEND /DESCRIP = [-.VMS]DESCRIP_MKDEPS.MMS /MACRO = NOSKIP=1
15 # which retains them. Retaining them can save time when doing code
19 # The default target is the comprehensive source dependency file,
20 # $(DEPS_FILE) = "DESCRIP_DEPS.MMS".
24 # CLEAN deletes the individual source dependency files,
25 # *.MMSD;*, but leaves the comprehensive source dependency
28 # CLEAN_ALL deletes all source dependency files, including the
29 # individual *.MMSD;* files and the comprehensive file,
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.
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.
42 # This description file uses this command procedure:
44 # [-.VMS]COLLECT_DEPS.COM
47 # Include the source file lists (among other data).
50 .INCLUDE DESCRIP_SRC.MMS
52 # Required command procedures.
54 COLLECT_DEPS = [-.$(DIR_VMS)]COLLECT_DEPS.COM
56 COMS = $(COLLECT_DEPS)
58 # The ultimate individual product, a comprehensive dependency list.
60 DEPS_FILE = DESCRIP_DEPS.MMS
62 # Detect valid qualifier and/or macro options.
64 .IF $(FINDSTRING Skip, $(MMSQUALIFIERS)) .eq Skip
70 .ENDIF # [else, complex]
72 # Dependency suffixes and rules.
74 # .FIRST is assumed to be used already, so the MMS qualifier/macro check
75 # is included in each rule (one way or another).
77 .SUFFIXES_BEFORE .C .MMSD
80 .IF UNK_MMSD # UNK_MMSD
82 " /SKIP_INTERMEDIATES is expected on the MMS command line."
84 " For normal behavior (delete .MMSD files), specify ""/SKIP""."
86 " To retain the .MMSD files, specify ""/MACRO = NOSKIP=1""."
89 $(CC) $(CFLAGS_ARCH) $(CFLAGS_INCL) $(CFLAGS_SPEC) -
90 /define = ($(CDEFS)) $(MMS$SOURCE) -
91 /NOLIST /NOOBJECT /MMS_DEPENDENCIES = (FILE = $(MMS$TARGET))
93 # List of MMS dependency files.
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.
101 # Complete list of C object dependency file names.
106 .IFDEF MODS_OBJS_LIB_LIB # MODS_OBJS_LIB_LIB
110 MODS_LIB_LIB = $(FILTER-OUT *], \
111 $(PATSUBST *]*.OBJ, *] *, $(MODS_OBJS_LIB_LIB)))
113 DEPS = $(FOREACH NAME, $(MODS_LIB_LIB), $(NAME).MMSD)
115 .ENDIF # MODS_OBJS_LIB_LIB
120 .IFDEF MODS_OBJS_LIB_MD5 # MODS_OBJS_LIB_MD5
124 MODS_LIB_MD5 = $(FILTER-OUT *], \
125 $(PATSUBST *]*.OBJ, *] *, $(MODS_OBJS_LIB_MD5)))
127 DEPS = $(FOREACH NAME, $(MODS_LIB_MD5), $(NAME).MMSD)
129 .ENDIF # MODS_OBJS_LIB_MD5
134 .IFDEF MODS_OBJS_LIB_SRC # MODS_OBJS_LIB_SRC
138 MODS_LIB_SRC = $(FILTER-OUT *], \
139 $(PATSUBST *]*.OBJ, *] *, $(MODS_OBJS_LIB_SRC)))
141 DEPS = $(FOREACH NAME, $(MODS_LIB_SRC), $(NAME).MMSD)
143 .ENDIF # MODS_OBJS_LIB_SRC
146 # Rules and actions depend on circumstances, main or subsidiary.
148 .IFDEF SUBSIDIARY # SUBSIDIARY
150 # Default target is the comprehensive dependency list.
152 $(DEPS_FILE) : $(DEPS) $(COMS)
153 .IF UNK_MMSD # UNK_MMSD
155 " /SKIP_INTERMEDIATES is expected on the MMS command line."
157 " For normal behavior (delete individual .MMSD files), specify ""/SKIP""."
159 " To retain the individual .MMSD files, specify ""/MACRO = NOSKIP=1""."
163 # Note that the space in P3, which prevents immediate macro
164 # expansion, is removed by COLLECT_DEPS.COM.
166 @$(COLLECT_DEPS) "Wget for VMS" "$(MMS$TARGET)" -
167 "[...]*.MMSD" "[.$ (DEST)]" $(MMSDESCRIPTION_FILE) -
170 "Created a new dependency file: $(MMS$TARGET)"
171 .IF DELETE_MMSD # DELETE_MMSD
173 "Deleting intermediate .MMSD files..."
174 if (f$search( "[...]*.MMSD") .nes. "") then -
175 delete /log [...]*.MMSD;*
178 "Purging intermediate .MMSD files..."
179 if (f$search( "[...]*.MMSD") .nes. "") then -
180 purge /keep = 2 /log [...]*.MMSD
181 .ENDIF # DELETE_MMSD [else]
183 # CLEAN target. Delete the individual C dependency files.
186 if (f$search( "[...]*.MMSD") .nes. "") then -
189 # CLEAN_ALL target. Delete:
190 # The individual C dependency files.
191 # The collected source dependency file.
194 if (f$search( "[...]*.MMSD") .nes. "") then -
196 if (f$search( "DESCRIP_DEPS.MMS") .nes. "") then -
197 delete DESCRIP_DEPS.MMS;*
202 # Main target is the specified target, everywhere.
204 # Note that the first actions use the normal description file to create
205 # some generated header files, before they are referenced.
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"
217 .IFDEF TARGET_$(MMSTARGETS) # TARGET_xxx
219 MAKE_GENERATED_HEADERS = X
220 .ENDIF # TARGET_xxx [else]
222 ALL, CLEAN, CLEAN_ALL, CLEAN_EXE, CLEAN_OLB :
223 set default 'f$parse( "$(MMSDESCRIPTION_FILE)", , , "DIRECTORY")'
225 @ write sys$output ""
226 $(MMS) /description = [-.VMS]DESCRIP.MMS $(MMSQUALIFIERS) -
228 set default [-.$(DIR_LIB)]
230 @ write sys$output ""
231 $(MMS) /description = $(MMSDESCRIPTION_FILE) $(MMSQUALIFIERS) -
233 .IFDEF MAKE_GENERATED_HEADERS # MAKE_GENERATED_HEADERS
234 $(MMS) /description = [-.VMS]DESCRIP.MMS $(MMSQUALIFIERS) -
236 .ENDIF # MAKE_GENERATED_HEADERS
237 set default [-.$(DIR_LIB)]
239 @ write sys$output ""
240 $(MMS) /description = $(MMSDESCRIPTION_FILE) $(MMSQUALIFIERS) -
242 set default [-.$(DIR_MD5)]
244 @ write sys$output ""
245 $(MMS) /description = $(MMSDESCRIPTION_FILE) $(MMSQUALIFIERS) -
247 set default [-.$(DIR_SRC)]
249 @ write sys$output ""
250 $(MMS) /description = $(MMSDESCRIPTION_FILE) $(MMSQUALIFIERS) -
253 .ENDIF # SUBSIDIARY [else]