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 | # install.help :
|
---|
25 | # You can make the target 'install.help' to load the VMS help text
|
---|
26 | # into a help library. Modify the HELPLIB macro if you don't want
|
---|
27 | # to put entry into the regular VMS library. (If you use an alternate
|
---|
28 | # help library, it must already exist; this target won't create it.)
|
---|
29 | #
|
---|
30 | # gawk.dvi :
|
---|
31 | # If you have TeX, you can make the target 'gawk.dvi' to process
|
---|
32 | # _The_GAWK_Manual_ from gawk.texi. You'll need to use a device
|
---|
33 | # specific post-processor on gawk.dvi in order to get printable data.
|
---|
34 | # The full output is approximately 325 pages.
|
---|
35 | #
|
---|
36 |
|
---|
37 | # location of various source files, relative to the 'main' directory
|
---|
38 | VMSDIR = [.vms]
|
---|
39 | DOCDIR = [.doc]
|
---|
40 | MAKEFILE = $(VMSDIR)Descrip.MMS
|
---|
41 |
|
---|
42 | # debugging &c !'ccflags' is an escape to allow external compile flags
|
---|
43 | #CCFLAGS = /noOpt/Debug
|
---|
44 |
|
---|
45 | # a comma separated list of macros to define
|
---|
46 | CDEFS = "GAWK","HAVE_CONFIG_H"
|
---|
47 |
|
---|
48 | .ifdef GNUC
|
---|
49 | # assumes VAX
|
---|
50 | CC = gcc
|
---|
51 | CFLAGS = /Incl=([],$(VMSDIR))/Obj=[]/Def=($(CDEFS)) $(CCFLAGS)
|
---|
52 | LIBS = gnu_cc:[000000]gcclib.olb/Library,sys$library:vaxcrtl.olb/Library
|
---|
53 | .ifdef DO_GNUC_SETUP
|
---|
54 | # in case GCC command verb needs to be manually defined
|
---|
55 | .first
|
---|
56 | set command gnu_cc:[000000]gcc
|
---|
57 | .endif !DO_GNUC_SETUP
|
---|
58 | .else !!GNUC
|
---|
59 | .ifdef VAXC
|
---|
60 | # always VAX; versions of VAX C older than V3.2 won't work
|
---|
61 | CC = cc
|
---|
62 | CFLAGS = /Incl=[]/Obj=[]/Opt=noInline/Def=($(CDEFS)) $(CCFLAGS)
|
---|
63 | LIBS = sys$share:vaxcrtl.exe/Shareable
|
---|
64 | .else !!VAXC
|
---|
65 | # neither GNUC nor VAXC, assume DECC (same for either VAX or Alpha)
|
---|
66 | CC = cc/DECC/Prefix=All
|
---|
67 | CFLAGS = /Incl=[]/Obj=[]/Def=($(CDEFS)) $(CCFLAGS)
|
---|
68 | LIBS = # DECC$SHR instead of VAXCRTL, no special link option needed
|
---|
69 | .endif !VAXC
|
---|
70 | .endif !GNUC
|
---|
71 |
|
---|
72 |
|
---|
73 | PARSER = bison
|
---|
74 | PARSERINIT = set command gnu_bison:[000000]bison
|
---|
75 | #PARSER = yacc
|
---|
76 | #PARSERINIT = yacc := posix/run/path=posix """/bin/yacc"
|
---|
77 | #PARSERINIT = yacc := $shell$exe:yacc
|
---|
78 |
|
---|
79 | # this is used for optional target 'install.help'
|
---|
80 | HELPLIB = sys$help:helplib.hlb
|
---|
81 | #HELPLIB = sys$help:local.hlb
|
---|
82 |
|
---|
83 | #
|
---|
84 | ######## nothing below this line should need to be changed ########
|
---|
85 | #
|
---|
86 |
|
---|
87 | ECHO = write sys$output
|
---|
88 | NOOP = continue
|
---|
89 |
|
---|
90 | # object files
|
---|
91 | AWKOBJ1 = array.obj,awkgram.obj,builtin.obj,dfa.obj,ext.obj,\
|
---|
92 | field.obj,gawkmisc.obj,getopt.obj,getopt1.obj,io.obj,main.obj,\
|
---|
93 | msg.obj,node.obj,random.obj,re.obj
|
---|
94 | AWKOBJ2 = regex.obj,replace.obj,version.obj,eval.obj,profile.obj
|
---|
95 | AWKOBJS = $(AWKOBJ1),$(AWKOBJ2)
|
---|
96 |
|
---|
97 | # VMSOBJS
|
---|
98 | # VMS specific stuff
|
---|
99 | VMSCODE = vms_misc.obj,vms_popen.obj,vms_fwrite.obj,vms_args.obj,\
|
---|
100 | vms_gawk.obj,vms_cli.obj
|
---|
101 | VMSCMD = gawk_cmd.obj # built from .cld file
|
---|
102 | VMSOBJS = $(VMSCODE),$(VMSCMD)
|
---|
103 |
|
---|
104 | # source and documentation files
|
---|
105 | AWKSRC = array.c,builtin.c,ext.c,eval.c,dfa.c,field.c,gawkmisc.c,\
|
---|
106 | getopt.c,getopt1.c,io.c,main.c,msg.c,node.c,random.c,re.c,\
|
---|
107 | random.c,regcomp.c,regex.c,regex_internal.c,regexec.c,\
|
---|
108 | replace.c,version.c,eval.c,profile.c
|
---|
109 |
|
---|
110 | ALLSRC = $(AWKSRC),awkgram.y,awk.h,custom.h,dfa.h,getopt.h,\
|
---|
111 | gettext.h,mbsupport.h,protos.h,random.h
|
---|
112 |
|
---|
113 | VMSSRC = $(VMSDIR)gawkmisc.vms,$(VMSDIR)vms_misc.c,$(VMSDIR)vms_popen.c,\
|
---|
114 | $(VMSDIR)vms_fwrite.c,$(VMSDIR)vms_args.c,$(VMSDIR)vms_gawk.c,\
|
---|
115 | $(VMSDIR)vms_cli.c
|
---|
116 | VMSHDRS = $(VMSDIR)redirect.h,$(VMSDIR)vms.h,$(VMSDIR)fcntl.h,\
|
---|
117 | $(VMSDIR)varargs.h,$(VMSDIR)unixlib.h
|
---|
118 | VMSOTHR = $(VMSDIR)descrip.mms,$(VMSDIR)vmsbuild.com,$(VMSDIR)version.com,\
|
---|
119 | $(VMSDIR)gawk.hlp
|
---|
120 |
|
---|
121 | DOCS= $(DOCDIR)gawk.1,$(DOCDIR)gawk.texi,$(DOCDIR)texinfo.tex
|
---|
122 |
|
---|
123 | # Release of gawk
|
---|
124 | REL=3.1
|
---|
125 | PATCHLVL=5
|
---|
126 |
|
---|
127 | # generic target
|
---|
128 | all : gawk
|
---|
129 | $(NOOP)
|
---|
130 |
|
---|
131 | # dummy target to allow building "gawk" in addition to explicit "gawk.exe"
|
---|
132 | gawk : gawk.exe
|
---|
133 | $(ECHO) " GAWK "
|
---|
134 |
|
---|
135 | # rules to build gawk
|
---|
136 | gawk.exe : $(AWKOBJS) $(VMSOBJS) gawk.opt
|
---|
137 | $(LINK) $(LINKFLAGS) gawk.opt/options
|
---|
138 |
|
---|
139 | gawk.opt : $(MAKEFILE) # create linker options file
|
---|
140 | open/write opt gawk.opt ! ~ 'cat <<close >gawk.opt'
|
---|
141 | write opt "! GAWK -- GNU awk"
|
---|
142 | @ write opt "$(AWKOBJ1)"
|
---|
143 | @ write opt "$(AWKOBJ2)"
|
---|
144 | @ write opt "$(VMSOBJS)"
|
---|
145 | @ write opt "psect_attr=environ,noshr !extern [noshare] char **"
|
---|
146 | @ write opt "stack=48 !preallocate more pages (default is 20)"
|
---|
147 | @ write opt "iosegment=128 !ditto (default is 32)"
|
---|
148 | write opt "$(LIBS)"
|
---|
149 | write opt "identification=""V$(REL).$(PATCHLVL)"""
|
---|
150 | close opt
|
---|
151 |
|
---|
152 | vms_misc.obj : $(VMSDIR)vms_misc.c
|
---|
153 | vms_popen.obj : $(VMSDIR)vms_popen.c
|
---|
154 | vms_fwrite.obj : $(VMSDIR)vms_fwrite.c
|
---|
155 | vms_args.obj : $(VMSDIR)vms_args.c
|
---|
156 | vms_gawk.obj : $(VMSDIR)vms_gawk.c
|
---|
157 | vms_cli.obj : $(VMSDIR)vms_cli.c
|
---|
158 | $(VMSCODE) : awk.h config.h $(VMSDIR)redirect.h $(VMSDIR)vms.h
|
---|
159 |
|
---|
160 | gawkmisc.obj : gawkmisc.c $(VMSDIR)gawkmisc.vms
|
---|
161 |
|
---|
162 | $(AWKOBJS) : awk.h gettext.h mbsupport.h regex.h dfa.h \
|
---|
163 | config.h $(VMSDIR)redirect.h
|
---|
164 | random.obj : random.h
|
---|
165 | builtin.obj : random.h
|
---|
166 | awkgram.obj : awkgram.c awk.h
|
---|
167 | dfa.obj : dfa.c dfa.h
|
---|
168 | regex.obj : regex.c regcomp.c regex_internal.c regexec.c regex.h regex_internal.h
|
---|
169 |
|
---|
170 | # bison or yacc required
|
---|
171 | awkgram.c : awkgram.y # foo.y :: yacc => y[_]tab.c, bison => foo_tab.c
|
---|
172 | @- if f$search("ytab.c") .nes."" then delete ytab.c;* !POSIX yacc
|
---|
173 | @- if f$search("y_tab.c") .nes."" then delete y_tab.c;* !DEC/Shell yacc
|
---|
174 | @- if f$search("awk_tab.c").nes."" then delete awk_tab.c;* !bison
|
---|
175 | - $(PARSERINIT)
|
---|
176 | $(PARSER) $(YFLAGS) $<
|
---|
177 | @- if f$search("ytab.c") .nes."" then rename/new_vers ytab.c $@
|
---|
178 | @- if f$search("y_tab.c") .nes."" then rename/new_vers y_tab.c $@
|
---|
179 | @- if f$search("awk_tab.c").nes."" then rename/new_vers awk_tab.c $@
|
---|
180 |
|
---|
181 | config.h : $(VMSDIR)vms-conf.h
|
---|
182 | copy $< $@
|
---|
183 |
|
---|
184 | $(VMSCMD) : $(VMSDIR)gawk.cld
|
---|
185 | set command $(CLDFLAGS)/object=$@ $<
|
---|
186 |
|
---|
187 | # special target for loading the help text into a VMS help library
|
---|
188 | install.help : $(VMS)gawk.hlp
|
---|
189 | library/help $(HELPLIB) $< /log
|
---|
190 |
|
---|
191 | # miscellaneous other targets
|
---|
192 | tidy :
|
---|
193 | - if f$search("*.*;-1").nes."" then purge
|
---|
194 | - if f$search("[.*]*.*;-1").nes."" then purge [.*]
|
---|
195 |
|
---|
196 | clean :
|
---|
197 | - delete *.obj;*,gawk.opt;*
|
---|
198 |
|
---|
199 | spotless : clean tidy
|
---|
200 | - if f$search("gawk.exe").nes."" then delete gawk.exe;*
|
---|
201 | - if f$search("gawk.dvi").nes."" then delete gawk.dvi;*
|
---|
202 | - if f$search("[.doc]texindex.exe").nes."" then delete [.doc]texindex.exe;*
|
---|
203 |
|
---|
204 | #
|
---|
205 | # Note: this only works if you kept a copy of [.support]texindex.c
|
---|
206 | # from a gawk 2.x distribution and put it into [.doc]texindex.c.
|
---|
207 | # Also, depending on the fonts available with the version of TeX
|
---|
208 | # you have, you might need to edit [.doc]texinfo.tex and change
|
---|
209 | # the reference to "lcircle10" to be "circle10".
|
---|
210 | #
|
---|
211 | # build gawk.dvi from within the 'doc' subdirectory
|
---|
212 | #
|
---|
213 | gawk.dvi : [.doc]texindex.exe [.doc]gawk.texi
|
---|
214 | @ set default [.doc]
|
---|
215 | @ write sys$output " Warnings from TeX are expected during the first pass"
|
---|
216 | TeX gawk.texi
|
---|
217 | mcr []texindex gawk.cp gawk.fn gawk.ky gawk.pg gawk.tp gawk.vr
|
---|
218 | @ write sys$output " Second pass"
|
---|
219 | TeX gawk.texi
|
---|
220 | mcr []texindex gawk.cp gawk.fn gawk.ky gawk.pg gawk.tp gawk.vr
|
---|
221 | @ write sys$output " Third (final) pass"
|
---|
222 | TeX gawk.texi
|
---|
223 | -@ purge
|
---|
224 | -@ delete gawk.lis;,.aux;,gawk.%%;,.cps;,.fns;,.kys;,.pgs;,.toc;,.tps;,.vrs;
|
---|
225 | @ rename/new_vers gawk.dvi [-]*.*
|
---|
226 | @ set default [-]
|
---|
227 |
|
---|
228 | # Note: [.doc]texindex.c is not included with the gawk 3.x distribution.
|
---|
229 | # Expect lots of "implicitly declared function" diagnostics from DEC C.
|
---|
230 | #
|
---|
231 | [.doc]texindex.exe : [.doc]texindex.c
|
---|
232 | @ set default [.doc]
|
---|
233 | $(CC) /noOpt/noList/Define=("lines=tlines") texindex.c
|
---|
234 | @ open/Write opt texindex.opt
|
---|
235 | @ write opt "texindex.obj"
|
---|
236 | @ write opt "$(LIBS)"
|
---|
237 | @ close opt
|
---|
238 | $(LINK) /noMap/Exe=texindex.exe texindex.opt/Options
|
---|
239 | -@ delete texindex.obj;*,texindex.opt;*
|
---|
240 | @ set default [-]
|
---|
241 |
|
---|
242 | #eof
|
---|