home *** CD-ROM | disk | FTP | other *** search
/ ftp.ee.pdx.edu / 2014.02.ftp.ee.pdx.edu.tar / ftp.ee.pdx.edu / pub / users / Harry / Blitz / BlitzSrc / makefile < prev    next >
Makefile  |  2008-10-01  |  4KB  |  158 lines

  1. #
  2. # makefile for all BLITZ tools
  3. #
  4. # Harry Porter - 5 September 2007
  5. #
  6. # To compile all the Blitz Tools, type 'make' with this 'makefile' file in a
  7. # directory containing the source files for all the Blitz.  The Unix "make"
  8. # utility will execute all the necessary compiles as needed, based
  9. # on files' most-recent-update times.
  10. #
  11. # Here is a list of the executables that should be produced:
  12. #
  13. #    asm
  14. #    dumpObj
  15. #    lddd
  16. #    blitz
  17. #    kpl
  18. #    diskUtil
  19. #    check
  20. #    endian
  21. #    hexdump
  22. #########################################################################
  23. #
  24. # The following options are used when compiling for Intel-based systems.
  25. #
  26. # These work for the following systems.  For these, no change is
  27. # necessary.  For other systems, this file must be edited; read on.
  28. #
  29. #   Apple Mac with Intel Processors
  30. #
  31. #   Windows (using Cygwin, see www.cygwin.com).
  32. #
  33. #   Debian/Ubuntu Linux 2.6.20; i686; using GCC 4.1.2, although warnings
  34. #   about multi-byte character constants get displayed.
  35. #
  36. #   FreeBSD 5.5 on Intel hardware.
  37. #
  38. #   Ubuntu 7.04, with the multi-char warnings.
  39. #
  40. #   cc (GCC) 4.0.3 (Ubuntu 4.0.3-1ubuntu5), with the multi-char warnings.
  41. #
  42. CC=cc
  43. CFLAGS=-g -lm -DBLITZ_HOST_IS_LITTLE_ENDIAN
  44. CPLUSPLUS=g++
  45. CPLUSPLUSFLAGS=-g -DBLITZ_HOST_IS_LITTLE_ENDIAN
  46. LINKFLAGS=
  47. #
  48. #########################################################################
  49. #
  50. # For 64-bit machines, you may need to add the "-m32" option.  This will
  51. # force gcc to use 32-bits for "int", "long", and pointer types.
  52. #    CFLAGS= ... -m32
  53. #    ...
  54. #    CPLUSPLUSFLAGS= ... -m32
  55. #
  56. # The "-m32" option may solve errors like the following:
  57. #    warning: cast from pointer to integer of different size
  58. #
  59. #########################################################################
  60. #
  61. # Uncomment and use the following options when compiling for Sun/Solaris:
  62. #
  63. #CC=gcc
  64. #CFLAGS=-g -lm
  65. #CPLUSPLUS=g++
  66. #CPLUSPLUSFLAGS=-g
  67. #LINKFLAGS=
  68. #
  69. #########################################################################
  70. #
  71. # Uncomment and use the following options for a PPC-based MAC.
  72. #
  73. # NOTE: If compiled this way, the tools should still run on
  74. #   an Intel-based MAC, but will run at least 2.3 times slower.
  75. #   The "-arch ppc" flag is only needed when compiling for the MAC on
  76. #   Intel-based machine.
  77. #
  78. # For MAC OS-X, the default stack size may be inadequate for the amount of
  79. #   recursion in larger runs of the KPL compiler, since it recurses
  80. #   in proportion to the depth of the abstract syntax tree.  This is the reason
  81. #   for the "-Xlinker -stack_size -Xlinker MMM -Xlinker -stack_addr -Xlinker NNN"
  82. #   options.  The -Xlinker option passes the next thing through to the linker, so
  83. #   the linker ends up seeing "-stack_size MMM -stack_addr NNN".  In the past, 
  84. #   these were necessary; they may still be required on some machines.
  85. #
  86. #CC=cc
  87. #CFLAGS=-g -lm -arch ppc
  88. #CPLUSPLUS=g++
  89. #CPLUSPLUSFLAGS=-g -arch ppc
  90. #LINKFLAGS=    -Xlinker -stack_size\
  91. #        -Xlinker 4000000\
  92. #        -Xlinker -stack_addr\
  93. #        -Xlinker c0000000
  94. #
  95. #########################################################################
  96.  
  97.  
  98.  
  99. all: asm dumpObj lddd blitz diskUtil hexdump check endian kpl
  100.  
  101. asm: asm.c
  102.     $(CC) $(CFLAGS) asm.c -o asm
  103.  
  104. lddd: lddd.c
  105.     $(CC) $(CFLAGS) lddd.c -o lddd
  106.  
  107. blitz: blitz.c
  108.     $(CC) $(CFLAGS) blitz.c -o blitz
  109.  
  110. dumpObj: dumpObj.c
  111.     $(CC) $(CFLAGS) dumpObj.c -o dumpObj
  112.  
  113. diskUtil: diskUtil.c
  114.     $(CC) $(CFLAGS) diskUtil.c -o diskUtil
  115.  
  116. hexdump: hexdump.c
  117.     $(CC) $(CFLAGS) hexdump.c -o hexdump
  118.  
  119. check: check.c
  120.     $(CC) $(CFLAGS) check.c -o check
  121.  
  122. endian: endian.c
  123.     $(CC) $(CFLAGS) endian.c -o endian
  124.  
  125. kpl:    main.o lexer.o ast.o printAst.o parser.o mapping.o check.o ir.o gen.o
  126.     $(CPLUSPLUS) $(CPLUSPLUSFLAGS) $(LINKFLAGS)\
  127.         main.o lexer.o ast.o printAst.o parser.o\
  128.         mapping.o check.o ir.o  gen.o -o kpl
  129.  
  130. main.o: main.cc main.h ast.h ir.h
  131.     $(CPLUSPLUS) $(CPLUSPLUSFLAGS) -c main.cc
  132.  
  133. lexer.o: lexer.cc main.h ast.h
  134.     $(CPLUSPLUS) $(CPLUSPLUSFLAGS) -c lexer.cc
  135.  
  136. ast.o: ast.cc main.h ast.h
  137.     $(CPLUSPLUS) $(CPLUSPLUSFLAGS) -c ast.cc
  138.  
  139. printAst.o: printAst.cc main.h ast.h
  140.     $(CPLUSPLUS) $(CPLUSPLUSFLAGS) -c printAst.cc
  141.  
  142. parser.o: parser.cc main.h ast.h
  143.     $(CPLUSPLUS) $(CPLUSPLUSFLAGS) -c parser.cc
  144.  
  145. mapping.o: mapping.cc main.h ast.h
  146.     $(CPLUSPLUS) $(CPLUSPLUSFLAGS) -c mapping.cc
  147.  
  148. check.o: check.cc main.h ast.h
  149.     $(CPLUSPLUS) $(CPLUSPLUSFLAGS) -c check.cc
  150.  
  151. ir.o: ir.cc main.h ast.h ir.h
  152.     $(CPLUSPLUS) $(CPLUSPLUSFLAGS) -c ir.cc
  153.  
  154. gen.o: gen.cc main.h ast.h ir.h
  155.     $(CPLUSPLUS) $(CPLUSPLUSFLAGS) -c gen.cc
  156.  
  157.