source: trunk/essentials/sys-apps/gawk/vms/descrip.mms

Last change on this file was 3076, checked in by bird, 18 years ago

gawk 3.1.5

File size: 8.2 KB
Line 
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
38VMSDIR = [.vms]
39DOCDIR = [.doc]
40MAKEFILE = $(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
46CDEFS = "GAWK","HAVE_CONFIG_H"
47
48.ifdef GNUC
49# assumes VAX
50CC = gcc
51CFLAGS = /Incl=([],$(VMSDIR))/Obj=[]/Def=($(CDEFS)) $(CCFLAGS)
52LIBS = 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
61CC = cc
62CFLAGS = /Incl=[]/Obj=[]/Opt=noInline/Def=($(CDEFS)) $(CCFLAGS)
63LIBS = sys$share:vaxcrtl.exe/Shareable
64.else !!VAXC
65# neither GNUC nor VAXC, assume DECC (same for either VAX or Alpha)
66CC = cc/DECC/Prefix=All
67CFLAGS = /Incl=[]/Obj=[]/Def=($(CDEFS)) $(CCFLAGS)
68LIBS = # DECC$SHR instead of VAXCRTL, no special link option needed
69.endif !VAXC
70.endif !GNUC
71
72
73PARSER = bison
74PARSERINIT = 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'
80HELPLIB = sys$help:helplib.hlb
81#HELPLIB = sys$help:local.hlb
82
83#
84######## nothing below this line should need to be changed ########
85#
86
87ECHO = write sys$output
88NOOP = continue
89
90# object files
91AWKOBJ1 = 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
94AWKOBJ2 = regex.obj,replace.obj,version.obj,eval.obj,profile.obj
95AWKOBJS = $(AWKOBJ1),$(AWKOBJ2)
96
97# VMSOBJS
98# VMS specific stuff
99VMSCODE = vms_misc.obj,vms_popen.obj,vms_fwrite.obj,vms_args.obj,\
100 vms_gawk.obj,vms_cli.obj
101VMSCMD = gawk_cmd.obj # built from .cld file
102VMSOBJS = $(VMSCODE),$(VMSCMD)
103
104# source and documentation files
105AWKSRC = 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
110ALLSRC = $(AWKSRC),awkgram.y,awk.h,custom.h,dfa.h,getopt.h,\
111 gettext.h,mbsupport.h,protos.h,random.h
112
113VMSSRC = $(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
116VMSHDRS = $(VMSDIR)redirect.h,$(VMSDIR)vms.h,$(VMSDIR)fcntl.h,\
117 $(VMSDIR)varargs.h,$(VMSDIR)unixlib.h
118VMSOTHR = $(VMSDIR)descrip.mms,$(VMSDIR)vmsbuild.com,$(VMSDIR)version.com,\
119 $(VMSDIR)gawk.hlp
120
121DOCS= $(DOCDIR)gawk.1,$(DOCDIR)gawk.texi,$(DOCDIR)texinfo.tex
122
123# Release of gawk
124REL=3.1
125PATCHLVL=5
126
127# generic target
128all : gawk
129 $(NOOP)
130
131# dummy target to allow building "gawk" in addition to explicit "gawk.exe"
132gawk : gawk.exe
133 $(ECHO) " GAWK "
134
135# rules to build gawk
136gawk.exe : $(AWKOBJS) $(VMSOBJS) gawk.opt
137 $(LINK) $(LINKFLAGS) gawk.opt/options
138
139gawk.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
152vms_misc.obj : $(VMSDIR)vms_misc.c
153vms_popen.obj : $(VMSDIR)vms_popen.c
154vms_fwrite.obj : $(VMSDIR)vms_fwrite.c
155vms_args.obj : $(VMSDIR)vms_args.c
156vms_gawk.obj : $(VMSDIR)vms_gawk.c
157vms_cli.obj : $(VMSDIR)vms_cli.c
158$(VMSCODE) : awk.h config.h $(VMSDIR)redirect.h $(VMSDIR)vms.h
159
160gawkmisc.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
164random.obj : random.h
165builtin.obj : random.h
166awkgram.obj : awkgram.c awk.h
167dfa.obj : dfa.c dfa.h
168regex.obj : regex.c regcomp.c regex_internal.c regexec.c regex.h regex_internal.h
169
170# bison or yacc required
171awkgram.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
181config.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
188install.help : $(VMS)gawk.hlp
189 library/help $(HELPLIB) $< /log
190
191# miscellaneous other targets
192tidy :
193 - if f$search("*.*;-1").nes."" then purge
194 - if f$search("[.*]*.*;-1").nes."" then purge [.*]
195
196clean :
197 - delete *.obj;*,gawk.opt;*
198
199spotless : 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#
213gawk.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
Note: See TracBrowser for help on using the repository browser.