home *** CD-ROM | disk | FTP | other *** search
- # Makefile for c skeletons
-
- # NOTE: The Microsoft C executables and Qparser utilities must be
- # accessible through the following definitions. CHANGE THEM to
- # suit your environment.
-
- CDIR=C:\MCC
- QPDIR=\QPARSER
- MODEL=L
-
- # ALSO NOTE: You need to compile and link the files in $(QPDIR)\LIB,
- # since the library file will be required by this make
-
- # USING THE MAKE FILE --
- # Rules are checked in the order in which they appear; if A depends
- # on B, then a rule for making B must appear ahead of the rule for
- # making A.
-
- # You can select any grammar file by changing 'calc' below to something
- # else.
- # OR -- you can call 'make' by redefining the macro GRM on the call line:
-
- # make GRM=gramfile m
-
- GRM=calc
-
- # COPTS provides compiler options -- the following provides for:
- # 1. the 'medium' model (large programs, stack and data, but no more
- # than 64K in any one array) (/AC),
- # 2. codeview debugging (/Zi, /Od),
- # 3. Qparser debugging (/DDEBUG)
- # 4. Qparser QTREES building (/DQTREES)
- # 5. Selection of 'IBM', rather than Unix (/DIBM)
- # 6. Selection of Microsoft C compiler
- # 7. Selection of C mode or not. Affects the lexical analyzer
- DEBUG=1
- QTREES=0
- COPTS=/A$(MODEL) /Zi /Od /DDEBUG=$(DEBUG) /DQTREES=$(QTREES) /DCMODE \
- /I$(QPDIR)\lib
-
- # LOPTS provides linker options -- we use:
- # 1. codeview debugging (/CO)
- # 2. extended stack size (/ST:20000)
- LOPTS=/CO /ST:20000 $(QPDIR)\lib\qp.lib
-
- # ------------------
- # The Make rules
-
- # Generate table file from grammar and optimize the table
- $(GRM).tbl: $(GRM).grm
- $(QPDIR)\lr1 $(GRM) $(GRM).rpt
- $(QPDIR)\opt $(GRM)
-
- # Generate source files from skeletons
- decl.h: $(GRM).tbl skeldecl.h
- $(QPDIR)\lr1p -mC $(GRM) skeldecl.h decl.h
-
- table.c: $(GRM).tbl skeltab.c
- $(QPDIR)\lr1p -mC $(GRM) skeltab.c table.c
-
- eval.c: $(GRM).tbl skeleval.c
- $(QPDIR)\lr1p -mC $(GRM) skeleval.c eval.c
-
- lex.c: $(GRM).tbl skellex.c
- $(QPDIR)\lr1p -mC $(GRM) skellex.c lex.c
-
- # Compile all files
- table.obj: decl.h table.c
- $(CDIR)\bin\cl /c $(COPTS) table.c
-
- debug.obj: decl.h debug.c
- $(CDIR)\bin\cl /c $(COPTS) debug.c
-
- eval.obj: decl.h eval.c
- $(CDIR)\bin\cl /c $(COPTS) eval.c
-
- lex.obj: decl.h lex.c
- $(CDIR)\bin\cl /c $(COPTS) lex.c
-
- main.obj: decl.h main.c
- $(CDIR)\bin\cl /c $(COPTS) main.c
-
- syms.obj: decl.h syms.c
- $(CDIR)\bin\cl /c $(COPTS) syms.c
-
- pars.obj: decl.h pars.c
- $(CDIR)\bin\cl /c $(COPTS) pars.c
-
- # Link object files into executable main.exe
- $(GRM).exe: main.obj lex.obj table.obj syms.obj \
- eval.obj debug.obj pars.obj
- $(CDIR)\bin\cl main lex table syms eval debug pars /link $(LOPTS)
-