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
|
# @(#) $Header: /cvsroot/flex/flex/Attic/Makefile.in,v 1.40 1995/03/05 21:37:51 vern Exp $ (LBL)
# If your version of "make" does not define $(MAKE), comment in the
# definition of "MAKE" below. (You only need to do this if you intend
# to do "make bigcheck" or "make dist".)
# MAKE = make
# Possible values for DEFS:
#
# For flex to always generate 8-bit scanners, add "-DDEFAULT_CSIZE=256"
# to DEFS.
#
# For Vax/VMS, add "-DVMS" to DEFS.
#
# For MS-DOS, add "-DMS_DOS" to DEFS. See the directory MISC/MSDOS for
# additional info.
CFLAGS = @CFLAGS@
DEFS = @DEFS@
LDFLAGS =
LIBS = @LIBS@
# Installation targeting. Files will be installed under the tree
# rooted at prefix. flex will be installed in bindir, libfl.a in
# libdir, FlexLexer.h will be installed in includedir, and the manual
# pages will be installed in mandir with extension manext.
#
# Raw, unformatted troff source will be installed if INSTALLMAN=man,
# nroff preformatted versions will be installed if INSTALLMAN=cat.
prefix = /usr/local
exec_prefix = $(prefix)
bindir = $(exec_prefix)/bin
libdir = $(exec_prefix)/lib
includedir = $(prefix)/include
manext = 1
mandir = $(prefix)/man/man$(manext)
# You can define this to be "lex" if you want to replace lex at your site.
FLEX = flex
INSTALLMAN = man
SHELL = /bin/sh
srcdir = @srcdir@
VPATH = @srcdir@
LN_S = @LN_S@
YACC = @YACC@
CC = @CC@
AR = ar
RANLIB = @RANLIB@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
# You normally do not need to modify anything below this point.
# ------------------------------------------------------------
CPPFLAGS = -I. -I$(srcdir)
.c.o:
$(CC) -c $(CPPFLAGS) $(CFLAGS) $<
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.o dfa.o ecs.o gen.o main.o misc.o nfa.o parse.o \
scan.o skel.o sym.o tblcmp.o yylex.o @ALLOCA@
LIBSRCS = libmain.c libyywrap.c
LIBOBJS = libmain.o libyywrap.o
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 skel.c flex.skl \
$(HEADERS) $(SOURCES) $(LIBSRCS) MISC \
flex.1 scan.c install.sh mkinstalldirs configure
DIST_NAME = flex
# which "flex" to use to generate scan.c from scan.l
FLEX_EXEC = ./$(FLEX)
FLEX_FLAGS = -t $(PERF_REPORT)
COMPRESSION =
PERF_REPORT = -p
FLEXLIB = libfl.a
all: $(FLEX)
$(FLEX): .bootstrap $(OBJECTS) $(FLEXLIB)
$(CC) $(CFLAGS) -o $(FLEX) $(LDFLAGS) $(OBJECTS) $(FLEXLIB) $(LIBS)
.bootstrap: initscan.c
@rm -f scan.c
cp $(srcdir)/initscan.c scan.c
touch .bootstrap
parse.c: parse.y
$(YACC) -d $(srcdir)/parse.y
@sed '/extern char.*malloc/d' <y.tab.c >parse.tmp
@mv parse.tmp parse.c
@mv y.tab.h parse.h
@rm -f y.tab.c
parse.h: parse.c
scan.c: scan.l
$(FLEX_EXEC) $(FLEX_FLAGS) $(COMPRESSION) $(srcdir)/scan.l >scan.c
@sed s,\"$(srcdir)/scan.l\",\"scan.l\", <scan.c >scan.tmp
@mv scan.tmp scan.c
scan.o: scan.c parse.h flexdef.h config.h
yylex.o: yylex.c parse.h flexdef.h config.h
skel.c: flex.skl mkskel.sh
$(SHELL) $(srcdir)/mkskel.sh $(srcdir)/flex.skl >skel.c
main.o: main.c flexdef.h config.h version.h
ccl.o: ccl.c flexdef.h config.h
dfa.o: dfa.c flexdef.h config.h
ecs.o: ecs.c flexdef.h config.h
gen.o: gen.c flexdef.h config.h
misc.o: misc.c flexdef.h config.h
nfa.o: nfa.c flexdef.h config.h
parse.o: parse.c flexdef.h config.h
skel.o: skel.c flexdef.h config.h
sym.o: sym.c flexdef.h config.h
tblcmp.o: tblcmp.c flexdef.h config.h
alloca.o: alloca.c
$(CC) $(CPPFLAGS) $(CFLAGS) -c -Dxmalloc=yy_flex_xmalloc alloca.c
alloca.c: $(srcdir)/MISC/alloca.c
@rm -f alloca.c
cp $(srcdir)/MISC/alloca.c .
test: check
check: $(FLEX)
$(FLEX_EXEC) $(FLEX_FLAGS) $(COMPRESSION) $(srcdir)/scan.l \
| sed s,\"$(srcdir)/scan.l\",\"scan.l\", \
| diff scan.c -
@echo "Check successful, using COMPRESSION=\"$(COMPRESSION)\""
bigcheck:
rm -f scan.c ; $(MAKE) COMPRESSION="-C" check
rm -f scan.c ; $(MAKE) COMPRESSION="-Ce" check
rm -f scan.c ; $(MAKE) COMPRESSION="-Cm" check
rm -f scan.c ; $(MAKE) COMPRESSION="-Cfea" check
rm -f scan.c ; $(MAKE) COMPRESSION="-CFer" check
rm -f scan.c ; $(MAKE) COMPRESSION="-l" PERF_REPORT="" check
rm -f scan.c ; $(MAKE)
@echo "All checks successful"
$(FLEXLIB): $(LIBOBJS)
$(AR) cru $(FLEXLIB) $(LIBOBJS)
-$(RANLIB) $(FLEXLIB)
$(FLEX).man: flex.1
cd $(srcdir); nroff -man flex.1 >$(FLEX).man
install: $(FLEX) $(FLEXLIB) installdirs install.$(INSTALLMAN)
$(INSTALL_PROGRAM) $(FLEX) $(bindir)/$(FLEX)
@rm -f $(bindir)/$(FLEX)++
cd $(bindir); $(LN_S) $(FLEX) $(FLEX)++
$(INSTALL_DATA) $(FLEXLIB) $(libdir)/libfl.a
-cd $(libdir); $(RANLIB) libfl.a
$(INSTALL_DATA) $(srcdir)/FlexLexer.h $(includedir)/FlexLexer.h
# Note, the following rules delete any vestigial flexdoc installed
# for a prior flex release.
install.man: flex.1
rm -f $(mandir)/$(FLEX)doc.$(manext)
$(INSTALL_DATA) $(srcdir)/flex.1 $(mandir)/$(FLEX).$(manext)
install.cat: $(FLEX).man
rm -f $(mandir)/$(FLEX)doc.$(manext)
$(INSTALL_DATA) $(srcdir)/$(FLEX).man $(mandir)/$(FLEX).$(manext)
installdirs:
$(SHELL) $(srcdir)/mkinstalldirs \
$(bindir) $(libdir) $(includedir) $(mandir)
uninstall:
rm -f $(bindir)/$(FLEX) $(bindir)/$(FLEX)++
rm -f $(libdir)/libfl.a
rm -f $(includedir)/FlexLexer.h
rm -f $(mandir)/$(FLEX).$(manext) $(mandir)/$(FLEX)doc.$(manext)
tags: $(SOURCES)
ctags $(SOURCES)
TAGS: $(SOURCES)
etags $(SOURCES)
lint: $(LINTSRCS)
lint -Dconst= $(LINTSRCS) > flex.lint
gcc-lint: $(LINTSRCS)
gcc -Dlint -Wall $(LINTSRCS) >flex.gcc-lint 2>&1
mostlyclean:
rm -f a.out *.bak core errs scan.tmp
clean: mostlyclean
rm -f parse.c parse.h *.o alloca.c *.lint lex.yy.c lex.yy.cc $(FLEXLIB)
distclean: clean
rm -f .bootstrap $(FLEX) scan.c tags TAGS Makefile config.status \
config.h
maintainer-clean: distclean
@echo "This command is intended for maintainers to use;"
@echo "it deletes files that may require special tools to rebuild."
rm -f $(FLEX).man skel.c flex*.tar.gz flex*.tar.Z
dist: $(FLEX) $(DISTFILES) parse.c parse.h $(srcdir)/$(FLEX).man
$(MAKE) DIST_NAME=flex-`sed <version.h 's/[^"]*"//' | sed 's/"//'` dist2
dist2:
@rm -rf $(DIST_NAME)
@rm -f $(DIST_NAME).tar $(DIST_NAME).tar.Z $(DIST_NAME).tar.gz
@mkdir $(DIST_NAME)
tar cf - $(DISTFILES) | (cd $(DIST_NAME); tar xfB -)
@mv $(DIST_NAME)/scan.c $(DIST_NAME)/initscan.c
@chmod 444 $(DIST_NAME)/initscan.c
@chmod +w $(DIST_NAME)/Makefile.in
@cp parse.c parse.h $(DIST_NAME)/MISC
@col -b <$(srcdir)/$(FLEX).man >$(DIST_NAME)/MISC/flex.man
tar chf $(DIST_NAME).tar $(DIST_NAME)
compress <$(DIST_NAME).tar >$(DIST_NAME).tar.Z
gzip <$(DIST_NAME).tar >$(DIST_NAME).tar.gz
@rm $(DIST_NAME).tar
Makefile: $(srcdir)/Makefile.in config.status
$(SHELL) config.status
config.status: configure
$(SHELL) config.status --recheck
configure: configure.in
cd $(srcdir); autoconf
config.h: conf.in config.status
# Prevent GNU make v3 from overflowing arg limit on SysV.
.NOEXPORT:
|