pmfile 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  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. outputs = {"%U%-ncgg"},
  45. install = pm.install(TOOLDIR.."ncgg")
  46. }
  47. ncgg = simple {
  48. class = "ncgg",
  49. outputs = {"%U%/tables.c", "%U%/tables.h"},
  50. command = {
  51. "cd %out[1]:dirname% && (%BINDIR%%PLATDEP%/cpp.ansi -P -I%NCGGINCLUDEDIR% %in% | %TOOLDIR%ncgg)",
  52. "mv %out[1]:dirname%/tables.H %out[2]%"
  53. },
  54. }
  55. --[[
  56. @echo HOSTNCG $SRCDIR/src/arch/$table/ncg/table
  57. @mkdir -p \$(dir \$@)
  58. @(cd $OBJDIR/src/arch/$1/ncg && $DESTDIR/bin/cpp -P -I$SRCDIR/src/arch/$1/ncg $SRCDIR/src/arch/$table/ncg/table | \
  59. $DESTDIR/bin/ncgg) > /dev/null
  60. @(cd $OBJDIR/src/arch/$1/ncg && mv tables.H tables.h)
  61. --]]
  62. -- Revision history
  63. -- $Log$
  64. -- Revision 1.3 2007-04-23 23:40:59 dtrg
  65. -- Modified to run ncgg input files through the ANSI preprocessor rather than the K&R one.
  66. --
  67. -- Revision 1.2 2006/07/22 20:58:27 dtrg
  68. -- cpp now gets installed in the right place.
  69. --
  70. -- Revision 1.1 2006/07/20 23:24:28 dtrg
  71. -- First version in CVS.
  72. --