pmfile 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209
  1. -- $Source$
  2. -- $State$
  3. local d = ROOTDIR.."lang/cem/cemcom/"
  4. local extract_parameters = simple {
  5. outputs = {
  6. "%U%/lint.h",
  7. "%U%/pathlength.h",
  8. "%U%/errout.h",
  9. "%U%/idfsize.h",
  10. "%U%/numsize.h",
  11. "%U%/nparams.h",
  12. "%U%/ifdepth.h",
  13. "%U%/density.h",
  14. "%U%/lapbuf.h",
  15. "%U%/strsize.h",
  16. "%U%/target_sizes.h",
  17. "%U%/botch_free.h",
  18. "%U%/dataflow.h",
  19. "%U%/debug.h",
  20. "%U%/use_tmp.h",
  21. "%U%/parbufsize.h",
  22. "%U%/textsize.h",
  23. "%U%/inputtype.h",
  24. "%U%/nopp.h",
  25. "%U%/nobitfield.h",
  26. "%U%/spec_arith.h",
  27. "%U%/static.h",
  28. "%U%/nofloat.h",
  29. "%U%/noRoption.h",
  30. "%U%/nocross.h",
  31. "%U%/regcount.h",
  32. "%U%/dbsymtab.h",
  33. },
  34. command = {
  35. "cd %out[1]:dirname% && %in[1]% %in[2]%"
  36. },
  37. file (d.."make.hfiles"),
  38. file (d.."BigPars")
  39. }
  40. local lpars = LLgen {
  41. simple {
  42. outputs = {"%U%/tokenfile.g"},
  43. command = {
  44. "%in[1]% < %in[2]% > %out[1]%"
  45. },
  46. file (d.."make.tokfile"),
  47. file (d.."tokenname.c")
  48. },
  49. file (d.."program.g"),
  50. file (d.."declar.g"),
  51. file (d.."expression.g"),
  52. file (d.."statement.g"),
  53. file (d.."ival.g"),
  54. }
  55. local allocd_header = simple {
  56. class = "allocd_header",
  57. command = {
  58. "%in[1]% < %in[2]% > %out[1]%"
  59. },
  60. file (d.."make.allocd")
  61. }
  62. local cfile_with_headers = cfile {
  63. class = "cfile_with_headers",
  64. dynamicheaders = {
  65. file (d),
  66. extract_parameters,
  67. allocd_header { outputs = {"%U%/code.h"}, (d.."code.str") },
  68. allocd_header { outputs = {"%U%/declar.h"}, (d.."declar.str") },
  69. allocd_header { outputs = {"%U%/def.h"}, (d.."def.str") },
  70. allocd_header { outputs = {"%U%/expr.h"}, (d.."expr.str") },
  71. allocd_header { outputs = {"%U%/field.h"}, (d.."field.str") },
  72. allocd_header { outputs = {"%U%/estack.h"}, (d.."estack.str") },
  73. allocd_header { outputs = {"%U%/util.h"}, (d.."util.str") },
  74. allocd_header { outputs = {"%U%/decspecs.h"}, (d.."decspecs.str") },
  75. allocd_header { outputs = {"%U%/idf.h"}, (d.."idf.str") },
  76. allocd_header { outputs = {"%U%/macro.h"}, (d.."macro.str") },
  77. allocd_header { outputs = {"%U%/stack.h"}, (d.."stack.str") },
  78. allocd_header { outputs = {"%U%/stmt.h"}, (d.."stmt.str") },
  79. allocd_header { outputs = {"%U%/struct.h"}, (d.."struct.str") },
  80. allocd_header { outputs = {"%U%/switch.h"}, (d.."switch.str") },
  81. allocd_header { outputs = {"%U%/type.h"}, (d.."type.str") },
  82. allocd_header { outputs = {"%U%/l_brace.h"}, (d.."l_brace.str") },
  83. allocd_header { outputs = {"%U%/l_state.h"}, (d.."l_state.str") },
  84. allocd_header { outputs = {"%U%/l_outdef.h"}, (d.."l_outdef.str") },
  85. lpars
  86. }
  87. }
  88. lang_cem_compiler = cprogram {
  89. cfile_with_headers (d.."LLlex.c"),
  90. cfile_with_headers (d.."LLmessage.c"),
  91. cfile_with_headers (d.."arith.c"),
  92. cfile_with_headers (d.."asm.c"),
  93. cfile_with_headers (d.."blocks.c"),
  94. cfile_with_headers (d.."ch7.c"),
  95. cfile_with_headers (d.."ch7bin.c"),
  96. cfile_with_headers (d.."ch7mon.c"),
  97. cfile_with_headers (d.."code.c"),
  98. cfile_with_headers (d.."conversion.c"),
  99. cfile_with_headers (d.."cstoper.c"),
  100. cfile_with_headers (d.."dataflow.c"),
  101. cfile_with_headers (d.."declarator.c"),
  102. cfile_with_headers (d.."decspecs.c"),
  103. cfile_with_headers (d.."domacro.c"),
  104. cfile_with_headers (d.."dumpidf.c"),
  105. cfile_with_headers (d.."error.c"),
  106. cfile_with_headers (d.."eval.c"),
  107. cfile_with_headers (d.."expr.c"),
  108. cfile_with_headers (d.."field.c"),
  109. cfile_with_headers (d.."idf.c"),
  110. cfile_with_headers (d.."init.c"),
  111. cfile_with_headers (d.."input.c"),
  112. cfile_with_headers (d.."l_comment.c"),
  113. cfile_with_headers (d.."l_ev_ord.c"),
  114. cfile_with_headers (d.."l_lint.c"),
  115. cfile_with_headers (d.."l_misc.c"),
  116. cfile_with_headers (d.."l_outdef.c"),
  117. cfile_with_headers (d.."l_states.c"),
  118. cfile_with_headers (d.."label.c"),
  119. cfile_with_headers (d.."main.c"),
  120. cfile_with_headers (d.."options.c"),
  121. cfile_with_headers (d.."replace.c"),
  122. cfile_with_headers (d.."scan.c"),
  123. cfile_with_headers (d.."skip.c"),
  124. cfile_with_headers (d.."stack.c"),
  125. cfile_with_headers (d.."struct.c"),
  126. cfile_with_headers (d.."switch.c"),
  127. cfile_with_headers (d.."tokenname.c"),
  128. cfile_with_headers (d.."type.c"),
  129. cfile_with_headers (d.."util.c"),
  130. cfile_with_headers (d.."stab.c"),
  131. foreach {
  132. rule = cfile_with_headers,
  133. ith { lpars, from=2 }
  134. },
  135. cfile_with_headers {
  136. simple {
  137. outputs = {"%U%-symbol2str.c"},
  138. command = {
  139. "%in[1]% < %in[2]% > %out[1]%"
  140. },
  141. file (d.."make.tokcase"),
  142. file (d.."tokenname.c")
  143. }
  144. },
  145. cfile_with_headers {
  146. CINCLUDES = {PARENT, d},
  147. tabgen (d.."char.tab")
  148. },
  149. cfile_with_headers {
  150. simple {
  151. outputs = {"%U%-next.c"},
  152. command = {
  153. "%in% > %out%"
  154. },
  155. file (d.."make.next"),
  156. file (d.."code.str"),
  157. file (d.."declar.str"),
  158. file (d.."decspecs.str"),
  159. file (d.."def.str"),
  160. file (d.."expr.str"),
  161. file (d.."field.str"),
  162. file (d.."estack.str"),
  163. file (d.."util.str"),
  164. file (d.."idf.str"),
  165. file (d.."macro.str"),
  166. file (d.."stack.str"),
  167. file (d.."stmt.str"),
  168. file (d.."struct.str"),
  169. file (d.."switch.str"),
  170. file (d.."type.str"),
  171. file (d.."l_brace.str"),
  172. file (d.."l_state.str"),
  173. file (d.."l_outdef.str"),
  174. }
  175. },
  176. lib_em_mes,
  177. lib_emk,
  178. lib_em_data,
  179. lib_input,
  180. lib_assert,
  181. lib_alloc,
  182. lib_flt_arith,
  183. lib_print,
  184. lib_system,
  185. lib_string,
  186. outputs = {"%U%/em_cemcom"},
  187. install = {
  188. pm.install( BINDIR..PLATDEP.."/em_cemcom"),
  189. pm.install(d.."cemcom.1", BINDIR.."/man/man1/cemcom.1"),
  190. }
  191. }