pmfile 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  1. -- $Source$
  2. -- $State$
  3. local d = ROOTDIR.."lang/cem/cpp.ansi/"
  4. local extract_parameters = simple {
  5. outputs = {
  6. "%U%/pathlength.h",
  7. "%U%/errout.h",
  8. "%U%/idfsize.h",
  9. "%U%/numsize.h",
  10. "%U%/nparams.h",
  11. "%U%/ifdepth.h",
  12. "%U%/macbuf.h",
  13. "%U%/strsize.h",
  14. "%U%/botch_free.h",
  15. "%U%/debug.h",
  16. "%U%/parbufsize.h",
  17. "%U%/textsize.h",
  18. "%U%/inputtype.h",
  19. "%U%/obufsize.h",
  20. "%U%/dobits.h",
  21. "%U%/ln_prefix.h",
  22. },
  23. command = {
  24. "cd %out[1]:dirname% && %in[1]% %in[2]%"
  25. },
  26. file (d.."make.hfiles"),
  27. file (d.."Parameters")
  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.."expression.g"),
  39. }
  40. local allocd_header = simple {
  41. class = "allocd_header",
  42. command = {
  43. "%in[1]% < %in[2]% > %out[1]%"
  44. },
  45. file (d.."make.allocd")
  46. }
  47. local cfile_with_headers = cfile {
  48. class = "cfile_with_headers",
  49. dynamicheaders = {
  50. file (d),
  51. extract_parameters,
  52. allocd_header { outputs = {"%U%/replace.h"}, (d.."replace.str") },
  53. allocd_header { outputs = {"%U%/macro.h"}, (d.."macro.str") },
  54. lpars
  55. }
  56. }
  57. tool_cpp_ansi = cprogram {
  58. cfile_with_headers (d.."LLlex.c"),
  59. cfile_with_headers (d.."LLmessage.c"),
  60. cfile_with_headers (d.."ch3bin.c"),
  61. cfile_with_headers (d.."ch3mon.c"),
  62. cfile_with_headers (d.."domacro.c"),
  63. cfile_with_headers (d.."error.c"),
  64. cfile_with_headers (d.."idf.c"),
  65. cfile_with_headers (d.."init.c"),
  66. cfile_with_headers (d.."input.c"),
  67. cfile_with_headers (d.."main.c"),
  68. cfile_with_headers (d.."options.c"),
  69. cfile_with_headers (d.."preprocess.c"),
  70. cfile_with_headers (d.."replace.c"),
  71. cfile_with_headers (d.."skip.c"),
  72. cfile_with_headers (d.."tokenname.c"),
  73. cfile_with_headers (d.."expr.c"),
  74. foreach {
  75. rule = cfile_with_headers,
  76. ith { lpars, from=2 }
  77. },
  78. cfile_with_headers {
  79. simple {
  80. outputs = {"%U%-symbol2str.c"},
  81. command = {
  82. "%in[1]% < %in[2]% > %out[1]%"
  83. },
  84. file (d.."make.tokcase"),
  85. file (d.."tokenname.c")
  86. }
  87. },
  88. cfile_with_headers {
  89. CINCLUDES = {PARENT, d},
  90. tabgen (d.."char.tab")
  91. },
  92. cfile_with_headers {
  93. simple {
  94. outputs = {"%U%-next.c"},
  95. command = {
  96. "%in% > %out%"
  97. },
  98. file (d.."make.next"),
  99. file (d.."macro.str"),
  100. file (d.."replace.str"),
  101. }
  102. },
  103. lib_input,
  104. lib_assert,
  105. lib_alloc,
  106. lib_print,
  107. lib_system,
  108. lib_string,
  109. outputs = {"%U%/cpp.ansi"},
  110. install = {
  111. pm.install( BINDIR..PLATDEP.."/cpp.ansi"),
  112. pm.install(d.."ncpp.6", BINDIR.."/man/man6/cpp.ansi.6"),
  113. }
  114. }