pmfile 3.5 KB

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