summaryrefslogtreecommitdiff
path: root/MISC/VMS/descrip.mms
blob: 5b2859d34660b89942d3a58bb6c2859b4c4d60b8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
# descrip.mms -- makefile for building `flex' using MMS or MMK on VMS;
#	created manually from Makefile.in
#						flex 2.5.0	Jan'95

MAKEFILE  = descrip.mms		    # from [.MISC.VMS]
MAKE	  = $(MMS) /Descr=$(MAKEFILE)
MAKEFLAGS = $(MMSQUALIFIERS)

# Possible values for DEFS:
# "VMS" -- used just to make sure parentheses aren't empty;
# For flex to always generate 8-bit scanners, append
# ,"DEFAULT_CSIZE=256" inside /Define=() of DEFS.

DEFS	  = /Define=("VMS")
LDFLAGS	  = /noMap

# compiler handling
.ifdef GNUC
CC	  = gcc
GCCINIT	  = 	! SET COMMAND GNU_CC:[000000]GCC
CFLAGS	  = /noList/Opt=2/Debug/noVerbose
LIBS	  = gnu_cc:[000000]gcclib.olb/Library, sys$library:vaxcrtl.olb/Library
C_CHOICE  = "GNUC=1"
.else		! not GNU C
CC	  = cc
GCCINIT	  =
.ifdef DECC
CFLAGS	  = /noList/Prefix=All
LIBS	  =
C_CHOICE  = "DECC=1"
.else		! not DEC C; assume VAX C
CFLAGS	  = /noList/Optimize=noInline
LIBS	  = sys$share:vaxcrtl.exe/Shareable
C_CHOICE  = "VAXC=1"
.endif
.endif

# parser handling
#	mms/macro=("xxxC=1","zzz_parser=1"), where "zzz_parser" is
#	either "bison_parser" or "byacc_parser" or "yacc_parser",
#	otherwise assumed to be "no_parser"; and where "xxxC=1" is
#	either "VAXC=1", "GNUC=1", or "DECC=1" as above
.ifdef bison_parser
YACC	  = bison
YACCFLAGS = /Defines/Fixed_Outfiles
YACCINIT  = set command gnu_bison:[000000]bison
ALLOCA	  = ,[]alloca.obj		# note leading comma
.else
YACCFLAGS = -d
YACCINIT  =
ALLOCA	  =
.ifdef byacc_parser
YACC	  = byacc
.else
.ifdef yacc_parser
YACC	  = yacc
.else
#	none of bison, byacc, or yacc specified
.ifdef no_parser
.else
no_parser=1
.endif	#<none>
.endif	#yacc
.endif	#byacc
.endif	#bison

# VMS-specific hackery
ECHO	  = write sys$output		# requires single quoted arg
COPY	  = copy_			#
MOVE	  = rename_/New_Vers		# within same device only
MUNG	  = search_/Exact/Match=NOR	# to strip unwanted `#module' directive
NOOP	  = continue			# non-empty command that does nothing
PURGE	  = purge_/noConfirm/noLog	# relatively quiet file removal
REMOVE	  = delete_/noConfirm/noLog	# ditto
TOUCH	  = append_/New _NL:		# requires single file arg
TPU	  = edit_/TPU/noJournal/noDisplay/noSection

# You can define this to be "lex.exe" if you want to replace lex at your site.
FLEX	=flex.exe
#	note: there should be no whitespace between `=' and the name,
#	or else $(FLEX_EXEC) below will not function properly.
FLEXLIB	  = flexlib.olb

# You normally do not need to modify anything below this point.
# ------------------------------------------------------------

VMSDIR	  = [.MISC.VMS]
MISCDIR	  = [.MISC]
CURDIR	  = sys$disk:[]

CPPFLAGS  = $(DEFS)/Include=[]
LIBOPT	  = $(CURDIR)crtl.opt		# run-time library(s)
ID_OPT	  = $(CURDIR)ident.opt		# version identification

.SUFFIXES :	# avoid overhead of umpteen built-in rules
.SUFFIXES : .obj .c

.c.obj :
	$(CC)$(CFLAGS)$(CPPFLAGS) $<

VMSHDRS = $(VMSDIR)vms-conf.h	    # copied to []config.h
VMSSRCS = $(VMSDIR)vms-code.c	    # copied to []vms-code.c
VMSOBJS = ,vms-code.obj		    # note leading comma

HEADERS = flexdef.h version.h

SOURCES = ccl.c dfa.c ecs.c gen.c main.c misc.c nfa.c parse.y \
	scan.l skel.c sym.c tblcmp.c yylex.c
OBJECTS = ccl.obj,dfa.obj,ecs.obj,gen.obj,main.obj,misc.obj,nfa.obj,parse.obj,\
	scan.obj,skel.obj,sym.obj,tblcmp.obj,yylex.obj $(VMSOBJS) $(ALLOCA)

