pmfile 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. -- $Id$
  2. --
  3. -- This is the build file used to compile LLgen. It should be run through
  4. -- Prime Mover (copy supplied). See the READ_ME file for more information.
  5. include "c.pm"
  6. -- Where is LLgen going to be installed eventually? (Needs trailing slash.)
  7. PREFIX = PREFIX or "/usr/local/"
  8. -- Where's LLgen's staging area? (Don't change. Needs trailing slash.)
  9. INSTALLPATH = "bin/"
  10. LLgen = cprogram {
  11. CEXTRAFLAGS = '-DLIBDIR=\\"'..PREFIX..'share/LLgen\\" -DNON_CORRECTING',
  12. cfile "src/main.c",
  13. cfile "src/gencode.c",
  14. cfile "src/compute.c",
  15. cfile "src/check.c",
  16. cfile "src/reach.c",
  17. cfile "src/global.c",
  18. cfile "src/name.c",
  19. cfile "src/sets.c",
  20. cfile "src/alloc.c",
  21. cfile "src/machdep.c",
  22. cfile "src/cclass.c",
  23. cfile "src/savegram.c",
  24. -- These use pre-LLgen'd version of the files. If LLgen.g gets updated,
  25. -- they need rebuilding. Use the bootstrap script to do this.
  26. cfile "src/LLgen.c",
  27. cfile "src/Lpars.c",
  28. cfile "src/tokens.c",
  29. outputs = {"%U%/LLgen"},
  30. install = pm.install( INSTALLPATH.."bin/LLgen")
  31. }
  32. library = group {
  33. install = {
  34. pm.install("lib/rec", INSTALLPATH.."share/LLgen/rec"),
  35. pm.install("lib/incl", INSTALLPATH.."share/LLgen/incl"),
  36. pm.install("lib/nc_incl", INSTALLPATH.."share/LLgen/nc_incl"),
  37. pm.install("lib/nc_rec", INSTALLPATH.."share/LLgen/nc_rec"),
  38. }
  39. }
  40. manpage = group {
  41. install = {
  42. pm.install("doc/LLgen.1", INSTALLPATH.."man/man1/LLgen.1"),
  43. }
  44. }
  45. documentation = group {
  46. simple {
  47. outputs = {"%U%-%I%.ps.gz"},
  48. command = "refer -sA+T -p %in[1]% %in[2]% | groff -Tps -e -t -ms "..
  49. "| gzip -c9 > %out[1]%",
  50. file "doc/LLgen.refs",
  51. file "doc/LLgen.n",
  52. install = {
  53. pm.install(INSTALLPATH.."share/doc/LLgen/LLgen.ps.gz")
  54. }
  55. },
  56. simple {
  57. outputs = {"%U%-%I%.ps.gz"},
  58. command = "groff -Tps -e -t -p -ms %in% | gzip -c9 > %out[1]%",
  59. file "doc/LLgen_NCER.n",
  60. install = {
  61. pm.install(INSTALLPATH.."share/doc/LLgen/NCER.ps.gz")
  62. }
  63. },
  64. }
  65. -- Default rule: builds everything into the staging area, but does nothing
  66. -- else.
  67. default = group {
  68. LLgen, -- build LLgen itself
  69. library, -- copy over the library
  70. manpage, -- copy over the man page
  71. documentation, -- build the two white papers
  72. }
  73. -- This rule will build everything, and then install it to its final location.
  74. install = group {
  75. default,
  76. install = {
  77. "mkdir -p %PREFIX%",
  78. "(cd bin && tar cf - .) | (cd %PREFIX% && tar xvf -)"
  79. }
  80. }