1 Microsoft Visual C Stuff
\r
3 [Modified by Terence Parr (September 1995) to change .C to .cpp
\r]
5 [This file contains notes on MSVC for Windows NT console execs by Dave
\r
6 Seidel and an explanation of flags etc.. by John Hall; good luck,
\r
9 Date: Sat, 31 Dec 1994 11:40:36 -0500 (EST)
\r
10 From: David Seidel <75342.2034@compuserve.com>
\r
12 I've succesfully build 1.31b3 with djgpp for DOS and MSVC 2.0 for Windows
\r
13 NT. The only (minor) problem I had was that GNU make (version 3.71, in the
\r
14 djgpp port) complained about "multiple targets" in both the antlr and dlg
\r
15 makefiles. I got around the error by, in each makefile, commenting out the
\r
16 $(SRC) dependency, for example:
\r
18 antlr: $(OBJ) #$(SRC)
\r
20 I don't know why this is happenning, since you haven't changed that part of
\r
21 the makefile at all, and I think this used to work ok...
\r
23 Here are the makefiles I built from within the MSVC 2.0 environment for antlr
\r
24 and dlg and Windows NT console executables. Please feel free to pass them
\r
25 on. Of course, as soon as 1.31 "goes gold", I will send you nice new
\r
26 binaries. I'm not going to bother to keep doing both Borland and djgpp for
\r
27 DOS however. Instead, I'll just keep the djgpp version up to date and also
\r
28 provide WinNT binaries.
\r
32 ------ File antlr.mak: --------------
\r
34 # Microsoft Visual C++ Generated NMAKE File, Format Version 2.00
\r
37 # TARGTYPE "Win32 (x86) Console Application" 0x0103
\r
41 !MESSAGE No configuration specified. Defaulting to Win32 Debug.
\r
44 !IF "$(CFG)" != "Win32 Release" && "$(CFG)" != "Win32 Debug"
\r
45 !MESSAGE Invalid configuration "$(CFG)" specified.
\r
46 !MESSAGE You can specify a configuration when running NMAKE on this makefile
\r
47 !MESSAGE by defining the macro CFG on the command line. For example:
\r
49 !MESSAGE NMAKE /f "ANTLR.MAK" CFG="Win32 Debug"
\r
51 !MESSAGE Possible choices for configuration are:
\r
53 !MESSAGE "Win32 Release" (based on "Win32 (x86) Console Application")
\r
54 !MESSAGE "Win32 Debug" (based on "Win32 (x86) Console Application")
\r
56 !ERROR An invalid configuration is specified.
\r
59 ################################################################################
\r
61 # PROP Target_Last_Scanned "Win32 Release"
\r
65 !IF "$(CFG)" == "Win32 Release"
\r
67 # PROP BASE Use_MFC 0
\r
68 # PROP BASE Use_Debug_Libraries 0
\r
69 # PROP BASE Output_Dir "WinRel"
\r
70 # PROP BASE Intermediate_Dir "WinRel"
\r
72 # PROP Use_Debug_Libraries 0
\r
73 # PROP Output_Dir "WinRel"
\r
74 # PROP Intermediate_Dir "WinRel"
\r
78 ALL : $(OUTDIR)/ANTLR.exe $(OUTDIR)/ANTLR.bsc
\r
81 if not exist $(OUTDIR)/nul mkdir $(OUTDIR)
\r
83 # ADD BASE CPP /nologo /W3 /GX /YX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FR /c
\r
84 # ADD CPP /nologo /W2 /YX /O2 /I "..\h" /I "..\support\set" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "USER_ZZSYN" /D "PC" /c
\r
86 CPP_PROJ=/nologo /W2 /YX /O2 /I "..\h" /I "..\support\set" /D "WIN32" /D\
\r
87 "NDEBUG" /D "_CONSOLE" /D "USER_ZZSYN" /D "PC" /Fp$(OUTDIR)/"ANTLR.pch"\
\r
90 # ADD BASE RSC /l 0x409 /d "NDEBUG"
\r
91 # ADD RSC /l 0x409 /d "NDEBUG"
\r
95 # ADD BASE BSC32 /nologo
\r
97 BSC32_FLAGS=/nologo /o$(OUTDIR)/"ANTLR.bsc"
\r
99 $(OUTDIR)/ANTLR.bsc : $(OUTDIR) $(BSC32_SBRS)
\r
101 # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /NOLOGO /SUBSYSTEM:console /MACHINE:I386
\r
102 # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /NOLOGO /SUBSYSTEM:console /MACHINE:I386
\r
103 LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib\
\r
104 advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib\
\r
105 odbccp32.lib /NOLOGO /SUBSYSTEM:console /INCREMENTAL:no\
\r
106 /PDB:$(OUTDIR)/"ANTLR.pdb" /MACHINE:I386 /OUT:$(OUTDIR)/"ANTLR.exe"
\r
109 $(INTDIR)/HASH.OBJ \
\r
110 $(INTDIR)/MISC.OBJ \
\r
111 $(INTDIR)/BUILD.OBJ \
\r
112 $(INTDIR)/ANTLR.OBJ \
\r
113 $(INTDIR)/GLOBALS.OBJ \
\r
114 $(INTDIR)/PRED.OBJ \
\r
115 $(INTDIR)/FSET.OBJ \
\r
116 $(INTDIR)/FSET2.OBJ \
\r
117 $(INTDIR)/GEN.OBJ \
\r
118 $(INTDIR)/MAIN.OBJ \
\r
119 $(INTDIR)/SCAN.OBJ \
\r
120 $(INTDIR)/LEX.OBJ \
\r
121 $(INTDIR)/ERR.OBJ \
\r
122 $(INTDIR)/BITS.OBJ \
\r
125 $(OUTDIR)/ANTLR.exe : $(OUTDIR) $(DEF_FILE) $(LINK32_OBJS)
\r
127 $(LINK32_FLAGS) $(LINK32_OBJS)
\r
130 !ELSEIF "$(CFG)" == "Win32 Debug"
\r
132 # PROP BASE Use_MFC 0
\r
133 # PROP BASE Use_Debug_Libraries 1
\r
134 # PROP BASE Output_Dir "WinDebug"
\r
135 # PROP BASE Intermediate_Dir "WinDebug"
\r
137 # PROP Use_Debug_Libraries 1
\r
138 # PROP Output_Dir "WinDebug"
\r
139 # PROP Intermediate_Dir "WinDebug"
\r
143 ALL : $(OUTDIR)/ANTLR.exe $(OUTDIR)/ANTLR.bsc
\r
146 if not exist $(OUTDIR)/nul mkdir $(OUTDIR)
\r
148 # ADD BASE CPP /nologo /W3 /GX /Zi /YX /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /FR /c
\r
149 # ADD CPP /nologo /MD /W2 /Zi /YX /Od /I "..\h" /I "..\support\set" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "USER_ZZSYN" /D "PC" /c
\r
150 # SUBTRACT CPP /Gf /Fr
\r
151 CPP_PROJ=/nologo /MD /W2 /Zi /YX /Od /I "..\h" /I "..\support\set" /D "WIN32"\
\r
152 /D "_DEBUG" /D "_CONSOLE" /D "USER_ZZSYN" /D "PC" /Fp$(OUTDIR)/"ANTLR.pch"\
\r
153 /Fo$(INTDIR)/ /Fd$(OUTDIR)/"ANTLR.pdb" /c
\r
154 CPP_OBJS=.\WinDebug/
\r
155 # ADD BASE RSC /l 0x409 /d "_DEBUG"
\r
156 # ADD RSC /l 0x409 /d "_DEBUG"
\r
160 # ADD BASE BSC32 /nologo
\r
161 # ADD BSC32 /nologo
\r
162 BSC32_FLAGS=/nologo /o$(OUTDIR)/"ANTLR.bsc"
\r
164 $(OUTDIR)/ANTLR.bsc : $(OUTDIR) $(BSC32_SBRS)
\r
166 # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /NOLOGO /SUBSYSTEM:console /DEBUG /MACHINE:I386
\r
167 # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /NOLOGO /SUBSYSTEM:console /PDB:none /DEBUG /MACHINE:I386
\r
168 # SUBTRACT LINK32 /MAP
\r
169 LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib\
\r
170 advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib\
\r
171 odbccp32.lib /NOLOGO /SUBSYSTEM:console /PDB:none /DEBUG /MACHINE:I386\
\r
172 /OUT:$(OUTDIR)/"ANTLR.exe"
\r
175 $(INTDIR)/HASH.OBJ \
\r
176 $(INTDIR)/MISC.OBJ \
\r
177 $(INTDIR)/BUILD.OBJ \
\r
178 $(INTDIR)/ANTLR.OBJ \
\r
179 $(INTDIR)/GLOBALS.OBJ \
\r
180 $(INTDIR)/PRED.OBJ \
\r
181 $(INTDIR)/FSET.OBJ \
\r
182 $(INTDIR)/FSET2.OBJ \
\r
183 $(INTDIR)/GEN.OBJ \
\r
184 $(INTDIR)/MAIN.OBJ \
\r
185 $(INTDIR)/SCAN.OBJ \
\r
186 $(INTDIR)/LEX.OBJ \
\r
187 $(INTDIR)/ERR.OBJ \
\r
188 $(INTDIR)/BITS.OBJ \
\r
191 $(OUTDIR)/ANTLR.exe : $(OUTDIR) $(DEF_FILE) $(LINK32_OBJS)
\r
193 $(LINK32_FLAGS) $(LINK32_OBJS)
\r
198 .c{$(CPP_OBJS)}.obj:
\r
199 $(CPP) $(CPP_PROJ) $<
\r
201 .cpp{$(CPP_OBJS)}.obj:
\r
202 $(CPP) $(CPP_PROJ) $<
\r
204 .cxx{$(CPP_OBJS)}.obj:
\r
205 $(CPP) $(CPP_PROJ) $<
\r
207 ################################################################################
\r
208 # Begin Group "Source Files"
\r
210 ################################################################################
\r
211 # Begin Source File
\r
217 $(INTDIR)/HASH.OBJ : $(SOURCE) $(DEP_HASH_) $(INTDIR)
\r
220 ################################################################################
\r
221 # Begin Source File
\r
225 \PCCTS\SUPPORT\SET\SET.H\
\r
233 $(INTDIR)/MISC.OBJ : $(SOURCE) $(DEP_MISC_) $(INTDIR)
\r
236 ################################################################################
\r
237 # Begin Source File
\r
241 \PCCTS\SUPPORT\SET\SET.H\
\r
249 $(INTDIR)/BUILD.OBJ : $(SOURCE) $(DEP_BUILD) $(INTDIR)
\r
252 ################################################################################
\r
253 # Begin Source File
\r
257 \PCCTS\SUPPORT\SET\SET.H\
\r
268 $(INTDIR)/ANTLR.OBJ : $(SOURCE) $(DEP_ANTLR) $(INTDIR)
\r
271 ################################################################################
\r
272 # Begin Source File
\r
276 \PCCTS\SUPPORT\SET\SET.H\
\r
283 $(INTDIR)/GLOBALS.OBJ : $(SOURCE) $(DEP_GLOBA) $(INTDIR)
\r
286 ################################################################################
\r
287 # Begin Source File
\r
291 \PCCTS\SUPPORT\SET\SET.H\
\r
299 $(INTDIR)/PRED.OBJ : $(SOURCE) $(DEP_PRED_) $(INTDIR)
\r
302 ################################################################################
\r
303 # Begin Source File
\r
307 \PCCTS\SUPPORT\SET\SET.H\
\r
315 $(INTDIR)/FSET.OBJ : $(SOURCE) $(DEP_FSET_) $(INTDIR)
\r
318 ################################################################################
\r
319 # Begin Source File
\r
323 \PCCTS\SUPPORT\SET\SET.H\
\r
331 $(INTDIR)/FSET2.OBJ : $(SOURCE) $(DEP_FSET2) $(INTDIR)
\r
334 ################################################################################
\r
335 # Begin Source File
\r
339 \PCCTS\SUPPORT\SET\SET.H\
\r
347 $(INTDIR)/GEN.OBJ : $(SOURCE) $(DEP_GEN_C) $(INTDIR)
\r
350 ################################################################################
\r
351 # Begin Source File
\r
356 \PCCTS\SUPPORT\SET\SET.H\
\r
367 $(INTDIR)/MAIN.OBJ : $(SOURCE) $(DEP_MAIN_) $(INTDIR)
\r
370 ################################################################################
\r
371 # Begin Source File
\r
375 \PCCTS\SUPPORT\SET\SET.H\
\r
383 \PCCTS\H\DLGAUTO.H\
\r
387 $(INTDIR)/SCAN.OBJ : $(SOURCE) $(DEP_SCAN_) $(INTDIR)
\r
390 ################################################################################
\r
391 # Begin Source File
\r
395 \PCCTS\SUPPORT\SET\SET.H\
\r
402 $(INTDIR)/LEX.OBJ : $(SOURCE) $(DEP_LEX_C) $(INTDIR)
\r
405 ################################################################################
\r
406 # Begin Source File
\r
410 \PCCTS\SUPPORT\SET\SET.H\
\r
421 $(INTDIR)/ERR.OBJ : $(SOURCE) $(DEP_ERR_C) $(INTDIR)
\r
424 ################################################################################
\r
425 # Begin Source File
\r
429 \PCCTS\SUPPORT\SET\SET.H\
\r
437 $(INTDIR)/BITS.OBJ : $(SOURCE) $(DEP_BITS_) $(INTDIR)
\r
440 ################################################################################
\r
441 # Begin Source File
\r
443 SOURCE=\PCCTS\SUPPORT\SET\SET.C
\r
445 \PCCTS\SUPPORT\SET\SET.H\
\r
448 $(INTDIR)/SET.OBJ : $(SOURCE) $(DEP_SET_C) $(INTDIR)
\r
449 $(CPP) $(CPP_PROJ) $(SOURCE)
\r
454 ################################################################################
\r
455 ------ File dlg.mak: ----------------
\r
457 # Microsoft Visual C++ Generated NMAKE File, Format Version 2.00
\r
458 # ** DO NOT EDIT **
\r
460 # TARGTYPE "Win32 (x86) Console Application" 0x0103
\r
464 !MESSAGE No configuration specified. Defaulting to Win32 Debug.
\r
467 !IF "$(CFG)" != "Win32 Release" && "$(CFG)" != "Win32 Debug"
\r
468 !MESSAGE Invalid configuration "$(CFG)" specified.
\r
469 !MESSAGE You can specify a configuration when running NMAKE on this makefile
\r
470 !MESSAGE by defining the macro CFG on the command line. For example:
\r
472 !MESSAGE NMAKE /f "DLG.MAK" CFG="Win32 Debug"
\r
474 !MESSAGE Possible choices for configuration are:
\r
476 !MESSAGE "Win32 Release" (based on "Win32 (x86) Console Application")
\r
477 !MESSAGE "Win32 Debug" (based on "Win32 (x86) Console Application")
\r
479 !ERROR An invalid configuration is specified.
\r
482 ################################################################################
\r
484 # PROP Target_Last_Scanned "Win32 Debug"
\r
488 !IF "$(CFG)" == "Win32 Release"
\r
490 # PROP BASE Use_MFC 0
\r
491 # PROP BASE Use_Debug_Libraries 0
\r
492 # PROP BASE Output_Dir "WinRel"
\r
493 # PROP BASE Intermediate_Dir "WinRel"
\r
495 # PROP Use_Debug_Libraries 0
\r
496 # PROP Output_Dir "WinRel"
\r
497 # PROP Intermediate_Dir "WinRel"
\r
501 ALL : $(OUTDIR)/DLG.exe $(OUTDIR)/DLG.bsc
\r
504 if not exist $(OUTDIR)/nul mkdir $(OUTDIR)
\r
506 # ADD BASE CPP /nologo /W3 /GX /YX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FR /c
\r
507 # ADD CPP /nologo /W2 /YX /O2 /I "..\h" /I "..\support\set" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "USER_ZZSYN" /D "PC" /c
\r
509 CPP_PROJ=/nologo /W2 /YX /O2 /I "..\h" /I "..\support\set" /D "WIN32" /D\
\r
510 "NDEBUG" /D "_CONSOLE" /D "USER_ZZSYN" /D "PC" /Fp$(OUTDIR)/"DLG.pch"\
\r
513 # ADD BASE RSC /l 0x409 /d "NDEBUG"
\r
514 # ADD RSC /l 0x409 /d "NDEBUG"
\r
518 # ADD BASE BSC32 /nologo
\r
519 # ADD BSC32 /nologo
\r
520 BSC32_FLAGS=/nologo /o$(OUTDIR)/"DLG.bsc"
\r
522 $(OUTDIR)/DLG.bsc : $(OUTDIR) $(BSC32_SBRS)
\r
524 # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /NOLOGO /SUBSYSTEM:console /MACHINE:I386
\r
525 # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /NOLOGO /SUBSYSTEM:console /MACHINE:I386
\r
526 LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib\
\r
527 advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib\
\r
528 odbccp32.lib /NOLOGO /SUBSYSTEM:console /INCREMENTAL:no\
\r
529 /PDB:$(OUTDIR)/"DLG.pdb" /MACHINE:I386 /OUT:$(OUTDIR)/"DLG.exe"
\r
532 $(INTDIR)/SET.OBJ \
\r
533 $(INTDIR)/AUTOMATA.OBJ \
\r
534 $(INTDIR)/SUPPORT.OBJ \
\r
535 $(INTDIR)/DLG_P.OBJ \
\r
536 $(INTDIR)/ERR.OBJ \
\r
537 $(INTDIR)/MAIN.OBJ \
\r
538 $(INTDIR)/DLG_A.OBJ \
\r
539 $(INTDIR)/RELABEL.OBJ \
\r
540 $(INTDIR)/OUTPUT.OBJ
\r
542 $(OUTDIR)/DLG.exe : $(OUTDIR) $(DEF_FILE) $(LINK32_OBJS)
\r
544 $(LINK32_FLAGS) $(LINK32_OBJS)
\r
547 !ELSEIF "$(CFG)" == "Win32 Debug"
\r
549 # PROP BASE Use_MFC 0
\r
550 # PROP BASE Use_Debug_Libraries 1
\r
551 # PROP BASE Output_Dir "WinDebug"
\r
552 # PROP BASE Intermediate_Dir "WinDebug"
\r
554 # PROP Use_Debug_Libraries 1
\r
555 # PROP Output_Dir "WinDebug"
\r
556 # PROP Intermediate_Dir "WinDebug"
\r
560 ALL : $(OUTDIR)/DLG.exe $(OUTDIR)/DLG.bsc
\r
563 if not exist $(OUTDIR)/nul mkdir $(OUTDIR)
\r
565 # ADD BASE CPP /nologo /W3 /GX /Zi /YX /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /FR /c
\r
566 # ADD CPP /nologo /MD /W2 /Zi /YX /Od /I "..\h" /I "..\support\set" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "USER_ZZSYN" /D "PC" /c
\r
568 CPP_PROJ=/nologo /MD /W2 /Zi /YX /Od /I "..\h" /I "..\support\set" /D "WIN32"\
\r
569 /D "_DEBUG" /D "_CONSOLE" /D "USER_ZZSYN" /D "PC" /Fp$(OUTDIR)/"DLG.pch"\
\r
570 /Fo$(INTDIR)/ /Fd$(OUTDIR)/"DLG.pdb" /c
\r
571 CPP_OBJS=.\WinDebug/
\r
572 # ADD BASE RSC /l 0x409 /d "_DEBUG"
\r
573 # ADD RSC /l 0x409 /d "_DEBUG"
\r
577 # ADD BASE BSC32 /nologo
\r
578 # ADD BSC32 /nologo
\r
579 BSC32_FLAGS=/nologo /o$(OUTDIR)/"DLG.bsc"
\r
581 $(OUTDIR)/DLG.bsc : $(OUTDIR) $(BSC32_SBRS)
\r
583 # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /NOLOGO /SUBSYSTEM:console /DEBUG /MACHINE:I386
\r
584 # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /NOLOGO /SUBSYSTEM:console /PDB:none /DEBUG /MACHINE:I386
\r
585 LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib\
\r
586 advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib\
\r
587 odbccp32.lib /NOLOGO /SUBSYSTEM:console /PDB:none /DEBUG /MACHINE:I386\
\r
588 /OUT:$(OUTDIR)/"DLG.exe"
\r
591 $(INTDIR)/SET.OBJ \
\r
592 $(INTDIR)/AUTOMATA.OBJ \
\r
593 $(INTDIR)/SUPPORT.OBJ \
\r
594 $(INTDIR)/DLG_P.OBJ \
\r
595 $(INTDIR)/ERR.OBJ \
\r
596 $(INTDIR)/MAIN.OBJ \
\r
597 $(INTDIR)/DLG_A.OBJ \
\r
598 $(INTDIR)/RELABEL.OBJ \
\r
599 $(INTDIR)/OUTPUT.OBJ
\r
601 $(OUTDIR)/DLG.exe : $(OUTDIR) $(DEF_FILE) $(LINK32_OBJS)
\r
603 $(LINK32_FLAGS) $(LINK32_OBJS)
\r
608 .c{$(CPP_OBJS)}.obj:
\r
609 $(CPP) $(CPP_PROJ) $<
\r
611 .cpp{$(CPP_OBJS)}.obj:
\r
612 $(CPP) $(CPP_PROJ) $<
\r
614 .cxx{$(CPP_OBJS)}.obj:
\r
615 $(CPP) $(CPP_PROJ) $<
\r
617 ################################################################################
\r
618 # Begin Group "Source Files"
\r
620 ################################################################################
\r
621 # Begin Source File
\r
623 SOURCE=\PCCTS\SUPPORT\SET\SET.C
\r
625 $(INTDIR)/SET.OBJ : $(SOURCE) $(INTDIR)
\r
626 $(CPP) $(CPP_PROJ) $(SOURCE)
\r
629 ################################################################################
\r
630 # Begin Source File
\r
632 SOURCE=.\AUTOMATA.C
\r
635 \PCCTS\SUPPORT\SET\SET.H\
\r
638 $(INTDIR)/AUTOMATA.OBJ : $(SOURCE) $(DEP_AUTOM) $(INTDIR)
\r
641 ################################################################################
\r
642 # Begin Source File
\r
647 \PCCTS\SUPPORT\SET\SET.H\
\r
650 $(INTDIR)/SUPPORT.OBJ : $(SOURCE) $(DEP_SUPPO) $(INTDIR)
\r
653 ################################################################################
\r
654 # Begin Source File
\r
663 \PCCTS\SUPPORT\SET\SET.H\
\r
666 $(INTDIR)/DLG_P.OBJ : $(SOURCE) $(DEP_DLG_P) $(INTDIR)
\r
669 ################################################################################
\r
670 # Begin Source File
\r
679 \PCCTS\SUPPORT\SET\SET.H\
\r
682 $(INTDIR)/ERR.OBJ : $(SOURCE) $(DEP_ERR_C) $(INTDIR)
\r
685 ################################################################################
\r
686 # Begin Source File
\r
696 \PCCTS\SUPPORT\SET\SET.H\
\r
699 $(INTDIR)/MAIN.OBJ : $(SOURCE) $(DEP_MAIN_) $(INTDIR)
\r
702 ################################################################################
\r
703 # Begin Source File
\r
712 \PCCTS\H\DLGAUTO.H\
\r
713 \PCCTS\SUPPORT\SET\SET.H\
\r
716 $(INTDIR)/DLG_A.OBJ : $(SOURCE) $(DEP_DLG_A) $(INTDIR)
\r
719 ################################################################################
\r
720 # Begin Source File
\r
725 \PCCTS\SUPPORT\SET\SET.H\
\r
728 $(INTDIR)/RELABEL.OBJ : $(SOURCE) $(DEP_RELAB) $(INTDIR)
\r
731 ################################################################################
\r
732 # Begin Source File
\r
737 \PCCTS\SUPPORT\SET\SET.H\
\r
740 $(INTDIR)/OUTPUT.OBJ : $(SOURCE) $(DEP_OUTPU) $(INTDIR)
\r
745 ################################################################################
\r
746 -------------------------------------
\r
748 How to port PCCTS 1.10 (and 1.32 hopefully) to Visual C++
\r
752 John Hall <jhall@ivy.wpi.edu>
\r
754 Here is how to compile an ANTLR grammar in Visual C++. These steps
\r
755 describe how to have your ANTLR grammar parse the input file the user
\r
756 selects when they choose File Open in your Windows application. (Even
\r
757 if you aren't using Visual C++, the steps should be portable enough to
\r
760 * Make sure that ANTLR and DLG generate ANSI code (use the -ga
\r
763 * Set the following compiler flags in Visual C++ (these are in the
\r
764 Memory Model category of the compiler options in the Project
\r
768 ==== ==============================================================
\r
769 /AL Large memory model (multiple data segments; data items must be
\r
772 /Gtn Allocates all items whose size is greater than or equal to n
\r
773 in a new data segment. (I let n be 256: /Gt256.)
\r
775 /Gx- All references to data items are done with far addressing in
\r
776 case they are placed in a far segment.
\r
778 * Add the following member variable to the attributes section of your
\r
779 derived CDocument class (you will need to make sure you also
\r
784 * Add the following method to your derived CDocument class:
\r
786 BOOL CAppDoc::OnOpenDocument(const char* pszPathName)
\r
788 // Call CDocument's OnOpenDocument to do housekeeping for us
\r
789 // DON'T add anything to the loading section of Serialize
\r
790 if (!CDocument::OnOpenDocument(pszPathName))
\r
794 if ((fp = fopen(pszPathName, "r")) == NULL)
\r
797 // Parse input file
\r
798 ANTLR(start(), fp);
\r
800 // Close input file
\r
805 (Note: additional code may be necessary, depending on your parser.
\r
806 For example, if your parser uses PCCTS's symbol table library, you
\r
807 will need to insert calls to zzs_init and zzs_done.)
\r
809 * Compile the generated C files as C++ files. (I renamed the files
\r
810 to have a .CPP extension to fool Visual C++ into thinking they were
\r
811 C++ files. One might also use the /Tp switch, but that switch
\r
812 requires you separately include the filename.) [I used this step
\r
813 as an easy out for all the external linking errors I was getting
\r
814 that I couldn't fix by declaring things extern "C".]
\r
816 * Make sure the __STDC__ portion of the generated files gets
\r
817 compiled. (Either define __STDC__ yourself or else change all
\r
818 occurrences of __STDC__ to __cplusplus in the generated files. You
\r
819 can define __STDC__ in the Preprocessor category of the compiler
\r
822 That last step is important for Visual C++, but may not apply to other
\r
823 compilers. For C++ compilers, whether __STDC__ is defined is
\r
824 implementation dependent (ARM, page 379). Apparently, Visual C++ does
\r
825 not to define it; it also does not support "old style" C function
\r
826 definitions (which is okay, according to page 404 of the ARM). Those
\r
827 two things together caused problems when trying to port the code.
\r
832 globals(AST **_root)
\r
838 it skipped the __STDC__ section and tried to process the "old style"
\r
839 function definition, where it choked.
\r
841 When you finally get your parser to compile and link without error,
\r
842 you may get General Protection Fault errors at run time. The problem
\r
843 I had was that a NULL was passed to a variable argument function
\r
844 without an explicit cast. The function grabbed a pointer (32-bits)
\r
845 off the stack using va_arg, but the NULL was passed silently as the
\r
846 integer 0 (16 bits), making the resulting pointer was invalid. (This
\r
847 was in PCCTS's sample C parser.)
\r
849 There is one other thing I might suggest to help you avoid a run-time
\r
850 error. Make sure you redefine the default error reporting function,
\r
851 zzsyn. To do this, put "#define USER_ZZSYN" in your #header section
\r
852 and put your own zzsyn somewhere. You can then pop up a MessageBox or
\r
853 print the error to some output window.
\r