1 # @(#) $Header: /home/daffy/u0/vern/flex/RCS/Makefile.in,v 1.45 96/09/10 16:59:04 vern Exp $ (LBL)
5 # Possible values for DEFS:
7 # By default, flex generates 8-bit scanners when using table compression,
8 # and 7-bit scanners when using uncompressed tables (-f or -F options).
9 # For flex to always generate 8-bit scanners, add "-DDEFAULT_CSIZE=256"
12 # For Vax/VMS, add "-DVMS" to DEFS.
14 # For MS-DOS, add "-DMS_DOS" to DEFS. See the directory MISC/MSDOS for
23 # Installation targeting. Files will be installed under the tree
24 # rooted at prefix. flex will be installed in bindir, libfl.a in
25 # libdir, FlexLexer.h will be installed in includedir, and the manual
26 # pages will be installed in mandir with extension manext.
28 # Raw, unformatted troff source will be installed if INSTALLMAN=man,
29 # nroff preformatted versions will be installed if INSTALLMAN=cat.
32 exec_prefix = @exec_prefix@
33 bindir = $(exec_prefix)/bin
34 libdir = $(exec_prefix)/lib
35 includedir = $(prefix)/include
37 mandir = $(prefix)/man/man$(manext)
39 # You can define these to be "lex" and "libl.a" if you want to replace
56 INSTALL_DATA = @INSTALL_DATA@
57 INSTALL_PROGRAM = @INSTALL_PROGRAM@
59 # You normally do not need to modify anything below this point.
60 # ------------------------------------------------------------
62 CPPFLAGS = -I. -I$(srcdir)
65 $(CC) -c $(CPPFLAGS) $(CFLAGS) $<
67 HEADERS = flexdef.h version.h
69 SOURCES = ccl.c dfa.c ecs.c gen.c main.c misc.c nfa.c parse.y \
70 scan.l skel.c sym.c tblcmp.c yylex.c
71 OBJECTS = ccl.o dfa.o ecs.o gen.o main.o misc.o nfa.o parse.o \
72 scan.o skel.o sym.o tblcmp.o yylex.o @ALLOCA@
74 LIBSRCS = libmain.c libyywrap.c
75 LIBOBJS = libmain.o libyywrap.o
77 LINTSRCS = ccl.c dfa.c ecs.c gen.c main.c misc.c nfa.c parse.c \
78 scan.c skel.c sym.c tblcmp.c yylex.c
80 DISTFILES = README NEWS COPYING INSTALL FlexLexer.h \
81 configure.in conf.in Makefile.in mkskel.sh flex.skl \
82 $(HEADERS) $(SOURCES) $(LIBSRCS) MISC \
83 flex.1 scan.c install.sh mkinstalldirs configure
87 # which "flex" to use to generate scan.c from scan.l
89 FLEX_FLAGS = -t $(PERF_REPORT)
96 $(FLEX): .bootstrap $(OBJECTS) $(FLEXLIB)
97 $(CC) $(CFLAGS) -o $(FLEX) $(LDFLAGS) $(OBJECTS) $(FLEXLIB) $(LIBS)
99 .bootstrap: initscan.c
101 cp $(srcdir)/initscan.c scan.c
105 $(YACC) -d $(srcdir)/parse.y
106 @sed '/extern char.*malloc/d' <y.tab.c >parse.tmp
107 @mv parse.tmp parse.c
114 $(FLEX_EXEC) $(FLEX_FLAGS) $(COMPRESSION) $(srcdir)/scan.l >scan.c
115 @sed s,\"$(srcdir)/scan.l\",\"scan.l\", <scan.c >scan.tmp
118 scan.o: scan.c parse.h flexdef.h config.h
119 yylex.o: yylex.c parse.h flexdef.h config.h
121 skel.c: flex.skl mkskel.sh
122 $(SHELL) $(srcdir)/mkskel.sh $(srcdir)/flex.skl >skel.c
124 main.o: main.c flexdef.h config.h version.h
125 ccl.o: ccl.c flexdef.h config.h
126 dfa.o: dfa.c flexdef.h config.h
127 ecs.o: ecs.c flexdef.h config.h
128 gen.o: gen.c flexdef.h config.h
129 misc.o: misc.c flexdef.h config.h
130 nfa.o: nfa.c flexdef.h config.h
131 parse.o: parse.c flexdef.h config.h
132 skel.o: skel.c flexdef.h config.h
133 sym.o: sym.c flexdef.h config.h
134 tblcmp.o: tblcmp.c flexdef.h config.h
137 $(CC) $(CPPFLAGS) $(CFLAGS) -c -Dxmalloc=yy_flex_xmalloc alloca.c
139 alloca.c: $(srcdir)/MISC/alloca.c
141 cp $(srcdir)/MISC/alloca.c .
145 $(FLEX_EXEC) $(FLEX_FLAGS) $(COMPRESSION) $(srcdir)/scan.l \
146 | sed s,\"$(srcdir)/scan.l\",\"scan.l\", \
148 @echo "Check successful, using COMPRESSION=\"$(COMPRESSION)\""
151 rm -f scan.c ; $(MAKE) COMPRESSION="-C" check
152 rm -f scan.c ; $(MAKE) COMPRESSION="-Ce" check
153 rm -f scan.c ; $(MAKE) COMPRESSION="-Cm" check
154 rm -f scan.c ; $(MAKE) COMPRESSION="-f" check
155 rm -f scan.c ; $(MAKE) COMPRESSION="-Cfea" check
156 rm -f scan.c ; $(MAKE) COMPRESSION="-CFer" check
157 rm -f scan.c ; $(MAKE) COMPRESSION="-l" PERF_REPORT="" check
158 rm -f scan.c ; $(MAKE)
159 @echo "All checks successful"
161 $(FLEXLIB): $(LIBOBJS)
162 $(AR) cru $(FLEXLIB) $(LIBOBJS)
163 -$(RANLIB) $(FLEXLIB)
166 cd $(srcdir) && nroff -man flex.1 >$(FLEX).man
168 install: $(FLEX) $(FLEXLIB) installdirs install.$(INSTALLMAN)
169 $(INSTALL_PROGRAM) $(FLEX) $(bindir)/$(FLEX)
170 @rm -f $(bindir)/$(FLEX)++
171 cd $(bindir) && $(LN_S) $(FLEX) $(FLEX)++
172 $(INSTALL_DATA) $(FLEXLIB) $(libdir)/$(FLEXLIB)
173 -cd $(libdir) && $(RANLIB) $(FLEXLIB)
174 $(INSTALL_DATA) $(srcdir)/FlexLexer.h $(includedir)/FlexLexer.h
176 # Note, the following rules delete any vestigial flexdoc installed
177 # for a prior flex release.
179 rm -f $(mandir)/$(FLEX)doc.$(manext)
180 $(INSTALL_DATA) $(srcdir)/flex.1 $(mandir)/$(FLEX).$(manext)
182 install.cat: $(FLEX).man
183 rm -f $(mandir)/$(FLEX)doc.$(manext)
184 $(INSTALL_DATA) $(srcdir)/$(FLEX).man $(mandir)/$(FLEX).$(manext)
187 $(SHELL) $(srcdir)/mkinstalldirs \
188 $(bindir) $(libdir) $(includedir) $(mandir)
191 rm -f $(bindir)/$(FLEX) $(bindir)/$(FLEX)++
192 rm -f $(libdir)/$(FLEXLIB)
193 rm -f $(includedir)/FlexLexer.h
194 rm -f $(mandir)/$(FLEX).$(manext) $(mandir)/$(FLEX)doc.$(manext)
203 lint -Dconst= $(LINTSRCS) > flex.lint
205 gcc-lint: $(LINTSRCS)
206 gcc -Dlint -Wall $(LINTSRCS) >flex.gcc-lint 2>&1
209 rm -f a.out *.bak core errs scan.tmp
212 rm -f flex parse.c parse.h *.o alloca.c *.lint lex.yy.c lex.yy.cc \
213 $(FLEXLIB) config.log config.cache
216 rm -f .bootstrap $(FLEX) scan.c tags TAGS Makefile config.status \
217 config.h stamp-h config.log config.cache
219 maintainer-clean: distclean
220 @echo "This command is intended for maintainers to use;"
221 @echo "it deletes files that may require special tools to rebuild."
222 rm -f $(FLEX).man skel.c flex*.tar.gz flex*.tar.Z
224 dist: $(FLEX) $(DISTFILES) parse.c parse.h $(srcdir)/$(FLEX).man
225 $(MAKE) DIST_NAME=flex-`sed <version.h 's/[^"]*"//' | sed 's/"//'` dist2
229 @rm -f $(DIST_NAME).tar $(DIST_NAME).tar.Z $(DIST_NAME).tar.gz
231 tar cf - $(DISTFILES) | (cd $(DIST_NAME) && tar xfB -)
232 @mv $(DIST_NAME)/scan.c $(DIST_NAME)/initscan.c
233 @chmod 444 $(DIST_NAME)/initscan.c
234 @chmod +w $(DIST_NAME)/Makefile.in
235 @cp parse.c parse.h $(DIST_NAME)/MISC
236 @col -b <$(srcdir)/$(FLEX).man >$(DIST_NAME)/MISC/flex.man
237 tar chf $(DIST_NAME).tar $(DIST_NAME)
238 compress <$(DIST_NAME).tar >$(DIST_NAME).tar.Z
239 gzip <$(DIST_NAME).tar >$(DIST_NAME).tar.gz
242 # For an explanation of the following Makefile rules, see node
243 # `Automatic Remaking' in GNU Autoconf documentation.
244 Makefile: $(srcdir)/Makefile.in config.status
245 CONFIG_FILES=$@ CONFIG_HEADERS= ./config.status
246 config.status: configure
247 ./config.status --recheck
248 configure: configure.in
249 cd $(srcdir) && autoconf
251 stamp-h: conf.in config.status
252 CONFIG_FILES= CONFIG_HEADERS=config.h:conf.in ./config.status
253 echo timestamp >stamp-h
254 # conf.in: stamp-h.in
255 # stamp-h.in: configure.in acconfig.h
256 # cd $(srcdir) && autoheader
257 # config.h.in conf.in
258 # cho timestamp > $(srcdir)/stamp-h.in
260 # Tell versions [3.59,3.63) of GNU make not to export all variables.
261 # Otherwise a system limit (for SysV at least) may be exceeded.