home *** CD-ROM | disk | FTP | other *** search
/ Fresh Fish 6 / FreshFish_September1994.bin / bbs / gnu / flex-2.4.7-src.lha / GNU / src / amiga / flex-2.4.7 / MISC / MSDOS / Make.Microsoft next >
Encoding:
Text File  |  1990-07-03  |  3.3 KB  |  117 lines

  1. (Message inbox:40)
  2. Date:      Sat, 30 Jun 90 20:55:22 EDT
  3. From:  Russell Herman <rwh@me.utoronto.ca>
  4. Subject:  Re: flex release 2.3
  5. To:  vern@cs.cornell.edu
  6. Newsgroups:  comp.sources.d
  7. Organization:  none
  8.  
  9. Kudos on the latest version of Flex.  It was a pleasant surprise to get
  10. a piece of code, push it through a PC compiler, and not get a tonne of
  11. warning messages.  However, it was also an unpleasant unsurprise to
  12. discover that it didn't work due to Microsoft's perpetually buggy
  13. compilers.  Here's a Makefile for one that finally did work; at least,
  14. it ran the test case.  Any idea of a good source to really learn about
  15. the lex/yacc class of tools?
  16.  
  17. Russ Herman
  18. INTERNET: rwh@me.utoronto.ca  UUCP: ..uunet!utai!me!rwh
  19.  
  20. ============================================================================
  21. # make file for "flex" tool using MSC6 and nmk, derived from
  22. # @(#) $Header: Makefile,v 2.3 89/06/20 17:27:12 vern Exp $ (LBL)
  23. # by rwh@me.utoronto.ca
  24.  
  25. # **********************************************************************
  26. #    Change SKELETON_FILE and SKELETON DIR to reflect your layout
  27. #    You may also have to add a
  28. #        #define register
  29. #    to flexdef.h - I (rwh) did
  30. # **********************************************************************
  31.  
  32. # the first time around use "make first_flex" if scan.c absent
  33.  
  34.  
  35. YACC=yacc
  36. SKELETON_DIR = e:\\includes
  37. SKELETON_FILE = flexskel.h
  38. SKELFLAGS = -DDEFAULT_SKELETON_FILE=\"$(SKELETON_DIR)\\$(SKELETON_FILE)\"
  39. # Use next flag set for debugging
  40. # CFLAGS =  /AL /DMSC6 /Gt768 /Od /Zi
  41. # /Ox blows up with R6001/R6000 on test case, so fall back some opt-levels
  42. CFLAGS =  /AC /DMSC6 /Gt768 /Oitc
  43. LDFLAGS = /noi /cp:1 /stack:8192
  44.  
  45. #this null definition prevents a returned error code
  46. MFLAGS =
  47.  
  48. FLEX_FLAGS =
  49. FLEX = flex
  50. CC = cl
  51.  
  52. # break obj-list into two because of 128 character command-line limit of
  53. # Microsoft's link and lib utilities.
  54. FLEXOBJS1 = ccl.obj dfa.obj ecs.obj gen.obj main.obj misc.obj nfa.obj parse.obj
  55. FLEXOBJS2 = scan.obj sym.obj tblcmp.obj yylex.obj
  56.  
  57. FLEX_C_SOURCES = \
  58.     ccl.c \
  59.     dfa.c \
  60.     ecs.c \
  61.     gen.c \
  62.     main.c \
  63.     misc.c \
  64.     nfa.c \
  65.     parse.c \
  66.     scan.c \
  67.     sym.c \
  68.     tblcmp.c \
  69.     yylex.c
  70.  
  71. # lib is used to get around the 128 character command-line limit of 'link'.
  72. flex.exe: tmplib.lib $(FLEXOBJS2)
  73.     link $(LDFLAGS) $(FLEXOBJS2),$*.exe,,tmplib;
  74. # Use next line for Codeview
  75. #    link $(LDFLAGS) $(FLEXOBJS2),$*.exe,,tmplib /CO;
  76.     -del  tmplib.lib
  77.  
  78. tmplib.lib: $(FLEXOBJS1)
  79.     lib tmplib $(FLEXOBJS1);
  80.  
  81. # the second 'make flex.exe' causes scan.l to be RE-flexed.  The resulting
  82. # scan.c is different from initscan.c in that \r\n are added instead of
  83. # just \n.  Since \r\n is DOS language and this is targetted for PCs, and
  84. # since I don't know what would happen for all cases in DOS-land, I went
  85. # ahead and did it.
  86. first_flex:
  87.     copy initscan.c scan.c
  88.     nmk $(MFLAGS) -f makefile.dos flex.exe
  89.     -del scan.c
  90.     nmk -f makefile.dos flex.exe
  91.  
  92. parse.obj: parse.c parse.h
  93.  
  94. parse.h parse.c : parse.y
  95.     $(YACC) -d parse.y
  96.     @mv ytab.c parse.c
  97.     @mv ytab.h parse.h
  98.  
  99. scan.c : scan.l
  100.     $(FLEX) -ist8 $(FLEX_FLAGS) scan.l > scan.c
  101.  
  102. scan.obj : scan.c parse.h
  103.  
  104. main.obj : main.c
  105.     $(CC) -c $(CFLAGS) $(SKELFLAGS) main.c
  106.  
  107. ###################
  108. #
  109. # If you have MKS utilities, or other DIFFer
  110. test :
  111.     $(FLEX) -ist8 $(FLEX_FLAGS) scan.l > scan.tst
  112. # Use next line for Codeview
  113. #    cvexe /S /B /X $(FLEX) -ist8 $(FLEX_FLAGS) scan.l > scan.tst
  114.     diff -b scan.c scan.tst
  115. #    -del scan.tst
  116.  
  117.