BSD 4_4_Lite1 release
[unix-history] / usr / src / contrib / flex-2.4.6 / Makefile
CommitLineData
ed554bc5
C
1# Generated automatically from Makefile.in by configure.
2# @(#) $Header: /usr/src/contrib/flex-2.4.6/RCS/Makefile.in,v 1.3 1994/01/05 00:30:25 vern Exp $ (LBL)
3
4# If your version of "make" does not define $(MAKE), comment in the
5# definition of "MAKE" below. (You only need to do this if you intend
6# to do "make bigcheck" or "make dist".)
7# MAKE = make
8
9# Possible values for DEFS:
10#
11# For flex to always generate 8-bit scanners, add "-DDEFAULT_CSIZE=256"
12# to DEFS.
13#
14# For Vax/VMS, add "-DVMS" to DEFS.
15#
16# For MS-DOS, add "-DMS_DOS" to DEFS. See the directory MISC/MSDOS for
17# additional info.
18
19CFLAGS = -O
20DEFS = -DSTDC_HEADERS=1 -DHAVE_STRING_H=1
21LDFLAGS =
22LIBS =
23
24# Installation targeting. Files will be installed under the tree
25# rooted at prefix. flex will be installed in bindir, libfl.a in
26# libdir, FlexLexer.h will be installed in includedir, and the manual
27# pages will be installed in mandir with extension manext.
28#
29# Raw, unformatted troff source will be installed if INSTALLMAN=man,
30# nroff preformatted versions will be installed if INSTALLMAN=cat.
31
32prefix = /usr
33exec_prefix = $(prefix)
34bindir = $(exec_prefix)/bin
35libdir = $(exec_prefix)/lib
36includedir = $(prefix)/include
37manext = 1
38mandir = $(prefix)/share/man/cat$(manext)
39
40INSTALLMAN = cat
41
42SHELL = /bin/sh
43srcdir = .
44VPATH = .
45
46LN_S = ln -s
47YACC = yacc
48CC = gcc
49AR = ar
50RANLIB = ranlib
51INSTALL = /usr/bin/install -c
52INSTALL_DATA = $(INSTALL) -m 644
53INSTALL_PROGRAM = $(INSTALL)
54
55# You normally do not need to modify anything below this point.
56# ------------------------------------------------------------
57
58CPPFLAGS = -I. -I$(srcdir) $(DEFS)
59
60.c.o:
61 $(CC) -c $(CPPFLAGS) $(CFLAGS) $<
62
63HEADERS = flexdef.h version.h
64
65SOURCES = ccl.c dfa.c ecs.c gen.c main.c misc.c nfa.c parse.y \
66 scan.l skel.c sym.c tblcmp.c yylex.c
67OBJECTS = ccl.o dfa.o ecs.o gen.o main.o misc.o nfa.o parse.o \
68 scan.o skel.o sym.o tblcmp.o yylex.o
69
70LIBSRCS = libmain.c libyywrap.c
71LIBOBJS = libmain.o libyywrap.o
72
73LINTSRCS = ccl.c dfa.c ecs.c gen.c main.c misc.c nfa.c parse.c \
74 scan.c skel.c sym.c tblcmp.c yylex.c
75
76DISTFILES = README NEWS COPYING INSTALL FlexLexer.h \
77 configure.in Makefile.in mkskel.sh flex.skl \
78 $(HEADERS) $(SOURCES) $(LIBSRCS) MISC \
79 flex.1 flexdoc.1 \
80 scan.c install.sh mkinstalldirs configure
81
82DIST_NAME = lex
83
84# which "flex" to use to generate scan.c from scan.l
85FLEX = ./lex
86FLEX_FLAGS = -ist $(PERF_REPORT)
87COMPRESSION =
88PERF_REPORT = -p
89
90FLEXLIB = libl.a
91
92
93all: flex
94
95flex: lex
96lex: .bootstrap $(OBJECTS) $(FLEXLIB)
97 $(CC) $(CFLAGS) -o lex $(LDFLAGS) $(OBJECTS) $(FLEXLIB) $(LIBS)
98
99.bootstrap: initscan.c
100 @rm -f scan.c
101 cp $(srcdir)/initscan.c scan.c
102 touch .bootstrap
103
104parse.c: parse.y
105 $(YACC) -d $(srcdir)/parse.y
106 @sed '/extern char.*malloc/d' <y.tab.c >parse.c
107 @rm -f y.tab.c
108 @mv y.tab.h parse.h
109
110parse.h: parse.c
111
112scan.c: scan.l
113 $(FLEX) $(FLEX_FLAGS) $(COMPRESSION) $(srcdir)/scan.l >scan.tmp
114 sed s,\"$(srcdir)/scan.l\",\"scan.l\", <scan.tmp >scan.c
115 @rm scan.tmp
116
117scan.o: scan.c parse.h flexdef.h
118yylex.o: yylex.c parse.h flexdef.h
119
120skel.c: flex.skl mkskel.sh
121 $(SHELL) $(srcdir)/mkskel.sh $(srcdir)/flex.skl >skel.c
122
123main.o: main.c flexdef.h version.h
124ccl.o: ccl.c flexdef.h
125dfa.o: dfa.c flexdef.h
126ecs.o: ecs.c flexdef.h
127gen.o: gen.c flexdef.h
128misc.o: misc.c flexdef.h
129nfa.o: nfa.c flexdef.h
130parse.o: parse.c flexdef.h
131skel.o: skel.c flexdef.h
132sym.o: sym.c flexdef.h
133tblcmp.o: tblcmp.c flexdef.h
134
135alloca.o: alloca.c
136 $(CC) $(CPPFLAGS) $(CFLAGS) -c -Dxmalloc=yy_flex_xmalloc alloca.c
137
138alloca.c: $(srcdir)/MISC/alloca.c
139 @rm -f alloca.c
140 cp $(srcdir)/MISC/alloca.c .
141
142test: check
143check: flex
144 $(FLEX) $(FLEX_FLAGS) $(COMPRESSION) $(srcdir)/scan.l \
145 | sed s,\"$(srcdir)/scan.l\",\"scan.l\", \
146 | diff scan.c -
147 @echo "Check successful, using COMPRESSION=\"$(COMPRESSION)\""
148
149bigcheck:
150 rm -f scan.c ; $(MAKE) COMPRESSION="-C" check
151 rm -f scan.c ; $(MAKE) COMPRESSION="-Ce" check
152 rm -f scan.c ; $(MAKE) COMPRESSION="-Cm" check
153 rm -f scan.c ; $(MAKE) COMPRESSION="-Cfea" check
154 rm -f scan.c ; $(MAKE) COMPRESSION="-CFer" check
155 rm -f scan.c ; $(MAKE) COMPRESSION="-l" PERF_REPORT="" check
156 rm -f scan.c ; $(MAKE)
157 @echo "All checks successful"
158
159$(FLEXLIB): $(LIBOBJS)
160 $(AR) cru $(FLEXLIB) $(LIBOBJS)
161 -$(RANLIB) $(FLEXLIB)
162
163flex.man: flex.1
164 cd $(srcdir); nroff -man flex.1 >flex.man
165
166flexdoc.man: flexdoc.1
167 cd $(srcdir); nroff -man flexdoc.1 >flexdoc.man
168
169install: lex $(FLEXLIB) install.$(INSTALLMAN)
170 install -s -o bin -g bin -m 555 lex $(bindir)
171 install -o bin -g bin -m 444 $(FLEXLIB) $(libdir)
172 ranlib -t /usr/lib/$(FLEXLIB)
173
174install.man: flex.1 flexdoc.1
175 install $(srcdir)/flex.1 $(mandir)/flex.$(manext)
176 install $(srcdir)/flexdoc.1 $(mandir)/flexdoc.$(manext)
177
178install.cat: flex.man flexdoc.man
179 install $(srcdir)/flex.man $(mandir)/lex.0
180 install $(srcdir)/flexdoc.man $(mandir)/lexdoc.0
181
182installdirs:
183 $(SHELL) $(srcdir)/mkinstalldirs \
184 $(bindir) $(libdir) $(includedir) $(mandir)
185
186uninstall:
187 rm -f $(bindir)/lex $(bindir)/flex++
188 rm -f $(libdir)/libl.a
189 rm -f $(includedir)/FlexLexer.h
190 rm -f $(mandir)/flex.$(manext) $(mandir)/flexdoc.$(manext)
191
192tags: $(SOURCES)
193 ctags $(SOURCES)
194
195TAGS: $(SOURCES)
196 etags $(SOURCES)
197
198lint: $(LINTSRCS)
199 lint -Dconst= $(LINTSRCS) > flex.lint
200
201gcc-lint: $(LINTSRCS)
202 gcc -Dlint -Wall $(LINTSRCS) >flex.gcc-lint 2>&1
203
204mostlyclean:
205 rm -f *~ a.out *.bak core errs scan.tmp
206
207clean: mostlyclean
208 rm -f parse.c parse.h *.o alloca.c *.lint lex.yy.c lex.yy.cc $(FLEXLIB)
209
210distclean: clean
211 rm -f .bootstrap lex scan.c tags TAGS Makefile config.status
212
213realclean: distclean
214 rm -f flex.man flexdoc.man flex*.tar.gz flex*.tar.Z
215
216dist: flex $(DISTFILES)
217 $(MAKE) DIST_NAME=flex-`sed <version.h 's/[^"]*"//' | sed 's/"//'` dist2
218
219dist2:
220 @rm -rf $(DIST_NAME)
221 @rm -f $(DIST_NAME).tar $(DIST_NAME).tar.Z $(DIST_NAME).tar.gz
222 @mkdir $(DIST_NAME)
223 tar cf - $(DISTFILES) | (cd $(DIST_NAME); tar xfB -)
224 @mv $(DIST_NAME)/scan.c $(DIST_NAME)/initscan.c
225 @chmod 444 $(DIST_NAME)/initscan.c
226 @chmod +w $(DIST_NAME)/Makefile.in
227 tar chf $(DIST_NAME).tar $(DIST_NAME)
228 compress <$(DIST_NAME).tar >$(DIST_NAME).tar.Z
229 gzip <$(DIST_NAME).tar >$(DIST_NAME).tar.gz
230 @rm $(DIST_NAME).tar
231
232Makefile: Makefile.in config.status
233 $(SHELL) config.status
234config.status: configure
235 $(SHELL) config.status --recheck
236configure: configure.in
237 cd $(srcdir); autoconf
238
239# Prevent GNU make v3 from overflowing arg limit on SysV.
240.NOEXPORT: