home *** CD-ROM | disk | FTP | other *** search
/ AI Game Programming Wisdom / AIGameProgrammingWisdom.iso / SourceCode / 10 Scripting / 02 Berger / scc / Makefile < prev    next >
Encoding:
Makefile  |  2001-10-16  |  2.3 KB  |  91 lines

  1. # All compiler and linker generated files will be written to this directory.
  2. OUTDIR=Debug
  3.  
  4. # Specify all of the object files that are needed to build this executable.
  5. OBJS= \
  6.     $(OUTDIR)\scc.obj \
  7.     $(OUTDIR)\scc-lexer.obj \
  8.     $(OUTDIR)\scc-parser.obj \
  9.     $(OUTDIR)\CodeGen.obj \
  10.     $(OUTDIR)\PTNode.obj \
  11.     $(OUTDIR)\SmartPtr.obj
  12.  
  13. # Define the name of the compiler and its command-line arguments.
  14. CPP=cl
  15. CPP_FLAGS=/nologo /MLd /WX /GX /Zi /Od /I. /Fo$(OUTDIR)\ /Fd$(OUTDIR)\scc.pdb /FD /GZ /c
  16.  
  17. # Define the name of the linker and its command-line arguments.
  18. LINK=link
  19. LINK_FLAGS=/nologo /incremental:no /pdb:$(OUTDIR)\scc.pdb /debug /out:$(OUTDIR)\scc.exe
  20.  
  21.  
  22. # This is the main target of the Makefile.  It builds everything.
  23. all : scc-parser.h scc-parser.cpp scc-lexer.cpp $(OUTDIR)\scc.exe
  24.  
  25.  
  26. # This target deletes all of the generated files.
  27. clean :
  28.     -@erase $(OBJS)
  29.     -@erase $(OUTDIR)\scc.exe
  30.     -@erase $(OUTDIR)\scc.ilk
  31.     -@erase $(OUTDIR)\scc.pdb
  32.     -@erase $(OUTDIR)\scc.idb
  33.     -@erase scc-lexer.cpp
  34.     -@erase scc-parser.cpp
  35.     -@erase scc-parser.h
  36.  
  37.  
  38. # This next target creates the output directory, if needed.
  39. !IF "$(OS)" == "Windows_NT"
  40. NULL=
  41. !ELSE
  42. NULL=nul
  43. !ENDIF
  44.  
  45. $(OUTDIR) :
  46.     if not exist $(OUTDIR)/$(NULL) mkdir $(OUTDIR)
  47.  
  48.  
  49. # This target actually builds the executable.
  50. $(OUTDIR)\scc.exe : $(OUTDIR) $(OBJS)
  51.     $(LINK) $(LINK_FLAGS) $(OBJS)
  52.  
  53.  
  54. ################################################################
  55. # These rules define how to build the C++ source files from the Flex and Bison
  56. # source files.  Note that we have to do a little file renaming magic with
  57. # Bison to get the auto-generated header file the way we like it.
  58.  
  59. scc-lexer.cpp : scc-lexer.l $(OUTDIR)
  60.     flex -oscc-lexer.cpp scc-lexer.l
  61.  
  62. scc-parser.cpp scc-parser.h : scc-parser.y $(OUTDIR)
  63.     -@erase scc-parser.h
  64.     bison -d -oscc-parser.cpp scc-parser.y
  65.     -@rename scc-parser.cpp.h scc-parser.h
  66.  
  67.  
  68. ################################################################
  69. # These rules specify all of the file dependencies.
  70.  
  71. .cpp{$(OUTDIR)}.obj::
  72.    $(CPP) $(CPP_FLAGS) $<
  73.  
  74. CodeGen.H : Opcode.H PTNode.H
  75.  
  76. CodeGen.cpp : SCC.H CodeGen.H PTNode.H
  77.  
  78. PTNode.H : SmartPtr.H
  79.  
  80. PTNode.cpp : PTNode.H
  81.  
  82. SCC.H : PTNode.H
  83.  
  84. SCC.cpp : SCC.H
  85.  
  86. SmartPtr.cpp : SmartPtr.H
  87.  
  88. scc-lexer.l : SCC.H PTNode.H scc-parser.h
  89.  
  90. scc-parser.y : SCC.H PTNode.H CodeGen.H
  91.