pmfile 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. -- $Source$
  2. -- $State$
  3. local d = ROOTDIR.."mach/proto/cg/"
  4. local make_tables = cgg {
  5. CGGINCLUDEDIR = (ROOTDIR.."mach/%ARCH%/cg/"),
  6. file (ROOTDIR.."mach/%ARCH%/cg/table")
  7. }
  8. local cfile_with_tables = cfile {
  9. class = "cfile_with_tables",
  10. dynamicheaders = {
  11. make_tables,
  12. file (ROOTDIR.."mach/%ARCH%/cg/"),
  13. file (ROOTDIR.."mach/")
  14. }
  15. }
  16. proto_cg = cprogram {
  17. class = "proto_cg",
  18. cfile_with_tables (d.."codegen.c"),
  19. cfile_with_tables (d.."compute.c"),
  20. cfile_with_tables (d.."equiv.c"),
  21. cfile_with_tables (d.."gencode.c"),
  22. cfile_with_tables (d.."glosym.c"),
  23. cfile_with_tables (d.."move.c"),
  24. cfile_with_tables (d.."nextem.c"),
  25. cfile_with_tables (d.."reg.c"),
  26. cfile_with_tables (d.."regvar.c"),
  27. cfile_with_tables (d.."salloc.c"),
  28. cfile_with_tables (d.."state.c"),
  29. cfile_with_tables (d.."subr.c"),
  30. cfile_with_tables (d.."var.c"),
  31. cfile_with_tables (d.."fillem.c"),
  32. cfile_with_tables (d.."main.c"),
  33. cfile {
  34. ith { make_tables, i = 1 },
  35. dynamicheaders = {
  36. file (ROOTDIR.."mach/%ARCH%/cg/"),
  37. file (d)
  38. }
  39. },
  40. lib_em_data,
  41. lib_flt_arith,
  42. outputs = {"%U%/%ARCH%-cg"},
  43. install = pm.install("%BINDIR%%PLATDEP%/%ARCH%/cg")
  44. }
  45. --[[
  46. # genmakefile
  47. # This genmakefile doesn't have a real comment yet.
  48. #
  49. # $Source$
  50. # $State$
  51. codegenerator() {
  52. push
  53. addinclude $SRCDIR/src/arch/$1/cg
  54. addinclude $OBJDIR/src/arch/$1/cg
  55. addincludeq src/arch/proto/cg
  56. hostcdyn src/arch/$1/cg/tables.c
  57. hostprogram $DESTDIR/lib/$1/cg $OBJS \
  58. $DESTDIR/lib/libem_data.a \
  59. $DESTDIR/lib/libflt_arith.a
  60. cat <<EOF
  61. $OBJDIR/src/arch/$1/cg/tables.c: \
  62. $SRCDIR/src/arch/$1/cg/table \
  63. $DESTDIR/bin/cpp \
  64. $DESTDIR/bin/cgg
  65. @echo HOSTCGG $SRCDIR/src/arch/$1/cg/table
  66. @mkdir -p \$(dir \$@)
  67. @(cd $OBJDIR/src/arch/$1/cg && $DESTDIR/bin/cpp -P -I$SRCDIR/src/arch/$1/cg $SRCDIR/src/arch/$1/cg/table | \
  68. $DESTDIR/bin/cgg) > /dev/null
  69. EOF
  70. pop
  71. }
  72. # Revision history
  73. # $Log$
  74. # Revision 1.1 2006-07-20 23:18:19 dtrg
  75. # First version in CVS.
  76. #
  77. --]]
  78. -- Revision history
  79. -- $Log$
  80. -- Revision 1.1 2006-07-20 23:18:19 dtrg
  81. -- First version in CVS.
  82. --