home *** CD-ROM | disk | FTP | other *** search
/ The Education Master 1994 (4th Edition) / EDUCATIONS_MASTER_4TH_EDITION.bin / files / progmisc / qparser2 / cskels / m < prev    next >
Encoding:
Text File  |  1993-11-07  |  2.7 KB  |  94 lines

  1. #  Makefile for c skeletons
  2.  
  3. #  NOTE: The Microsoft C executables and Qparser utilities must be
  4. #  accessible through the following definitions.  CHANGE THEM to
  5. #  suit your environment.
  6.  
  7. CDIR=C:\MCC
  8. QPDIR=\QPARSER
  9. MODEL=L
  10.  
  11. #  ALSO NOTE:  You need to compile and link the files in $(QPDIR)\LIB,
  12. #    since the library file will be required by this make
  13.  
  14. # USING THE MAKE FILE --
  15. #   Rules are checked in the order in which they appear; if A depends
  16. #     on B, then a rule for making B must appear ahead of the rule for
  17. #     making A.
  18.  
  19. #   You can select any grammar file by changing 'calc' below to something
  20. #     else.
  21. #   OR -- you can call 'make' by redefining the macro GRM on the call line:
  22.  
  23. #       make GRM=gramfile m
  24.  
  25. GRM=calc
  26.  
  27. # COPTS provides compiler options -- the following provides for:
  28. #   1. the 'medium' model (large programs, stack and data, but no more
  29. #      than 64K in any one array) (/AC),
  30. #   2. codeview debugging (/Zi, /Od),
  31. #   3. Qparser debugging (/DDEBUG)
  32. #   4. Qparser QTREES building (/DQTREES)
  33. #   5. Selection of 'IBM', rather than Unix (/DIBM)
  34. #   6. Selection of Microsoft C compiler
  35. #   7. Selection of C mode or not.  Affects the lexical analyzer
  36. DEBUG=1
  37. QTREES=0
  38. COPTS=/A$(MODEL) /Zi /Od /DDEBUG=$(DEBUG) /DQTREES=$(QTREES) /DCMODE \
  39.   /I$(QPDIR)\lib
  40.  
  41. # LOPTS provides linker options -- we use:
  42. #   1. codeview debugging (/CO)
  43. #   2. extended stack size (/ST:20000)
  44. LOPTS=/CO /ST:20000 $(QPDIR)\lib\qp.lib
  45.  
  46. # ------------------
  47. # The Make rules
  48.  
  49. # Generate table file from grammar and optimize the table
  50. $(GRM).tbl: $(GRM).grm
  51.   $(QPDIR)\lr1 $(GRM)  $(GRM).rpt
  52.   $(QPDIR)\opt $(GRM)
  53.  
  54. # Generate source files from skeletons
  55. decl.h: $(GRM).tbl skeldecl.h
  56.   $(QPDIR)\lr1p -mC $(GRM) skeldecl.h  decl.h
  57.  
  58. table.c: $(GRM).tbl skeltab.c
  59.   $(QPDIR)\lr1p -mC $(GRM) skeltab.c  table.c
  60.  
  61. eval.c: $(GRM).tbl skeleval.c
  62.   $(QPDIR)\lr1p -mC $(GRM) skeleval.c  eval.c
  63.  
  64. lex.c: $(GRM).tbl skellex.c
  65.   $(QPDIR)\lr1p -mC $(GRM) skellex.c  lex.c
  66.  
  67. # Compile all files
  68. table.obj: decl.h table.c
  69.   $(CDIR)\bin\cl /c $(COPTS) table.c
  70.  
  71. debug.obj: decl.h  debug.c
  72.   $(CDIR)\bin\cl /c $(COPTS) debug.c
  73.  
  74. eval.obj: decl.h  eval.c
  75.   $(CDIR)\bin\cl /c $(COPTS) eval.c
  76.  
  77. lex.obj: decl.h  lex.c
  78.   $(CDIR)\bin\cl /c $(COPTS) lex.c
  79.  
  80. main.obj: decl.h  main.c
  81.   $(CDIR)\bin\cl /c $(COPTS) main.c
  82.  
  83. syms.obj: decl.h  syms.c
  84.   $(CDIR)\bin\cl /c $(COPTS) syms.c
  85.  
  86. pars.obj: decl.h pars.c
  87.   $(CDIR)\bin\cl /c $(COPTS) pars.c
  88.  
  89. # Link object files into executable main.exe
  90. $(GRM).exe: main.obj lex.obj table.obj syms.obj \
  91.     eval.obj debug.obj pars.obj
  92.   $(CDIR)\bin\cl main lex table syms eval debug pars /link $(LOPTS)
  93.  
  94.