OSDN Git Service

Fix no pic
[uclinux-h8/uClinux-dist.git] / lib / flex / Makefile.in
1 # @(#) $Header: /home/daffy/u0/vern/flex/RCS/Makefile.in,v 1.45 96/09/10 16:59:04 vern Exp $ (LBL)
2
3 @SET_MAKE@
4
5 # Possible values for DEFS:
6 #
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"
10 # to DEFS.
11 #
12 # For Vax/VMS, add "-DVMS" to DEFS.
13 #
14 # For MS-DOS, add "-DMS_DOS" to DEFS.  See the directory MISC/MSDOS for
15 # additional info.
16
17 CFLAGS = @CFLAGS@
18 CPPFLAGS = @CPPFLAGS@
19 DEFS = @DEFS@
20 LDFLAGS =  @LDFLAGS@
21 LIBS = @LIBS@
22
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.
27
28 # Raw, unformatted troff source will be installed if INSTALLMAN=man,
29 # nroff preformatted versions will be installed if INSTALLMAN=cat.
30
31 prefix = @prefix@
32 exec_prefix = @exec_prefix@
33 bindir = $(exec_prefix)/bin
34 libdir = $(exec_prefix)/lib
35 includedir = $(prefix)/include
36 manext = 1
37 mandir = $(prefix)/man/man$(manext)
38
39 # You can define these to be "lex" and "libl.a" if you want to replace
40 # lex at your site.
41 FLEX = flex
42 FLEXLIB = libfl.a
43
44 INSTALLMAN = man
45
46 SHELL = /bin/sh
47 srcdir = @srcdir@
48 VPATH = @srcdir@
49
50 LN_S = @LN_S@
51 YACC = @YACC@
52 CC = @CC@
53 AR = ar
54 RANLIB = @RANLIB@
55 INSTALL = @INSTALL@
56 INSTALL_DATA = @INSTALL_DATA@
57 INSTALL_PROGRAM = @INSTALL_PROGRAM@
58
59 # You normally do not need to modify anything below this point.
60 # ------------------------------------------------------------
61
62 CPPFLAGS = -I. -I$(srcdir)
63
64 .c.o:
65         $(CC) -c $(CPPFLAGS) $(CFLAGS) $<
66
67 HEADERS = flexdef.h version.h
68
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@
73
74 LIBSRCS = libmain.c libyywrap.c
75 LIBOBJS = libmain.o libyywrap.o
76
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
79
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
84
85 DIST_NAME = flex
86
87 # which "flex" to use to generate scan.c from scan.l
88 FLEX_EXEC = ./$(FLEX)
89 FLEX_FLAGS = -t $(PERF_REPORT)
90 COMPRESSION =
91 PERF_REPORT = -p
92
93
94 all: $(FLEX)
95
96 $(FLEX): .bootstrap $(OBJECTS) $(FLEXLIB)
97         $(CC) $(CFLAGS) -o $(FLEX) $(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
104 parse.c: parse.y
105         $(YACC) -d $(srcdir)/parse.y
106         @sed '/extern char.*malloc/d' <y.tab.c >parse.tmp
107         @mv parse.tmp parse.c
108         @mv y.tab.h parse.h
109         @rm -f y.tab.c
110
111 parse.h: parse.c
112
113 scan.c: scan.l
114         $(FLEX_EXEC) $(FLEX_FLAGS) $(COMPRESSION) $(srcdir)/scan.l >scan.c
115         @sed s,\"$(srcdir)/scan.l\",\"scan.l\", <scan.c >scan.tmp
116         @mv scan.tmp scan.c
117
118 scan.o: scan.c parse.h flexdef.h config.h
119 yylex.o: yylex.c parse.h flexdef.h config.h
120
121 skel.c: flex.skl mkskel.sh
122         $(SHELL) $(srcdir)/mkskel.sh $(srcdir)/flex.skl >skel.c
123
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
135
136 alloca.o: alloca.c
137         $(CC) $(CPPFLAGS) $(CFLAGS) -c -Dxmalloc=yy_flex_xmalloc alloca.c
138
139 alloca.c: $(srcdir)/MISC/alloca.c
140         @rm -f alloca.c
141         cp $(srcdir)/MISC/alloca.c .
142
143 test: check
144 check: $(FLEX)
145         $(FLEX_EXEC) $(FLEX_FLAGS) $(COMPRESSION) $(srcdir)/scan.l \
146         | sed s,\"$(srcdir)/scan.l\",\"scan.l\", \
147         | diff scan.c -
148         @echo "Check successful, using COMPRESSION=\"$(COMPRESSION)\""
149
150 bigcheck:
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"
160
161 $(FLEXLIB): $(LIBOBJS)
162         $(AR) cru $(FLEXLIB) $(LIBOBJS)
163         -$(RANLIB) $(FLEXLIB)
164
165 $(FLEX).man: flex.1
166         cd $(srcdir) && nroff -man flex.1 >$(FLEX).man
167
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
175
176 # Note, the following rules delete any vestigial flexdoc installed
177 # for a prior flex release.
178 install.man: flex.1
179         rm -f $(mandir)/$(FLEX)doc.$(manext)
180         $(INSTALL_DATA) $(srcdir)/flex.1 $(mandir)/$(FLEX).$(manext)
181
182 install.cat: $(FLEX).man
183         rm -f $(mandir)/$(FLEX)doc.$(manext)
184         $(INSTALL_DATA) $(srcdir)/$(FLEX).man $(mandir)/$(FLEX).$(manext)
185
186 installdirs:
187         $(SHELL) $(srcdir)/mkinstalldirs \
188           $(bindir) $(libdir) $(includedir) $(mandir)
189
190 uninstall:
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)
195
196 tags: $(SOURCES)
197         ctags $(SOURCES)
198
199 TAGS: $(SOURCES)
200         etags $(SOURCES)
201
202 lint: $(LINTSRCS)
203         lint -Dconst= $(LINTSRCS) > flex.lint
204
205 gcc-lint: $(LINTSRCS)
206         gcc -Dlint -Wall $(LINTSRCS) >flex.gcc-lint 2>&1
207
208 mostlyclean:
209         rm -f a.out *.bak core errs scan.tmp
210
211 clean: mostlyclean
212         rm -f flex parse.c parse.h *.o alloca.c *.lint lex.yy.c lex.yy.cc \
213                 $(FLEXLIB) config.log config.cache
214
215 distclean: clean
216         rm -f .bootstrap $(FLEX) scan.c tags TAGS Makefile config.status \
217                 config.h stamp-h config.log config.cache
218
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
223
224 dist: $(FLEX) $(DISTFILES) parse.c parse.h $(srcdir)/$(FLEX).man
225         $(MAKE) DIST_NAME=flex-`sed <version.h 's/[^"]*"//' | sed 's/"//'` dist2
226
227 dist2:
228         @rm -rf $(DIST_NAME)
229         @rm -f $(DIST_NAME).tar $(DIST_NAME).tar.Z $(DIST_NAME).tar.gz
230         @mkdir $(DIST_NAME)
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
240         @rm $(DIST_NAME).tar
241
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
250 config.h: stamp-h
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
259
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.
262 .NOEXPORT: