pmfile 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239
  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 "modules/src/sbrk/pmfile"
  18. include "util/LLgen/pmfile-ack"
  19. include "modules/src/alloc/pmfile"
  20. include "modules/src/assert/pmfile"
  21. include "modules/src/system/pmfile"
  22. include "modules/src/string/pmfile"
  23. include "modules/src/read_em/pmfile"
  24. include "modules/src/em_code/pmfile"
  25. include "modules/src/em_mes/pmfile"
  26. include "modules/src/print/pmfile"
  27. include "modules/src/object/pmfile"
  28. include "modules/src/idf/pmfile"
  29. include "modules/src/input/pmfile"
  30. include "modules/src/flt_arith/pmfile"
  31. include "util/amisc/pmfile"
  32. include "util/cmisc/pmfile"
  33. include "util/ack/pmfile"
  34. include "util/arch/pmfile"
  35. include "util/cpp/pmfile"
  36. include "lang/cem/cpp.ansi/pmfile"
  37. include "util/cgg/pmfile"
  38. include "util/ncgg/pmfile"
  39. -- include "util/ceg/pmfile"
  40. include "util/misc/pmfile"
  41. include "util/opt/pmfile"
  42. include "util/ego/pmfile"
  43. include "util/topgen/pmfile"
  44. include "util/led/pmfile"
  45. include "lang/cem/pmfile"
  46. -- include "lang/pc/pmfile"
  47. -- include "lang/m2/pmfile"
  48. -- include "lang/occam/pmfile"
  49. -- include "lang/basic/pmfile"
  50. include "mach/proto/pmfile"
  51. --[[
  52. include "mach/i386/pmfile"
  53. include "mach/6500/pmfile"
  54. include "mach/6800/pmfile"
  55. include "mach/6805/pmfile"
  56. include "mach/6809/pmfile"
  57. include "mach/arm/pmfile"
  58. include "mach/i80/pmfile"
  59. include "mach/m68020/pmfile"
  60. include "mach/m68k2/pmfile"
  61. include "mach/m68k4/pmfile"
  62. include "mach/ns/pmfile"
  63. include "mach/pdp/pmfile"
  64. include "mach/s2650/pmfile"
  65. include "mach/vax4/pmfile"
  66. include "mach/z80/pmfile"
  67. include "mach/z8000/pmfile"
  68. --]]
  69. -- This is the list of language runtimes that is built for each architecture.
  70. lang_runtimes = group {
  71. -- lang_cem_runtime, -- K&R C (obsolete and useless)
  72. lang_cem_ansi_runtime, -- ANSI C
  73. -- lang_pc_runtime, -- Pascal
  74. -- lang_m2_runtime, -- Modula-2
  75. -- lang_occam_runtime, -- Occam 1 (obsolete and useless)
  76. -- lang_basic_runtime, -- Basic
  77. }
  78. -- Include the platform descriptions.
  79. include "mach/i86/pmfile" -- generic i86
  80. include "plat/pc86/pmfile" -- PC standalone
  81. include "mach/i386/pmfile" -- generic i386
  82. include "plat/linux386/pmfile" -- Linux executables
  83. include "mach/i80/pmfile" -- generic 8080
  84. include "plat/cpm/pmfile" -- CP/M
  85. include "mach/6500/pmfile" -- generic 6500
  86. include "plat/nes/pmfile" -- NES
  87. default = group {
  88. -- Lots of things use LLgen, so we need to build it first.
  89. -- Need it before anything else! (even LLgen depends on it)
  90. module_sbrk,
  91. tool_LLgen,
  92. -- Some of the dependency management across modules isn't entirely
  93. -- complete, for simplicity; as a result, the order here is important.
  94. -- In particular, referencing a library does not cause the library to
  95. -- be built, hence the reason why the modules must be built first. Also,
  96. -- some of these generate header files...
  97. module_em_data,
  98. module_system,
  99. module_alloc,
  100. module_assert,
  101. module_string,
  102. module_print,
  103. module_em_code,
  104. module_read_em,
  105. module_em_mes,
  106. module_object,
  107. module_idf,
  108. module_print,
  109. module_input,
  110. module_flt_arith,
  111. tool_tabgen,
  112. tool_aal,
  113. tool_ack,
  114. tool_cpp, -- K&R C
  115. tool_cpp_ansi, -- ANSI C
  116. tool_cgg,
  117. tool_ncgg,
  118. -- tool_ceg,
  119. tool_em_decode,
  120. tool_em_encode,
  121. tool_esize,
  122. tool_opt,
  123. tool_ego,
  124. tool_topgen,
  125. tool_led,
  126. tool_anm,
  127. tool_ashow,
  128. tool_asize,
  129. tool_astrip,
  130. tool_aslod,
  131. tool_aelflod,
  132. -- lang_cem_compiler,
  133. lang_cem_ansi_compiler,
  134. -- lang_pc_compiler,
  135. -- lang_m2_compiler,
  136. -- lang_occam_compiler,
  137. -- lang_basic_compiler,
  138. -- Build the code generators and the architecture-independent
  139. -- libraries.
  140. --[[
  141. mach_6500, lang_runtimes { ARCH="6500", OPTIMISATION="-O" },
  142. mach_6800,
  143. mach_6805,
  144. mach_6809,
  145. mach_arm, lang_runtimes { ARCH="arm", OPTIMISATION="-O" },
  146. mach_m68020, lang_runtimes { ARCH="m68020", OPTIMISATION="-O" },
  147. -- mach_m68k2, lang_runtimes { ARCH="m68k2", OPTIMISATION="-O" },
  148. -- mach_m68k4, lang_runtimes { ARCH="m68k4", OPTIMISATION="-O" },
  149. mach_ns, lang_runtimes { ARCH="ns", OPTIMISATION="-O" },
  150. -- mach_pdp, lang_runtimes { ARCH="pdp", OPTIMISATION="-O" },
  151. mach_s2650,
  152. -- mach_vax4, lang_runtimes { ARCH="vax4", OPTIMISATION="-O" },
  153. mach_z80, lang_runtimes { ARCH="z80", OPTIMISATION="-O" },
  154. mach_z8000, lang_runtimes { ARCH="z8000", OPTIMISATION="-O" },
  155. --]]
  156. -- Build the platforms.
  157. platform_pc86,
  158. -- platform_linux386,
  159. -- platform_cpm,
  160. -- platform_nes,
  161. }
  162. -- Ensure that the work directories exist.
  163. posix.mkdir(TEMPDIR)
  164. posix.mkdir(HEADERDIR)
  165. -- When doing the build, we want to ensure that the ACK looks in the staging
  166. -- area for its files, and not in the final installation directory (because
  167. -- we haven't been installed yet).
  168. posix.putenv("ACKDIR="..BINDIR)
  169. -- Build the configuration headers, rather crudely. FIXME.
  170. configure = simple {
  171. outputs = {HEADERDIR.."local.h", HEADERDIR.."em_path.h"},
  172. command = "",
  173. __dobuild = function(self, inputs, outputs)
  174. -- Build 'local.h', rather crudely
  175. local f = io.open(HEADERDIR.."local.h", "w")
  176. f:write("#define VERSION 3\n") -- EM byte-code version
  177. f:write("#define ACKM \"", DEFAULT_PLATFORM, "\"\n")
  178. f:write("#define BIGMACHINE 1\n") -- No, we don't have a 16-bit architecture
  179. f:write("#define SYS_5\n")
  180. f:close()
  181. -- Build 'em_path.h', rather crudely
  182. local f = io.open(HEADERDIR.."em_path.h", "w")
  183. f:write("#define TMP_DIR \"", ACK_TEMP_DIR, "\"\n")
  184. f:write("#define EM_DIR \"", PREFIX, "\"\n")
  185. f:write("#define ACK_PATH \"", PLATIND, "/descr\"\n")
  186. f:close()
  187. end
  188. }
  189. -- Once built, do the installation, rather crudely. FIXME.
  190. install = simple {
  191. outputs = {"dummy"},
  192. command = "",
  193. __dobuild = function(self, inputs, outputs)
  194. os.execute("mkdir -p "..PREFIX)
  195. os.execute("(cd "..BINDIR.." && tar chf - .) | (cd "..PREFIX.." && tar xvf -)")
  196. end
  197. }