pmfile 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. -- $Source$
  2. -- $State$
  3. local d = ROOTDIR.."util/cpp/"
  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%/lapbuf.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%/line_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 cfile_with_headers = cfile {
  41. class = "cfile_with_headers",
  42. dynamicheaders = {
  43. file (d),
  44. extract_parameters,
  45. lpars
  46. }
  47. }
  48. tool_cpp = cprogram {
  49. cfile_with_headers (d.."LLlex.c"),
  50. cfile_with_headers (d.."LLmessage.c"),
  51. cfile_with_headers (d.."ch7bin.c"),
  52. cfile_with_headers (d.."ch7mon.c"),
  53. cfile_with_headers (d.."domacro.c"),
  54. cfile_with_headers (d.."error.c"),
  55. cfile_with_headers (d.."idf.c"),
  56. cfile_with_headers (d.."init.c"),
  57. cfile_with_headers (d.."input.c"),
  58. cfile_with_headers (d.."main.c"),
  59. cfile_with_headers (d.."options.c"),
  60. cfile_with_headers (d.."preprocess.c"),
  61. cfile_with_headers (d.."replace.c"),
  62. cfile_with_headers (d.."scan.c"),
  63. cfile_with_headers (d.."skip.c"),
  64. cfile_with_headers (d.."tokenname.c"),
  65. cfile_with_headers (d.."next.c"),
  66. cfile_with_headers (d.."expr.c"),
  67. foreach {
  68. rule = cfile_with_headers,
  69. ith { lpars, from=2 }
  70. },
  71. cfile_with_headers {
  72. simple {
  73. outputs = {"%U%-symbol2str.c"},
  74. command = {
  75. "%in[1]% < %in[2]% > %out[1]%"
  76. },
  77. file (d.."make.tokcase"),
  78. file (d.."tokenname.c")
  79. }
  80. },
  81. cfile_with_headers {
  82. CINCLUDES = {PARENT, d},
  83. tabgen (d.."char.tab")
  84. },
  85. lib_assert,
  86. lib_print,
  87. lib_alloc,
  88. lib_system,
  89. lib_string,
  90. outputs = {"%U%/cpp"},
  91. install = {
  92. pm.install("%BINDIR%%PLATDEP%/cpp"),
  93. pm.install(d.."cpp.6", "%BINDIR%man/man6/cpp.6")
  94. }
  95. }
  96. -- Revision history
  97. -- $Log$
  98. -- Revision 1.4 2006-10-15 00:28:11 dtrg
  99. -- Updated to the version 0.1 of Prime Mover (which involves some syntax changes).
  100. --
  101. -- Revision 1.3 2006/07/22 20:58:27 dtrg
  102. -- cpp now gets installed in the right place.
  103. --
  104. -- Revision 1.2 2006/07/22 12:27:31 dtrg
  105. -- Removed a huge, ancient comment dating from the genmake days.
  106. --
  107. -- Revision 1.1 2006/07/20 23:24:28 dtrg
  108. -- First version in CVS.