pmfile 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169
  1. -- $Source$
  2. -- $State$
  3. local d = ROOTDIR.."lang/pc/comp/"
  4. local extract_parameters = simple {
  5. outputs = {
  6. "%U%/debugcst.h",
  7. "%U%/density.h",
  8. "%U%/errout.h",
  9. "%U%/idfsize.h",
  10. "%U%/inputtype.h",
  11. "%U%/numsize.h",
  12. "%U%/strsize.h",
  13. "%U%/target_sizes.h",
  14. "%U%/nocross.h",
  15. "%U%/dbsymtab.h",
  16. },
  17. command = {
  18. "cd %out[1]:dirname% && %in[1]% %in[2]%"
  19. },
  20. file (d.."make.hfiles"),
  21. file (d.."Parameters")
  22. }
  23. local lpars = LLgen {
  24. simple {
  25. outputs = {"%U%/tokenfile.g"},
  26. command = {
  27. "%in[1]% < %in[2]% > %out[1]%"
  28. },
  29. file (d.."make.tokfile"),
  30. file (d.."tokenname.c")
  31. },
  32. file (d.."program.g"),
  33. file (d.."declar.g"),
  34. file (d.."expression.g"),
  35. file (d.."statement.g"),
  36. }
  37. local allocd_header = simple {
  38. class = "allocd_header",
  39. command = {
  40. "%in[1]% < %in[2]% > %out[1]%"
  41. },
  42. file (d.."make.allocd")
  43. }
  44. local cfile_with_headers = cfile {
  45. class = "cfile_with_headers",
  46. dynamicheaders = {
  47. file (d),
  48. extract_parameters,
  49. allocd_header { outputs = {"%U%/def.h"}, (d.."def.H") },
  50. allocd_header { outputs = {"%U%/type.h"}, (d.."type.H") },
  51. allocd_header { outputs = {"%U%/scope.h"}, (d.."scope.H") },
  52. allocd_header { outputs = {"%U%/node.h"}, (d.."node.H") },
  53. allocd_header { outputs = {"%U%/desig.h"}, (d.."desig.H") },
  54. lpars
  55. }
  56. }
  57. lang_pc_compiler = cprogram {
  58. CDEFINES = {PARENT, "STATIC=static"},
  59. cfile_with_headers (d.."LLlex.c"),
  60. cfile_with_headers (d.."LLmessage.c"),
  61. cfile_with_headers (d.."body.c"),
  62. cfile_with_headers (d.."chk_expr.c"),
  63. cfile_with_headers (d.."code.c"),
  64. cfile_with_headers (d.."cstoper.c"),
  65. cfile_with_headers (d.."def.c"),
  66. cfile_with_headers (d.."desig.c"),
  67. cfile_with_headers (d.."enter.c"),
  68. cfile_with_headers (d.."error.c"),
  69. cfile_with_headers (d.."idf.c"),
  70. cfile_with_headers (d.."input.c"),
  71. cfile_with_headers (d.."label.c"),
  72. cfile_with_headers (d.."lookup.c"),
  73. cfile_with_headers (d.."main.c"),
  74. cfile_with_headers (d.."misc.c"),
  75. cfile_with_headers (d.."node.c"),
  76. cfile_with_headers (d.."options.c"),
  77. cfile_with_headers (d.."progs.c"),
  78. cfile_with_headers (d.."readwrite.c"),
  79. cfile_with_headers (d.."scope.c"),
  80. cfile_with_headers (d.."stab.c"),
  81. cfile_with_headers (d.."tokenname.c"),
  82. cfile_with_headers (d.."type.c"),
  83. cfile_with_headers (d.."typequiv.c"),
  84. foreach {
  85. rule = cfile_with_headers,
  86. ith { lpars, from=2 }
  87. },
  88. cfile_with_headers {
  89. simple {
  90. outputs = {"%U%-symbol2str.c"},
  91. command = {
  92. "%in[1]% < %in[2]% > %out[1]%"
  93. },
  94. file (d.."make.tokcase"),
  95. file (d.."tokenname.c")
  96. }
  97. },
  98. cfile_with_headers {
  99. CINCLUDES = {PARENT, d},
  100. tabgen (d.."char.tab")
  101. },
  102. cfile_with_headers {
  103. simple {
  104. outputs = {"%U%-next.c"},
  105. command = {
  106. "%in% > %out%"
  107. },
  108. file (d.."make.next"),
  109. file (d.."def.H"),
  110. file (d.."type.H"),
  111. file (d.."node.H"),
  112. file (d.."scope.H"),
  113. file (d.."desig.H"),
  114. file (d.."tmpvar.C"),
  115. file (d.."casestat.C"),
  116. }
  117. },
  118. cfile_with_headers {
  119. allocd_header { outputs = {"%U%-tmpvar.c"}, (d.."tmpvar.C") }
  120. },
  121. cfile_with_headers {
  122. allocd_header { outputs = {"%U%-casestat.c"}, (d.."casestat.C") }
  123. },
  124. lib_em_mes,
  125. lib_emk,
  126. lib_em_data,
  127. lib_input,
  128. lib_assert,
  129. lib_alloc,
  130. lib_flt_arith,
  131. lib_print,
  132. lib_string,
  133. lib_system,
  134. outputs = {"%U%/em_pc"},
  135. install = {
  136. pm.install( "%BINDIR%%PLATDEP%/em_pc"),
  137. pm.install(d.."em_pc.6", "%BINDIR%/man/man6/em_pc.6"),
  138. }
  139. }
  140. -- Revision history
  141. -- $Log$
  142. -- Revision 1.2 2006-10-15 00:28:11 dtrg
  143. -- Updated to the version 0.1 of Prime Mover (which involves some syntax changes).
  144. --
  145. -- Revision 1.1 2006/07/22 21:03:07 dtrg
  146. -- Added support for the Pascal compiler.
  147. --