home *** CD-ROM | disk | FTP | other *** search
/ Geek Gadgets 1 / ADE-1.bin / ade-dist / flex-2.5.2-src.tgz / tar.out / fsf / flex / Makefile.in < prev    next >
Makefile  |  1996-09-28  |  8KB  |  269 lines

  1. # @(#) $Header: /home/daffy/u0/vern/flex/RCS/Makefile.in,v 1.44 95/04/21 11:53:05 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. # Raw, unformatted troff source will be installed if INSTALLMAN=man,
  28. # nroff preformatted versions will be installed if INSTALLMAN=cat.
  29.  
  30. prefix = @prefix@
  31. exec_prefix = @exec_prefix@
  32. bindir = $(exec_prefix)/bin
  33. libdir = $(exec_prefix)/lib
  34. includedir = $(prefix)/include
  35. manext = 1
  36. mandir = $(prefix)/man/man$(manext)
  37.  
  38. # You can define these to be "lex" and "libl.a" if you want to replace
  39. # lex at your site.
  40. FLEX = flex
  41. FLEXLIB = libfl.a
  42.  
  43. INSTALLMAN = man
  44.  
  45. SHELL = /bin/sh
  46. srcdir = @srcdir@
  47. VPATH = @srcdir@
  48.  
  49. # For the Amiga, force LN_S to be just "cp" rather than "ln -s", so that a
  50. # copy is made rather than a symbolic link.  We support symbolic links, but
  51. # we don't want to use them in the installation because the "mkisofs" CD-ROM
  52. # mastering software doesn't know what to do with them yet (convert to a
  53. # copy on the fly).
  54. #LN_S = @LN_S@
  55. LN_S = cp
  56. YACC = @YACC@
  57. CC = @CC@
  58. AR = ar
  59. RANLIB = @RANLIB@
  60. INSTALL = @INSTALL@
  61. INSTALL_DATA = @INSTALL_DATA@
  62. INSTALL_PROGRAM = @INSTALL_PROGRAM@
  63.  
  64. # You normally do not need to modify anything below this point.
  65. # ------------------------------------------------------------
  66.  
  67. CPPFLAGS = -I. -I$(srcdir)
  68.  
  69. .c.o:
  70.     $(CC) -c $(CPPFLAGS) $(CFLAGS) $<
  71.  
  72. HEADERS = flexdef.h version.h
  73.  
  74. SOURCES = ccl.c dfa.c ecs.c gen.c main.c misc.c nfa.c parse.y \
  75.     scan.l skel.c sym.c tblcmp.c yylex.c
  76. OBJECTS = ccl.o dfa.o ecs.o gen.o main.o misc.o nfa.o parse.o \
  77.     scan.o skel.o sym.o tblcmp.o yylex.o @ALLOCA@
  78.  
  79. LIBSRCS = libmain.c libyywrap.c
  80. LIBOBJS = libmain.o libyywrap.o
  81.  
  82. LINTSRCS = ccl.c dfa.c ecs.c gen.c main.c misc.c nfa.c parse.c \
  83.     scan.c skel.c sym.c tblcmp.c yylex.c
  84.  
  85. DISTFILES = README NEWS COPYING INSTALL FlexLexer.h \
  86.     configure.in conf.in Makefile.in mkskel.sh flex.skl \
  87.     $(HEADERS) $(SOURCES) $(LIBSRCS) MISC \
  88.     flex.1 scan.c install.sh mkinstalldirs configure
  89.  
  90. DIST_NAME = flex
  91.  
  92. # which "flex" to use to generate scan.c from scan.l
  93. FLEX_EXEC = ./$(FLEX)
  94. FLEX_FLAGS = -t $(PERF_REPORT)
  95. COMPRESSION =
  96. PERF_REPORT = -p
  97.  
  98.  
  99. all: $(FLEX)
  100.  
  101. $(FLEX): .bootstrap $(OBJECTS) $(FLEXLIB)
  102.     $(CC) $(CFLAGS) -o $(FLEX) $(LDFLAGS) $(OBJECTS) $(FLEXLIB) $(LIBS)
  103.  
  104. .bootstrap: initscan.c
  105.     @rm -f scan.c
  106.     cp $(srcdir)/initscan.c scan.c
  107.     touch .bootstrap
  108.  
  109. parse.c: parse.y
  110.     $(YACC) -d $(srcdir)/parse.y
  111.     @sed '/extern char.*malloc/d' <y.tab.c >parse.tmp
  112.     @mv parse.tmp parse.c
  113.     @mv y.tab.h parse.h
  114.     @rm -f y.tab.c
  115.  
  116. parse.h: parse.c
  117.  
  118. scan.c: scan.l
  119.     $(FLEX_EXEC) $(FLEX_FLAGS) $(COMPRESSION) $(srcdir)/scan.l >scan.c
  120.     @sed s,\"$(srcdir)/scan.l\",\"scan.l\", <scan.c >scan.tmp
  121.     @mv scan.tmp scan.c
  122.  
  123. scan.o: scan.c parse.h flexdef.h config.h
  124. yylex.o: yylex.c parse.h flexdef.h config.h
  125.  
  126. skel.c: flex.skl mkskel.sh
  127.     $(SHELL) $(srcdir)/mkskel.sh $(srcdir)/flex.skl >skel.c
  128.  
  129. main.o: main.c flexdef.h config.h version.h
  130. ccl.o: ccl.c flexdef.h config.h
  131. dfa.o: dfa.c flexdef.h config.h
  132. ecs.o: ecs.c flexdef.h config.h
  133. gen.o: gen.c flexdef.h config.h
  134. misc.o: misc.c flexdef.h config.h
  135. nfa.o: nfa.c flexdef.h config.h
  136. parse.o: parse.c flexdef.h config.h
  137. skel.o: skel.c flexdef.h config.h
  138. sym.o: sym.c flexdef.h config.h
  139. tblcmp.o: tblcmp.c flexdef.h config.h
  140.  
  141. alloca.o: alloca.c
  142.     $(CC) $(CPPFLAGS) $(CFLAGS) -c -Dxmalloc=yy_flex_xmalloc alloca.c
  143.  
  144. alloca.c: $(srcdir)/MISC/alloca.c
  145.     @rm -f alloca.c
  146.     cp $(srcdir)/MISC/alloca.c .
  147.  
  148. test: check
  149. check: $(FLEX)
  150.     $(FLEX_EXEC) $(FLEX_FLAGS) $(COMPRESSION) $(srcdir)/scan.l \
  151.     | sed s,\"$(srcdir)/scan.l\",\"scan.l\", \
  152.     | diff scan.c -
  153.     @echo "Check successful, using COMPRESSION=\"$(COMPRESSION)\""
  154.  
  155. bigcheck:
  156.     rm -f scan.c ; $(MAKE) COMPRESSION="-C" check
  157.     rm -f scan.c ; $(MAKE) COMPRESSION="-Ce" check
  158.     rm -f scan.c ; $(MAKE) COMPRESSION="-Cm" check
  159.     rm -f scan.c ; $(MAKE) COMPRESSION="-f" check
  160.     rm -f scan.c ; $(MAKE) COMPRESSION="-Cfea" check
  161.     rm -f scan.c ; $(MAKE) COMPRESSION="-CFer" check
  162.     rm -f scan.c ; $(MAKE) COMPRESSION="-l" PERF_REPORT="" check
  163.     rm -f scan.c ; $(MAKE)
  164.     @echo "All checks successful"
  165.  
  166. $(FLEXLIB): $(LIBOBJS)
  167.     $(AR) cru $(FLEXLIB) $(LIBOBJS)
  168.     -$(RANLIB) $(FLEXLIB)
  169.  
  170. $(FLEX).man: flex.1
  171.     cd $(srcdir) && nroff -man flex.1 >$(FLEX).man
  172.  
  173. install: $(FLEX) $(FLEXLIB) installdirs install.$(INSTALLMAN)
  174.     $(INSTALL_PROGRAM) $(FLEX) $(bindir)/$(FLEX)
  175.     @rm -f $(bindir)/$(FLEX)++
  176.     cd $(bindir) && $(LN_S) $(FLEX) $(FLEX)++
  177.     $(INSTALL_DATA) $(FLEXLIB) $(libdir)/$(FLEXLIB)
  178.     -cd $(libdir) && $(RANLIB) $(FLEXLIB)
  179.     $(INSTALL_DATA) $(srcdir)/FlexLexer.h $(includedir)/FlexLexer.h
  180.  
  181. # Note, the following rules delete any vestigial flexdoc installed
  182. # for a prior flex release.
  183. install.man: flex.1
  184.     rm -f $(mandir)/$(FLEX)doc.$(manext)
  185.     $(INSTALL_DATA) $(srcdir)/flex.1 $(mandir)/$(FLEX).$(manext)
  186.  
  187. install.cat: $(FLEX).man
  188.     rm -f $(mandir)/$(FLEX)doc.$(manext)
  189.     $(INSTALL_DATA) $(srcdir)/$(FLEX).man $(mandir)/$(FLEX).$(manext)
  190.  
  191. installdirs:
  192.     $(SHELL) $(srcdir)/mkinstalldirs \
  193.       $(bindir) $(libdir) $(includedir) $(mandir)
  194.  
  195. uninstall:
  196.     rm -f $(bindir)/$(FLEX) $(bindir)/$(FLEX)++
  197.     rm -f $(libdir)/$(FLEXLIB)
  198.     rm -f $(includedir)/FlexLexer.h
  199.     rm -f $(mandir)/$(FLEX).$(manext) $(mandir)/$(FLEX)doc.$(manext)
  200.  
  201. tags: $(SOURCES)
  202.     ctags $(SOURCES)
  203.  
  204. TAGS: $(SOURCES)
  205.     etags $(SOURCES)
  206.  
  207. lint: $(LINTSRCS)
  208.     lint -Dconst= $(LINTSRCS) > flex.lint
  209.  
  210. gcc-lint: $(LINTSRCS)
  211.     gcc -Dlint -Wall $(LINTSRCS) >flex.gcc-lint 2>&1
  212.  
  213. mostlyclean:
  214.     rm -f a.out *.bak core errs scan.tmp
  215.  
  216. clean: mostlyclean
  217.     rm -f flex parse.c parse.h *.o alloca.c *.lint lex.yy.c lex.yy.cc \
  218.         $(FLEXLIB) config.log config.cache
  219.  
  220. distclean: clean
  221.     rm -f .bootstrap $(FLEX) scan.c tags TAGS Makefile config.status \
  222.         config.h
  223.  
  224. maintainer-clean: distclean
  225.     @echo "This command is intended for maintainers to use;"
  226.     @echo "it deletes files that may require special tools to rebuild."
  227.     rm -f $(FLEX).man skel.c flex*.tar.gz flex*.tar.Z
  228.  
  229. dist: $(FLEX) $(DISTFILES) parse.c parse.h $(srcdir)/$(FLEX).man
  230.     $(MAKE) DIST_NAME=flex-`sed <version.h 's/[^"]*"//' | sed 's/"//'` dist2
  231.  
  232. dist2:
  233.     @rm -rf $(DIST_NAME)
  234.     @rm -f $(DIST_NAME).tar $(DIST_NAME).tar.Z $(DIST_NAME).tar.gz
  235.     @mkdir $(DIST_NAME)
  236.     tar cf - $(DISTFILES) | (cd $(DIST_NAME) && tar xfB -)
  237.     @mv $(DIST_NAME)/scan.c $(DIST_NAME)/initscan.c
  238.     @chmod 444 $(DIST_NAME)/initscan.c
  239.     @chmod +w $(DIST_NAME)/Makefile.in
  240.     @cp parse.c parse.h $(DIST_NAME)/MISC
  241.     @col -b <$(srcdir)/$(FLEX).man >$(DIST_NAME)/MISC/flex.man
  242.     tar chf $(DIST_NAME).tar $(DIST_NAME)
  243.     compress <$(DIST_NAME).tar >$(DIST_NAME).tar.Z
  244.     gzip <$(DIST_NAME).tar >$(DIST_NAME).tar.gz
  245.     @rm $(DIST_NAME).tar
  246.  
  247. # For an explanation of the following Makefile rules, see node
  248. # `Automatic Remaking' in GNU Autoconf documentation.
  249. Makefile: $(srcdir)/Makefile.in config.status
  250.     CONFIG_FILES=$@ CONFIG_HEADERS= ./config.status
  251. config.status: configure
  252.     ./config.status --recheck
  253. configure: configure.in
  254.     cd $(srcdir) && autoconf
  255. config.h: stamp-h
  256. stamp-h: conf.in config.status
  257.     CONFIG_FILES= CONFIG_HEADERS=config.h:conf.in ./config.status
  258.     echo timestamp >stamp-h
  259. # conf.in: stamp-h.in
  260. # stamp-h.in: configure.in acconfig.h
  261. #     cd $(srcdir) && autoheader
  262. #     config.h.in conf.in
  263. #     cho timestamp > $(srcdir)/stamp-h.in
  264.  
  265. # Tell versions [3.59,3.63) of GNU make not to export all variables.
  266. # Otherwise a system limit (for SysV at least) may be exceeded.
  267. .NOEXPORT:
  268.