pmfile 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. -- $Source$
  2. -- $State$
  3. local d = "util/ncgg/"
  4. local ncgg_yacc = yacc {
  5. file (d.."cgg.y")
  6. }
  7. tool_ncgg = cprogram {
  8. cfile (d.."subr.c"),
  9. cfile (d.."main.c"),
  10. cfile (d.."coerc.c"),
  11. cfile (d.."error.c"),
  12. cfile (d.."emlookup.c"),
  13. cfile (d.."expr.c"),
  14. cfile (d.."instruct.c"),
  15. cfile (d.."iocc.c"),
  16. cfile (d.."lookup.c"),
  17. cfile (d.."output.c"),
  18. cfile (d.."set.c"),
  19. cfile (d.."strlookup.c"),
  20. cfile (d.."var.c"),
  21. cfile (d.."hall.c"),
  22. cfile {
  23. CEXTRAFLAGS = "-I"..d,
  24. ncgg_yacc,
  25. dynamicheaders = flex {
  26. file (d.."scan.l")
  27. }
  28. },
  29. cfile {
  30. CEXTRAFLAGS = "-I"..d,
  31. simple {
  32. outputs = {"%U%/enterkeyw.c"},
  33. command = {
  34. "cp %{return posix.dirname(self['in'][3])}%/y.tab.h %{return posix.dirname(self.out[1])}%",
  35. "cd %{return posix.dirname(self.out[1])}% && "..ROOTDIR..d.."cvtkeywords "..ROOTDIR..d.."keywords",
  36. },
  37. file (d.."cvtkeywords"),
  38. file (d.."keywords"),
  39. ncgg_yacc
  40. },
  41. dynamicheaders = ncgg_yacc
  42. },
  43. lib_em_data,
  44. lib_sbrk,
  45. outputs = {"%U%-ncgg"},
  46. install = pm.install(TOOLDIR.."ncgg")
  47. }
  48. ncgg = simple {
  49. class = "ncgg",
  50. outputs = {"%U%/tables.c", "%U%/tables.h"},
  51. command = {
  52. "cd %out[1]:dirname% && (cpp -P -I%NCGGINCLUDEDIR% %in% | %TOOLDIR%ncgg)",
  53. "mv %out[1]:dirname%/tables.H %out[2]%"
  54. },
  55. }
  56. --[[
  57. @echo HOSTNCG $SRCDIR/src/arch/$table/ncg/table
  58. @mkdir -p \$(dir \$@)
  59. @(cd $OBJDIR/src/arch/$1/ncg && $DESTDIR/bin/cpp -P -I$SRCDIR/src/arch/$1/ncg $SRCDIR/src/arch/$table/ncg/table | \
  60. $DESTDIR/bin/ncgg) > /dev/null
  61. @(cd $OBJDIR/src/arch/$1/ncg && mv tables.H tables.h)
  62. --]]
  63. -- Revision history
  64. -- $Log$
  65. -- Revision 1.3 2007-04-23 23:40:59 dtrg
  66. -- Modified to run ncgg input files through the ANSI preprocessor rather than the K&R one.
  67. --
  68. -- Revision 1.2 2006/07/22 20:58:27 dtrg
  69. -- cpp now gets installed in the right place.
  70. --
  71. -- Revision 1.1 2006/07/20 23:24:28 dtrg
  72. -- First version in CVS.
  73. --