LIBSRCS = libmain.c libyywrap.c
LIBOBJS = libmain.obj,libyywrap.obj

LINTSRCS = ccl.c dfa.c ecs.c gen.c main.c misc.c nfa.c parse.c \
	scan.c skel.c sym.c tblcmp.c yylex.c

DISTFILES = README NEWS COPYING INSTALL FlexLexer.h \
	configure.in conf.in Makefile.in mkskel.sh flex.skl \
	$(HEADERS) $(SOURCES) $(LIBSRCS) MISC \
	flex.1 scan.c install.sh mkinstalldirs configure

DIST_NAME = flex

# flex options to use when generating scan.c from scan.l
COMPRESSION =
PERF_REPORT = -p
# which "flex" to use to generate scan.c from scan.l
FLEX_EXEC   = mcr $(CURDIR)$(FLEX)
FLEX_FLAGS  = -t $(PERF_REPORT) #$(COMPRESSION)

MARKER	= make.bootstrap

##### targets start here #####

all : $(FLEX) flex.doc
	@ $(NOOP)

install : $(FLEX) flex.doc flex.skl $(FLEXLIB) FlexLexer.h
	@ $(ECHO) "-- Installation must be done manually."
	@ $(ECHO) "   $+"

.ifdef GCCINIT
.FIRST
	$(GCCINIT)

.endif	#GCCINIT

flex : $(FLEX)
	@ $(NOOP)

$(FLEX) : $(MARKER) $(OBJECTS) $(FLEXLIB) $(LIBOPT) $(ID_OPT)
	$(LINK)/Exe=$(FLEX) $(LDFLAGS)\
 $(OBJECTS),$(FLEXLIB)/Lib,$(LIBOPT)/Opt,$(ID_OPT)/Opt

$(MARKER) : initscan.c
	@- if f$search("scan.c").nes."" then $(REMOVE) scan.c;*
	$(COPY) initscan.c scan.c
	@ $(TOUCH) $(MARKER)

parse.c : parse.y
	@- if f$search("y_tab.%").nes."" then $(REMOVE) y_tab.%;*
.ifdef no_parser
	$(COPY) $(MISCDIR)parse.% $(CURDIR)y_tab.*
.else
	$(YACCINIT)
	$(YACC) $(YACCFLAGS) parse.y
.endif
	$(MUNG) y_tab.c "#module","#line" /Output=parse.c
	@- $(REMOVE) y_tab.c;*
	$(MOVE) y_tab.h parse.h

parse.h : parse.c
	@ $(TOUCH) parse.h

scan.c : scan.l
	$(FLEX_EXEC) $(FLEX_FLAGS) $(COMPRESSION) scan.l > scan.c

scan.obj : scan.c parse.h flexdef.h config.h
yylex.obj : yylex.c parse.h flexdef.h config.h

skel.c : flex.skl $(VMSDIR)mkskel.tpu
	$(TPU) /Command=$(VMSDIR)mkskel.tpu flex.skl /Output=skel.c

main.obj : main.c flexdef.h config.h version.h
ccl.obj : ccl.c flexdef.h config.h
dfa.obj : dfa.c flexdef.h config.h
ecs.obj : ecs.c flexdef.h config.h
gen.obj : gen.c flexdef.h config.h
misc.obj : misc.c flexdef.h config.h
nfa.obj : nfa.c flexdef.h config.h
parse.obj : parse.c flexdef.h config.h
skel.obj : skel.c flexdef.h config.h
sym.obj : sym.c flexdef.h config.h
tblcmp.obj : tblcmp.c flexdef.h config.h
vms-code.obj : vms-code.c flexdef.h config.h

[]alloca.obj : alloca.c
	$(CC)$(CFLAGS)/Define=("STACK_DIRECTION=-1","xmalloc=yy_flex_xmalloc") alloca.c

alloca.c : $(MISCDIR)alloca.c
	$(COPY) $(MISCDIR)alloca.c alloca.c

config.h : $(VMSDIR)vms-conf.h
	$(COPY) $(VMSDIR)vms-conf.h config.h

vms-code.c : $(VMSDIR)vms-code.c
	$(COPY) $(VMSDIR)vms-code.c vms-code.c

test : check
	@ $(NOOP)
check : $(FLEX)
	@ $(ECHO) ""
	@ $(ECHO) "  Checking with COMPRESSION="$(COMPRESSION)""
	$(FLEX_EXEC) $(FLEX_FLAGS) $(COMPRESSION) scan.l > scan.chk
	diff_/Output=_NL:/Maximum_Diff=1 scan.c scan.chk

