Debian Codegraph @

vms/descrip.mms

raw
1 # Descrip.MMS -- Makefile for building GNU awk on VMS.
2 #
3 # usage:
4 # $ MMS /Description=[.vms]Descrip.MMS gawk
5 # possibly add `/Macro=("GNUC=1")' to compile with GNU C,
6 # or add `/Macro=("GNUC=1","DO_GNUC_SETUP=1")' to compile with GNU C
7 # on a system where GCC is not installed as a defined command,
8 # or add `/Macro=("VAXC=1")' to compile with VAX C,
9 # or add `/Macro=("VAXC=1","CC=cc/VAXC")' to compile with VAX C on
10 # a system which has DEC C installed as the default compiler.
11 #
12 # gawk.exe :
13 # This is the default target. DEC C has become the default compiler.
14 #
15 # awkgram.c :
16 # If you don't have bison but do have VMS POSIX or DEC/Shell,
17 # change the PARSER and PASERINIT macros to use yacc. If you don't
18 # have either yacc or bison, you'll have to make sure that the
19 # distributed version of "awkgram.c" has its modification date later
20 # than the date of "awkgram.y", so that MMS won't try to build that
21 # target. If you use bison and it is already defined system-wide,
22 # comment out the PARSERINIT definition.
23 #
24 # command.c :
25 # Similar to awkgram.c; built from command.y with yacc or bison.
26 #
27 # install.help :
28 # You can make the target 'install.help' to load the VMS help text
29 # into a help library. Modify the HELPLIB macro if you don't want
30 # to put entry into the regular VMS library. (If you use an alternate
31 # help library, it must already exist; this target won't create it.)
32 #
33 # gawk.dvi :
34 # If you have TeX, you can make the target 'gawk.dvi' to process
35 # _The_GAWK_Manual_ from gawk.texi. You'll need to use a device
36 # specific post-processor on gawk.dvi in order to get printable data.
37 # The full output is approximately 325 pages.
38 #
39
40 # location of various source files, relative to the 'main' directory
41 MALLOC = sys$disk:[.support.malloc]
42 SUPPORT = sys$disk:[.support]
43 VMSDIR = sys$disk:[.vms]
44 DOCDIR = sys$disk:[.doc]
45 MISSNGD = sys$disk:[.missing_d]
46 MAKEFILE = $(VMSDIR)Descrip.MMS
47
48 # debugging &c !'ccflags' is an escape to allow external compile flags
49 #CCFLAGS = /noOpt/Debug
50
51 # a comma separated list of macros to define
52 # Do not specify _POSIX_EXIT here, other tricks are used for this.
53 CDEFS = "GAWK","HAVE_CONFIG_H"
54
55 .ifdef GNUC
56 # assumes VAX
57 # GCC has not been tested for decades.
58 # GCC/VAX since OpenVMS 5.5 can use the AACRTL060 redistributable
59 # kit instead of vaxcrtl.olb for much better results.
60 # This will likely need a lot of changes if GCC is re-implemented
61 # for OpenVMS.
62 CC = gcc
63 CFLAGS = /Incl=([],$(VMSDIR))/Obj=[]/Def=($(CDEFS)) $(CCFLAGS)
64 LIBS = gnu_cc:[000000]gcclib.olb/Library,sys$library:vaxcrtl.olb/Library
65 .ifdef DO_GNUC_SETUP
66 # in case GCC command verb needs to be manually defined
67 .first
68 set command gnu_cc:[000000]gcc
69 .endif !DO_GNUC_SETUP
70 .else !!GNUC
71 .ifdef VAXC
72 # always VAX; versions of VAX C older than V3.2 won't work
73 # VAXC SUPPORT will likely be removed in a future release
74 # VAXC should not be used past OpenVMS/VAX 5.4
75 # Before VAX 5.4 consider using GCC/VAX
76 # Obviously this has also not been tested for decades
77 CC = cc
78 CFLAGS = /Incl=[]/Obj=[]/Opt=noInline/Def=($(CDEFS)) $(CCFLAGS)
79 LIBS = sys$share:vaxcrtl.exe/Shareable
80 .else !!VAXC
81 # neither GNUC nor VAXC, assume DECC (same for either VAX or Alpha)
82 .ifdef __VAX__
83 CFLOAT =
84 .else
85 CFLOAT = /float=ieee/ieee_mode=denorm_results
86 .endif
87 CNAME = /NAME=(AS_IS,SHORT)
88 CC = cc/DECC/Prefix=All/NESTED_INCLUDE=NONE$(CFLOAT)
89 CINC1 = sys$disk:[],sys$disk:[.VMS],$(SUPPORT)
90 CFLAGS = /Incl=($(CINC1))/Obj=[]/Def=($(CDEFS))$(CNAME) $(CCFLAGS)
91 CEFLAGS = /Incl=($(CINC1),[.missing_d],[.extension])$(CNAME) $(CCFLAGS)
92 LIBS = # DECC$SHR instead of VAXCRTL, no special link option needed
93 .endif !VAXC
94 .endif !GNUC
95
96
97 PARSER = bison
98 PARSERINIT = set command gnu_bison:[000000]bison
99 #PARSER = yacc
100 #PARSERINIT = yacc := posix/run/path=posix """/bin/yacc"
101 #PARSERINIT = yacc := $shell$exe:yacc
102
103 # this is used for optional target 'install.help'
104 HELPLIB = sys$help:helplib.hlb
105 #HELPLIB = sys$help:local.hlb
106
107 #
108 ######## nothing below this line should need to be changed ########
109 #
110
111 ECHO = write sys$output
112 NOOP = continue
113
114 # object files
115 GAWKOBJ = eval.obj,profile.obj
116 AWKOBJ1 = array.obj,awkgram.obj,builtin.obj,cint_array.obj,\
117 command.obj,debug.obj,dfa.obj,dynarrray_resize.obj,ext.obj,field.obj,\
118 floatcomp.obj,gawkapi.obj,gawkmisc.obj,getopt.obj,getopt1.obj
119
120 AWKOBJ2 = int_array.obj,io.obj,localeinfo.obj,main.obj,mpfr.obj,msg.obj,\
121 node.obj,random.obj,re.obj,regex.obj,replace.obj,\
122 str_array.obj,symbol.obj,version.obj,printf.obj
123
124 AWKOBJS = $(AWKOBJ1),$(AWKOBJ2)
125
126 # VMSOBJS
127 # VMS specific stuff
128 VMSCODE = vms_misc.obj,vms_popen.obj,vms_fwrite.obj,vms_args.obj,\
129 vms_gawk.obj,vms_cli.obj,vms_crtl_init.obj
130 VMSCMD = gawk_cmd.obj # built from .cld file
131 VMSOBJS = $(VMSCODE),$(VMSCMD)
132
133 DOCS= $(DOCDIR)gawk.1,$(DOCDIR)gawk.texi,$(DOCDIR)texinfo.tex
134
135 # generic target
136 all : gawk gawk_debug
137 @ $(NOOP)
138
139 # dummy target to allow building "gawk" in addition to explicit "gawk.exe"
140 gawk : gawk.exe
141 @ $(ECHO) "$< is up to date"
142
143 gawk_debug : gawk_debug.exe
144 @ $(ECHO) "$< is up to date"
145
146 # rules to build gawk
147 gawk.exe : $(GAWKOBJ) $(AWKOBJS) $(VMSOBJS) gawk.opt
148 $(LINK) $(LINKFLAGS)/EXE=$(MMS$TARGET) gawk.opt/options
149
150 gawk_debug.exe : $(GAWKOBJ) $(AWKOBJS) $(VMSOBJS) gawk.opt
151 $(LINK) $(LINKFLAGS)/DEBUG/EXE=$(MMS$TARGET) gawk.opt/options
152
153 gawk.opt : $(MAKEFILE) config.h # create linker options file
154 @ open/write opt sys$disk:[]gawk.opt ! ~ 'cat <<close >gawk.opt'
155 @ write opt "! GAWK -- GNU awk"
156 @ write opt "$(GAWKOBJ)"
157 @ write opt "$(AWKOBJ1)"
158 @ write opt "$(AWKOBJ2)"
159 @ write opt "$(VMSOBJS)"
160 @ write opt "psect_attr=environ,noshr !extern [noshare] char **"
161 @ write opt "stack=48 !preallocate more pages (default is 20)"
162 @ write opt "iosegment=128 !ditto (default is 32)"
163 @ write opt "$(LIBS)"
164 @ close opt
165 $ @$(VMSDIR)gawk_ident.com
166
167 $(VMSCODE) : awk.h config.h $(VMSDIR)redirect.h $(VMSDIR)vms.h
168 $(AWKOBJS) : awk.h gettext.h $(SUPPORT)regex.h \
169 $(SUPPORT)dfa.h config.h $(VMSDIR)redirect.h
170 $(GAWKOBJ) : awk.h config.h $(VMSDIR)redirect.h
171
172 #-----------------------------------------------------------------------------
173 # Older versions of MMS have problems handling lower case file names typically
174 # found on ODS-5 disks. Fix this by adding explicit dependencies.
175 #_____________________________________________________________________________
176
177 array.obj : array.c
178 awkgram.obj : awkgram.c awk.h
179 builtin.obj : builtin.c floatmagic.h $(SUPPORT)random.h
180 cint_array.obj : cint_array.c
181 command.obj : command.c cmd.h
182 debug.obj : debug.c cmd.h
183 dfa.obj : $(SUPPORT)dfa.c $(SUPPORT)dfa.h
184
185 # MMS 4.O gets MMS$SOURCE wrong here
186 dynarrray_resize.obj : $(MALLOC)dynarray_resize.c $(MALLOC)dynarray.h
187 $define/user malloc $(MALLOC)
188 $(CC)$(CEFLAGS)/define=(HAVE_CONFIG_H)/object=$(MMS$TARGET) \
189 $(MALLOC)dynarray_resize.c
190
191 ext.obj : ext.c
192 eval.obj : eval.c
193 field.obj : field.c
194 floatcomp.obj : floatcomp.c
195 gawkapi.obj : gawkapi.c
196 gawkmisc.obj : gawkmisc.c $(VMSDIR)gawkmisc.vms
197 getopt.obj : $(SUPPORT)getopt.c
198 getopt1.obj : $(SUPPORT)getopt1.c
199 int_array.obj : int_array.c
200 io.obj : io.c
201 localeinfo.obj : $(SUPPORT)localeinfo.c
202 main.obj : main.c
203 msg.obj : msg.c
204 mpfr.obj : mpfr.c
205 node.obj : node.c
206 printf.obj : printf.c
207 profile.obj : profile.c
208 random.obj : $(SUPPORT)random.c $(SUPPORT)random.h
209 re.obj : re.c
210
211 # MMS 4.O gets MMS$SOURCE wrong here
212 regex.obj : $(SUPPORT)regex.c $(SUPPORT)regcomp.c \
213 $(SUPPORT)regex_internal.c $(SUPPORT)regexec.c \
214 $(SUPPORT)regex.h $(SUPPORT)regex_internal.h \
215 $(MALLOC)dynarray.h
216 $define/user malloc $(MALLOC)
217 $(CC)$(CEFLAGS)/define=(HAVE_CONFIG_H)/object=$(MMS$TARGET) \
218 $(SUPPORT)regex.c
219
220 str_array.obj : str_array.c
221 symbol.obj : symbol.c
222 version.obj : version.c
223 vms_misc.obj : $(VMSDIR)vms_misc.c
224 vms_popen.obj : $(VMSDIR)vms_popen.c
225 vms_fwrite.obj : $(VMSDIR)vms_fwrite.c
226 vms_args.obj : $(VMSDIR)vms_args.c
227 vms_gawk.obj : $(VMSDIR)vms_gawk.c
228 vms_cli.obj : $(VMSDIR)vms_cli.c
229 vms_crtl_init.obj : $(VMSDIR)vms_crtl_init.c
230 replace.obj : replace.c $(MISSNGD)system.c $(MISSNGD)memcmp.c \
231 $(MISSNGD)memcpy.c $(MISSNGD)memset.c $(MISSNGD)memmove.c \
232 $(MISSNGD)strncasecmp.c $(MISSNGD)strerror.c \
233 $(MISSNGD)strftime.c $(MISSNGD)strchr.c $(MISSNGD)strtod.c \
234 $(MISSNGD)strtoul.c $(MISSNGD)tzset.c $(MISSNGD)mktime.c \
235 $(MISSNGD)snprintf.c $(MISSNGD)getaddrinfo.c \
236 $(MISSNGD)usleep.c \
237 $(MISSNGD)setenv.c $(MISSNGD)strcoll.c $(MISSNGD)wcmisc.c
238
239 # bison or yacc have not been ported to current VMS versions
240 # When that changes, this can be restored.
241 # bison or yacc required
242 # awkgram.c : awkgram.y # foo.y :: yacc => y[_]tab.c, bison => foo_tab.c
243 # @- if f$search("ytab.c") .nes."" then delete ytab.c;* !POSIX yacc
244 # @- if f$search("y_tab.c") .nes."" then delete y_tab.c;* !DEC/Shell yacc
245 # @- if f$search("awkgram_tab.c").nes."" then delete awkgram_tab.c;* !bison
246 # - $(PARSERINIT)
247 # $(PARSER) $(YFLAGS) $<
248 # @- if f$search("ytab.c") .nes."" then rename/new_vers ytab.c $@
249 # @- if f$search("y_tab.c") .nes."" then rename/new_vers y_tab.c $@
250 # @- if f$search("awkgram_tab.c").nes."" then \
251 # rename/new_vers awkgram_tab.c $@
252
253 # command.c : command.y
254 # @- if f$search("ytab.c") .nes."" then delete ytab.c;*
255 # @- if f$search("y_tab.c") .nes."" then delete y_tab.c;*
256 # @- if f$search("command_tab.c").nes."" then delete command_tab.c;*
257 # - $(PARSERINIT)
258 # $(PARSER) $(YFLAGS) $<
259 # @- if f$search("ytab.c") .nes."" then rename/new_vers ytab.c $@
260 # @- if f$search("y_tab.c") .nes."" then rename/new_vers y_tab.c $@
261 # @- if f$search("command_tab.c").nes."" then \
262 # rename/new_vers command_tab.c $@
263
264 config_vms.h : $(VMSDIR)generate_config_vms_h_gawk.com
265 $ @$(VMSDIR)generate_config_vms_h_gawk.com
266
267 config.h : configh.in config_vms.h $(VMSDIR)config_h.com
268 $ @$(VMSDIR)config_h.com
269
270 $(VMSCMD) : $(VMSDIR)gawk.cld
271 set command $(CLDFLAGS)/object=$@ $<
272
273 # special target for loading the help text into a VMS help library
274 install.help : $(VMSDIR)gawk.hlp
275 library/help $(HELPLIB) $< /log
276
277
278 # Build dynamic extensions - Alpha/Itanium only.
279 .ifdef __VAX__
280 # VAX not complete yet.
281 plug_opt = [.VMS.VAX]gawk_plugin_xfer.opt
282 .else
283 plug_opt = [.vms]gawk_plugin.opt
284 .endif
285
286 ext_gawkdirfd_h = [.extension]gawkdirfd.h config.h nonposix.h
287
288 extensions : filefuncs.exe fnmatch.exe inplace.exe ordchr.exe readdir.exe \
289 revoutput.exe revtwoway.exe rwarray.exe testext.exe time.exe
290 @ write sys$output "$< are up to date"
291
292 filefuncs.exe : filefuncs.obj stack.obj gawkfts.obj $(plug_opt)
293 link/share=$(MMS$TARGET) $(MMS$SOURCE), stack.obj, gawkfts.obj, \
294 $(plug_opt)/opt
295
296 fnmatch.exe : fnmatch.obj $(plug_opt)
297 link/share=$(MMS$TARGET) $(MMS$SOURCE), $(plug_opt)/opt
298
299 inplace.exe : inplace.obj $(plug_opt)
300 link/share=$(MMS$TARGET) $(MMS$SOURCE), $(plug_opt)/opt
301
302 ordchr.exe : ordchr.obj $(plug_opt)
303 link/share=$(MMS$TARGET) $(MMS$SOURCE), $(plug_opt)/opt
304
305 readdir.exe : readdir.obj $(plug_opt)
306 link/share=$(MMS$TARGET) $(MMS$SOURCE), $(plug_opt)/opt
307
308 revoutput.exe : revoutput.obj $(plug_opt)
309 link/share=$(MMS$TARGET) $(MMS$SOURCE), $(plug_opt)/opt
310
311 revtwoway.exe : revtwoway.obj $(plug_opt)
312 link/share=$(MMS$TARGET) $(MMS$SOURCE), $(plug_opt)/opt
313
314 rwarray.exe : rwarray.obj $(plug_opt)
315 link/share=$(MMS$TARGET) $(MMS$SOURCE), $(plug_opt)/opt
316
317 testext.exe : testext.obj $(plug_opt)
318 link/share=$(MMS$TARGET) $(MMS$SOURCE), $(plug_opt)/opt
319
320 time.exe : time.obj $(plug_opt)
321 link/share=$(MMS$TARGET) $(MMS$SOURCE), $(plug_opt)/opt
322
323 stack.obj : [.extension]stack.c config.h gawkapi.h \
324 [.extension]gawkfts.h, [.extension]stack.h
325 $(CC)$(CEFLAGS)/define=(HAVE_CONFIG_H)/object=$(MMS$TARGET) $(MMS$SOURCE)
326
327 gawkfts.obj : [.extension]gawkfts.c config.h [.extension]gawkfts.h \
328 $(ext_gawkdirfd_h)
329 $(CC)$(CEFLAGS)/define=(HAVE_CONFIG_H, ZOS_USS, "fchdir(x)=(-1)") \
330 /object=$(MMS$TARGET) $(MMS$SOURCE)
331
332 filefuncs.obj : [.extension]filefuncs.c config.h gawkapi.h \
333 [.extension]gawkfts.h
334 $(CC)$(CEFLAGS)/define=(HAVE_CONFIG_H)/object=$(MMS$TARGET) $(MMS$SOURCE)
335
336 fnmatch.obj : [.extension]fnmatch.c config.h gawkapi.h \
337 [.missing_d]fnmatch.h [.missing_d]fnmatch.c
338 $(CC)$(CEFLAGS)/define=(HAVE_CONFIG_H)/object=$(MMS$TARGET) $(MMS$SOURCE)
339
340 inplace.obj : [.extension]inplace.c config.h gawkapi.h
341 $(CC)$(CEFLAGS)/define=(HAVE_CONFIG_H)/object=$(MMS$TARGET) $(MMS$SOURCE)
342
343 ordchr.obj : [.extension]ordchr.c config.h gawkapi.h
344 $(CC)$(CEFLAGS)/define=(HAVE_CONFIG_H)/object=$(MMS$TARGET) $(MMS$SOURCE)
345
346 readdir.obj : [.extension]readdir.c config.h gawkapi.h \
347 $(ext_gawkdirfd_h)
348 $(CC)$(CEFLAGS)/define=(HAVE_CONFIG_H, HAVE_DIRENT_H) \
349 /object=$(MMS$TARGET) $(MMS$SOURCE)
350
351 revoutput.obj : [.extension]revoutput.c config.h gawkapi.h
352 $(CC)$(CEFLAGS)/define=(HAVE_CONFIG_H)/object=$(MMS$TARGET) $(MMS$SOURCE)
353
354 revtwoway.obj : [.extension]revtwoway.c config.h gawkapi.h
355 $(CC)$(CEFLAGS)/define=(HAVE_CONFIG_H, HAVE_GETDTABLESIZE) \
356 /object=$(MMS$TARGET) $(MMS$SOURCE)
357
358 rwarray.obj : [.extension]rwarray.c config.h gawkapi.h
359 $(CC)$(CEFLAGS)/define=(HAVE_CONFIG_H)/object=$(MMS$TARGET) $(MMS$SOURCE)
360
361 testext.obj : [.extension]testext.c config.h gawkapi.h
362 $(CC)$(CEFLAGS)/define=(HAVE_CONFIG_H)/object=$(MMS$TARGET) $(MMS$SOURCE)
363
364 time.obj : [.extension]time.c config.h gawkapi.h
365 $(CC)$(CEFLAGS)/define=(HAVE_CONFIG_H)/object=$(MMS$TARGET) $(MMS$SOURCE)
366
367
368 # miscellaneous other targets
369 tidy :
370 - if f$search("*.*;-1").nes."" then purge
371 - if f$search("[.*]*.*;-1").nes."" then purge [.*]
372
373 clean :
374 - if f$search ("*.obj") .nes. "" then delete *.obj;*
375 - if f$search ("*.lis") .nes. "" then delete *.lis;*
376 - if f$search ("gawk.opt") .nes. "" then delete gawk.opt;*
377
378 spotless : clean tidy
379 - if f$search("config.h").nes."" then delete config.h;*
380 - if f$search("config_vms.h").nes."" then delete config_vms.h;*
381 - if f$search("gawk.exe").nes."" then delete gawk.exe;*
382 - if f$search("*.dsf").nes."" then delete *.dsf;*
383 - if f$search("*.map").nes."" then delete *.map;*
384 - if f$search("*.pcsi$desc").nes."" then delete *.pcsi$desc;*
385 - if f$search("*.pcsi$text").nes."" then delete *.pcsi$text;*
386 - if f$search("gawk*_src.bck").nes."" then delete gawk*_src.bck;*
387 - if f$search("*.release_notes").nes."" then delete *.release_notes;*
388 - if f$search("filefuncs.exe").nes."" then delete filefuncs.exe;*
389 - if f$search("fnmatch.exe").nes."" then delete fnmatch.exe;*
390 - if f$search("inplace.exe").nes."" then delete inplace.exe;*
391 - if f$search("ordchr.exe").nes."" then delete ordchr.exe;*
392 - if f$search("readdir.exe").nes."" then delete readdir.exe;*
393 - if f$search("revoutput.exe").nes."" then delete revoutput.exe;*
394 - if f$search("revtwoway.exe").nes."" then delete revtwoway.exe;*
395 - if f$search("rwarray.exe").nes."" then delete rwarray.exe;*
396 - if f$search("testext.exe").nes."" then delete testext.exe;*
397 - if f$search("time.exe").nes."" then delete time.exe;*
398 - if f$search("gawk_verb.cld").nes."" then delete gawk_verb.cld;*
399 - if f$search("gawk.dvi").nes."" then delete gawk.dvi;*
400 - if f$search("[.doc]texindex.exe").nes."" then \
401 delete [.doc]texindex.exe;*
402 - if f$search("[.cxx_repository]*.*;").nes."" then \
403 delete [.cxx_repository]*.*;*
404
405 #
406 # Note: this only works if you kept a copy of [.support]texindex.c
407 # from a gawk 2.x distribution and put it into [.doc]texindex.c.
408 # Also, depending on the fonts available with the version of TeX
409 # you have, you might need to edit [.doc]texinfo.tex and change
410 # the reference to "lcircle10" to be "circle10".
411 #
412 # build gawk.dvi from within the 'doc' subdirectory
413 #
414 gawk.dvi : [.doc]texindex.exe [.doc]gawk.texi
415 @ set default [.doc]
416 @ write sys$output " Warnings from TeX are expected during the first pass"
417 TeX gawk.texi
418 mcr []texindex gawk.cp gawk.fn gawk.ky gawk.pg gawk.tp gawk.vr
419 @ write sys$output " Second pass"
420 TeX gawk.texi
421 mcr []texindex gawk.cp gawk.fn gawk.ky gawk.pg gawk.tp gawk.vr
422 @ write sys$output " Third (final) pass"
423 TeX gawk.texi
424 -@ purge
425 -@ delete \
426 gawk.lis;,.aux;,gawk.%%;,.cps;,.fns;,.kys;,.pgs;,.toc;,.tps;,.vrs;
427 @ rename/new_vers gawk.dvi [-]*.*
428 @ set default [-]
429
430 # Note: [.doc]texindex.c is not included with the gawk 3.x distribution.
431 # Expect lots of "implicitly declared function" diagnostics from DEC C.
432 #
433 [.doc]texindex.exe : [.doc]texindex.c
434 @ set default [.doc]
435 $(CC) /noOpt/noList/Define=("lines=tlines") texindex.c
436 @ open/Write opt texindex.opt
437 @ write opt "texindex.obj"
438 @ write opt "$(LIBS)"
439 @ close opt
440 $(LINK) /noMap/Exe=texindex.exe texindex.opt/Options
441 -@ delete texindex.obj;*,texindex.opt;*
442 @ set default [-]
443
444 #eof