pmfile 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209
  1. -- $Id$
  2. -- $Source$
  3. -- $State$
  4. include "first/c.pm"
  5. include "first/yacc.pm"
  6. include "first/llgen.pm"
  7. include "config.pm"
  8. include "first/ack.pm"
  9. include "first/ack-custom.pm"
  10. CINCLUDES = {
  11. ROOTDIR.."h",
  12. ROOTDIR.."modules/h",
  13. HEADERDIR,
  14. }
  15. -- Load the pmfiles for the various modules.
  16. include "util/data/pmfile"
  17. include "util/LLgen/pmfile-ack"
  18. include "modules/src/alloc/pmfile"
  19. include "modules/src/assert/pmfile"
  20. include "modules/src/system/pmfile"
  21. include "modules/src/string/pmfile"
  22. include "modules/src/read_em/pmfile"
  23. include "modules/src/em_code/pmfile"
  24. include "modules/src/em_mes/pmfile"
  25. include "modules/src/print/pmfile"
  26. include "modules/src/string/pmfile"
  27. include "modules/src/object/pmfile"
  28. include "modules/src/idf/pmfile"
  29. include "modules/src/print/pmfile"
  30. include "modules/src/input/pmfile"
  31. include "modules/src/flt_arith/pmfile"
  32. include "util/amisc/pmfile"
  33. include "util/cmisc/pmfile"
  34. include "util/ack/pmfile"
  35. include "util/arch/pmfile"
  36. include "util/cpp/pmfile"
  37. include "lang/cem/cpp.ansi/pmfile"
  38. include "util/cgg/pmfile"
  39. include "util/ncgg/pmfile"
  40. -- include "util/ceg/pmfile"
  41. include "util/misc/pmfile"
  42. include "util/opt/pmfile"
  43. include "util/ego/pmfile"
  44. include "util/topgen/pmfile"
  45. include "util/led/pmfile"
  46. include "lang/cem/pmfile"
  47. include "lang/pc/pmfile"
  48. include "lang/m2/pmfile"
  49. include "lang/occam/pmfile"
  50. include "lang/basic/pmfile"
  51. include "mach/proto/pmfile"
  52. include "mach/i386/pmfile"
  53. --[[
  54. include "mach/6500/pmfile"
  55. include "mach/6800/pmfile"
  56. include "mach/6805/pmfile"
  57. include "mach/6809/pmfile"
  58. include "mach/arm/pmfile"
  59. include "mach/i80/pmfile"
  60. include "mach/m68020/pmfile"
  61. include "mach/m68k2/pmfile"
  62. include "mach/m68k4/pmfile"
  63. include "mach/ns/pmfile"
  64. include "mach/pdp/pmfile"
  65. include "mach/s2650/pmfile"
  66. include "mach/vax4/pmfile"
  67. include "mach/z80/pmfile"
  68. include "mach/z8000/pmfile"
  69. --]]
  70. -- This is the list of language runtimes that is built for each architecture.
  71. lang_runtimes = group {
  72. lang_cem_runtime,
  73. lang_cem_ansi_runtime,
  74. lang_pc_runtime,
  75. lang_m2_runtime,
  76. lang_occam_runtime,
  77. lang_basic_runtime,
  78. }
  79. -- Include the platform descriptions.
  80. include "mach/i86/pmfile" -- generic i86
  81. include "plat/pc86/pmfile" -- PC standalone
  82. default = group {
  83. -- Lots of things use LLgen, so we need to build it first.
  84. tool_LLgen,
  85. -- Some of the dependency management across modules isn't entirely
  86. -- complete, for simplicity; as a result, the order here is important.
  87. -- In particular, referencing a library does not cause the library to
  88. -- be built, hence the reason why the modules must be built first. Also,
  89. -- some of these generate header files...
  90. module_em_data,
  91. module_system,
  92. module_alloc,
  93. module_assert,
  94. module_string,
  95. module_em_code,
  96. module_read_em,
  97. module_em_mes,
  98. module_print,
  99. module_object,
  100. module_idf,
  101. module_print,
  102. module_input,
  103. module_flt_arith,
  104. tool_tabgen,
  105. tool_aal,
  106. tool_ack,
  107. tool_cpp,
  108. tool_cpp_ansi,
  109. tool_cgg,
  110. tool_ncgg,
  111. -- tool_ceg,
  112. tool_em_decode,
  113. tool_em_encode,
  114. tool_esize,
  115. tool_opt,
  116. tool_ego,
  117. tool_topgen,
  118. tool_led,
  119. tool_anm,
  120. tool_ashow,
  121. tool_asize,
  122. tool_astrip,
  123. tool_aslod,
  124. lang_cem_compiler,
  125. lang_cem_ansi_compiler,
  126. lang_pc_compiler,
  127. lang_m2_compiler,
  128. lang_occam_compiler,
  129. lang_basic_compiler,
  130. -- Build the code generators and the architecture-independent
  131. -- libraries.
  132. --[[
  133. mach_6500,
  134. lang_runtimes { ARCH="6500", OPTIMISATION="-O" },
  135. mach_6800,
  136. mach_6805,
  137. mach_6809,
  138. mach_arm, lang_runtimes { ARCH="arm", OPTIMISATION="-O" },
  139. mach_i386, lang_runtimes { ARCH="i386", OPTIMISATION="-O" },
  140. mach_i80, lang_runtimes { ARCH="i80", OPTIMISATION="-O" },
  141. mach_m68020, lang_runtimes { ARCH="m68020", OPTIMISATION="-O" },
  142. -- mach_m68k2, lang_runtimes { ARCH="m68k2", OPTIMISATION="-O" },
  143. -- mach_m68k4, lang_runtimes { ARCH="m68k4", OPTIMISATION="-O" },
  144. mach_ns, lang_runtimes { ARCH="ns", OPTIMISATION="-O" },
  145. -- mach_pdp, lang_runtimes { ARCH="pdp", OPTIMISATION="-O" },
  146. mach_s2650,
  147. -- mach_vax4, lang_runtimes { ARCH="vax4", OPTIMISATION="-O" },
  148. mach_z80, lang_runtimes { ARCH="z80", OPTIMISATION="-O" },
  149. mach_z8000, lang_runtimes { ARCH="z8000", OPTIMISATION="-O" },
  150. --]]
  151. -- Build the platform-specific libraries.
  152. platform_pc86
  153. }
  154. -- Ensure that the work directories exist.
  155. posix.mkdir(TEMPDIR)
  156. posix.mkdir(HEADERDIR)
  157. -- Build the configuration headers, rather crudely. FIXME.
  158. configure = simple {
  159. outputs = {HEADERDIR.."local.h", HEADERDIR.."em_path.h"},
  160. command = "",
  161. __dobuild = function(self, inputs, outputs)
  162. -- Build 'local.h', rather crudely
  163. local f = io.open(HEADERDIR.."local.h", "w")
  164. f:write("#define VERSION 3\n") -- EM byte-code version
  165. f:write("#define ACKM \"", DEFAULT_ARCHITECTURE, "\"\n")
  166. f:write("#define BIGMACHINE 1\n") -- No, we don't have a 16-bit architecture
  167. f:write("#define SYS_5\n")
  168. f:close()
  169. -- Build 'em_path.h', rather crudely
  170. local f = io.open(HEADERDIR.."em_path.h", "w")
  171. f:write("#define TMP_DIR \"", ACK_TEMP_DIR, "\"\n")
  172. f:write("#define EM_DIR \"", PREFIX, "\"\n")
  173. f:write("#define ACK_PATH \"", PLATIND, "/descr\"\n")
  174. f:close()
  175. end
  176. }