3 # If your version of "make" does not define $(MAKE), comment in the
4 # definition of "MAKE" below. (You only need to do this if you intend
5 # to do "make bigcheck" or "make dist".)
8 # Possible values for DEFS:
10 # For flex to always generate 8-bit scanners, add "-DDEFAULT_CSIZE=256"
13 # For Vax/VMS, add "-DVMS" to DEFS.
15 # For MS-DOS, add "-DMS_DOS" to DEFS. See the directory MISC/MSDOS for
18 CFLAGS = data=far ignore=85 noicons stackextend optimize
19 DEFS = define=YYBISON=1 define=YY_NEVER_INTERACTIVE=1
23 # Installation targeting. Files will be installed under the tree
24 # rooted at prefix. flex will be installed in bindir, libfl.lib 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.
31 prefix = Programmer:other # Change this for your AMIGA system.
32 exec_prefix = $(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 this to be "lex" if you want to replace lex at your site.
52 WMERGE = wmerge # from the CWEB distribution
56 INSTALL_DATA = $(INSTALL)
57 INSTALL_PROGRAM = $(INSTALL)
59 # You normally do not need to modify anything below this point.
60 # ------------------------------------------------------------
62 CPPFLAGS = idir=. idir=$(srcdir) $(DEFS)
65 $(CC) $(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 skel.o sym.o tblcmp.o yylex.o \
73 $(libdir)/alloca.o $(libdir)/xmalloc.o
75 LIBSRCS = libmain.c libyywrap.c
76 LIBOBJS = ansilibmain.o ansilibyywrap.o
78 LINTSRCS = ccl.c dfa.c ecs.c gen.c main.c misc.c nfa.c parse.c \
79 scan.c skel.c sym.c tblcmp.c yylex.c
81 DISTFILES = README NEWS COPYING INSTALL FlexLexer.h \
82 configure.in conf.in Makefile.in mkskel.sh skel.c flex.skl \
83 $(HEADERS) $(SOURCES) $(LIBSRCS) MISC \
84 flex.1 scan.c install.sh mkinstalldirs configure
88 # which "flex" to use to generate scan.c from scan.l
90 FLEX_FLAGS = -t $(PERF_REPORT)
98 $(FLEX): $(OBJECTS) $(FLEXLIB) scan.o
99 $(CC) $(CFLAGS) link to $(FLEX) $(LDFLAGS) $(OBJECTS) scan.o $(FLEXLIB) $(LIBS)
101 bootflex: $(OBJECTS) $(FLEXLIB) initscan.o
102 $(CC) $(CFLAGS) link to $(FLEX) $(LDFLAGS) $(OBJECTS) initscan.o $(FLEXLIB) $(LIBS)
105 $(YACC) -d ansiparse.y
106 $(SED) "/extern char.*malloc/d" <y.tab.c >parse.tmp
107 copy parse.tmp parse.c
109 @delete y.tab.c y.tab.h parse.tmp
110 ansiparse.y: $(srcdir)/parse.y parse.ych
111 $(WMERGE) $(srcdir)/parse.y parse.ych ansiparse.y
116 $(FLEX_EXEC) $(FLEX_FLAGS) $(COMPRESSION) $(srcdir)/scan.l >scan.tmp
117 $(SED) s,\"$(srcdir)/scan.l\",\"scan.l\", <scan.tmp >scan.c
120 scan.o: scan.c parse.h flexdef.h config.h
121 initscan.o: initscan.c parse.h flexdef.h config.h
122 yylex.o: yylex.c parse.h flexdef.h config.h
124 skel.c: flex.skl mkskel.sh
125 $(SHELL) $(srcdir)/mkskel.sh $(srcdir)/flex.skl >skel.c
127 main.o: main.c flexdef.h config.h version.h
128 ccl.o: ccl.c flexdef.h config.h
129 dfa.o: dfa.c flexdef.h config.h
130 ecs.o: ecs.c flexdef.h config.h
131 gen.o: gen.c flexdef.h config.h
132 misc.o: misc.c flexdef.h config.h
133 nfa.o: nfa.c flexdef.h config.h
134 parse.o: parse.c flexdef.h config.h
135 skel.o: skel.c flexdef.h config.h
136 sym.o: sym.c flexdef.h config.h
137 tblcmp.o: tblcmp.c flexdef.h config.h
140 $(CC) $(CPPFLAGS) $(CFLAGS) define=xmalloc=yy_flex_xmalloc alloca.c
142 alloca.c: $(srcdir)/MISC/alloca.c
144 copy $(srcdir)/MISC/alloca.c .
148 $(FLEX_EXEC) $(FLEX_FLAGS) $(COMPRESSION) $(srcdir)/scan.l > temp_a
149 $(SED) s,"$(srcdir)/scan.l","scan.l", < temp_a > temp_b
150 -diff scan.c temp_b -l10000 -w
152 @echo "Check successful, using COMPRESSION='$(COMPRESSION)'"
156 $(MAKE) COMPRESSION=-C check
158 $(MAKE) COMPRESSION=-Ce check
160 $(MAKE) COMPRESSION=-Cm check
162 $(MAKE) COMPRESSION=-Cfea check
164 $(MAKE) COMPRESSION=-CFer check
166 $(MAKE) COMPRESSION=-l PERF_REPORT= check
169 @echo "All checks successful"
171 $(FLEXLIB): $(LIBOBJS)
172 $(AR) $(FLEXLIB) R $(LIBOBJS)
174 $(FLEX).man: flex.1 # SMAKE can't `cd', sorry. And, I don't have nroff.
175 # cd $(srcdir), nroff -man flex.1 >$(FLEX).man
177 install: $(FLEX) $(FLEXLIB)
178 $(INSTALL_PROGRAM) $(FLEX) $(bindir)/$(FLEX)
179 # @delete $(bindir)/$(FLEX)++
180 $(INSTALL_DATA) $(FLEXLIB) $(libdir)/libfl.lib
181 $(INSTALL_DATA) $(srcdir)/FlexLexer.h $(includedir)/FlexLexer.h
183 ansilibmain.o: ansilibmain.c
184 ansilibmain.c: libmain.c libmain.ch
185 $(WMERGE) libmain.c libmain.ch ansilibmain.c
186 ansilibyywrap.o: ansilibyywrap.c
187 ansilibyywrap.c: libyywrap.c libyywrap.ch
188 $(WMERGE) libyywrap.c libyywrap.ch ansilibyywrap.c
191 -delete parse.(c|h) ansi\#? \#?.(bak|o|lnk) \
192 alloca.c lex.yy.(c|cc) $(FLEXLIB)
195 -delete $(FLEX) scan.c