bigcheck :
	@- if f$search("scan.c").nes."" then $(REMOVE) scan.c;*
	$(MAKE)$(MAKEFLAGS) /Macro=($(C_CHOICE),"COMPRESSION=""-C""") check
	@- $(REMOVE) scan.c;*
	$(MAKE)$(MAKEFLAGS) /Macro=($(C_CHOICE),"COMPRESSION=""-Ce""") check
	@- $(REMOVE) scan.c;*
	$(MAKE)$(MAKEFLAGS) /Macro=($(C_CHOICE),"COMPRESSION=""-Cm""") check
	@- $(REMOVE) scan.c;*
	$(MAKE)$(MAKEFLAGS) /Macro=($(C_CHOICE),"COMPRESSION=""-f""") check
	@- $(REMOVE) scan.c;*
	$(MAKE)$(MAKEFLAGS) /Macro=($(C_CHOICE),"COMPRESSION=""-Cfea""") check
	@- $(REMOVE) scan.c;*
	$(MAKE)$(MAKEFLAGS) /Macro=($(C_CHOICE),"COMPRESSION=""-CFer""") check
	@- $(REMOVE) scan.c;*
	$(MAKE)$(MAKEFLAGS) /Macro=($(C_CHOICE),"COMPRESSION=""-l""","PERF_REPORT=") check
	@- $(REMOVE) scan.c;*,scan.chk;*
	$(MAKE)$(MAKEFLAGS) $(FLEX)
	@- $(PURGE) scan.obj
	@ $(ECHO) "All checks successful"

$(FLEXLIB) : $(LIBOBJS)
	library/Obj $(FLEXLIB)/Create $(LIBOBJS)/Insert
	@ if f$search("$(FLEXLIB);-1").nes."" then $(PURGE) $(FLEXLIB)

# We call it .doc instead of .man, to lessen culture shock.  :-}
#	If MISC/flex.man is out of date relative to flex.1, there's
#	not much we can do about it with the tools readily available.
flex.doc : flex.1
	@ if f$search("$(MISCDIR)flex.man").eqs."" then \
		$(COPY) flex.1 $(MISCDIR)flex.man
	$(COPY) $(MISCDIR)flex.man flex.doc

#
#	This is completely VMS-specific...
#

# Linker options file specifying run-time library(s) to link against;
# choice depends on which C compiler is used, and might be empty.
$(LIBOPT) : $(MAKEFILE)
	@ open/Write optfile $(LIBOPT)
	@ write optfile "$(LIBS)"
	@ close optfile

# Linker options file putting the version number where the ANALYZE/IMAGE
# command will be able to find and report it; assumes that the first line
# of version.h has the version number enclosed within the first and second
# double quotes on it [as in ``#define FLEX_VERSION "2.5.0"''].
$(ID_OPT) : version.h
	@ version = "# flex ""2.5"""	!default, overridden by version.h
	@- open/Read hfile version.h
	@- read hfile version
	@- close/noLog hfile
	@ version = f$element(1,"""",version)
	@ open/Write optfile $(ID_OPT)
	@ write optfile "identification=""flex ''version'"""
	@ close optfile


#
#	This is the only stuff moderately useful from the remainder
#	of Makefile.in...
#

mostlyclean :
	@- if f$search("scan.chk").nes."" then $(REMOVE) scan.chk;*
	@- if f$search("*.obj;-1").nes."" then $(PURGE) *.obj
	@- if f$search("*.exe;-1").nes."" then $(PURGE) *.exe
	@- if f$search("*.opt;-1").nes."" then $(PURGE) *.opt

clean : mostlyclean
	@- if f$search("*.obj").nes."" then $(REMOVE) *.obj;*
	@- if f$search("parse.h").nes."" then $(REMOVE) parse.h;*
	@- if f$search("parse.c").nes."" then $(REMOVE) parse.c;*
	@- if f$search("alloca.c").nes."" .and.-
	 f$search("$(MISCDIR)alloca.c").nes."" then $(REMOVE) alloca.c;*
	@- if f$search("$(LIBOPT)").nes."" then $(REMOVE) $(LIBOPT);*
	@- if f$search("$(ID_OPT)").nes."" then $(REMOVE) $(ID_OPT);*

distclean : clean
	@- if f$search("$(MARKER)").nes."" then $(REMOVE) $(MARKER);*
	@- if f$search("$(FLEX)").nes."" then $(REMOVE) $(FLEX);*
	@- if f$search("$(FLEXLIB)").nes."" then $(REMOVE) $(FLEXLIB);*
	@- if f$search("flex.doc").nes."" then $(REMOVE) flex.doc;*
	@- if f$search("scan.c").nes."" then $(REMOVE) scan.c;*
	@- if f$search("vms-code.c").nes."" .and.-
	 f$search("$(VMSDIR)vms-code.c").nes."" then $(REMOVE) vms-code.c;*
	@- if f$search("config.h").nes."" .and.-
	 f$search("$(VMSDIR)vms-conf.h").nes."" then $(REMOVE) config.h;*
#	@- if f$search("descrip.mms").nes."" .and.-
#	 f$search("$(VMSDIR)descrip.mms").nes."" then $(REMOVE) descrip.mms;*

realclean : distclean
	@- if f$search("skel.c").nes."" then $(REMOVE) skel.c;*