extract-filenames.scm 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. ; Part of Scheme 48 1.9. See file COPYING for notices and license.
  2. ; Authors: Richard Kelsey, Jonathan Rees, Michael Sperber, Marcus Crestani, Robert Ransom
  3. ; Generate filenames.make from *-packages.scm.
  4. ; Define DEFINE-STRUCTURE and friends
  5. (for-each load
  6. '("scheme/bcomp/module-language.scm"
  7. "scheme/alt/dummy-interface.scm"
  8. "scheme/alt/config.scm"
  9. "scheme/env/flatload.scm"))
  10. ; The following bogus structures are required in order to load
  11. ; scheme/more-interfaces.scm.
  12. (define ascii (structure (make-simple-interface 'ascii '())))
  13. (define bitwise (structure (make-simple-interface 'bitwise '())))
  14. (define vm-data (structure (make-simple-interface 'vm-data '())))
  15. (define enumerated (structure (make-simple-interface 'enumerated '())))
  16. (define tables (structure (make-simple-interface 'tables '())))
  17. (define cells (structure (make-simple-interface 'cells '())))
  18. (define platform (structure (make-simple-interface 'structure '())))
  19. ; The following loads are unnecessary; they only serve to suppress
  20. ; annoying "undefined" warnings for interfaces.
  21. (for-each load
  22. '("scheme/interfaces.scm"
  23. "scheme/vm/shared-interfaces.scm"
  24. "scheme/more-interfaces.scm"
  25. "scheme/sort/interfaces.scm"))
  26. (load-configuration "scheme/packages.scm")
  27. ; The following defines are unnecessary; they only serve to suppress
  28. ; annoying "undefined" warnings for some forward references.
  29. (define methods 0)
  30. (define tables 0)
  31. (define exceptions #f) ; avoid undefined warning
  32. (flatload linker-structures)
  33. (set! exceptions low-exceptions) ; so we don't have to import low-exceptions in the linker
  34. (define q-f (all-file-names link-config))
  35. ; (display "Initial structures") (newline)
  36. (flatload initial-structures)
  37. (define scheme (make-scheme environments evaluation))
  38. (define initial-system
  39. (structure (export)
  40. (open ;; Cf. initial.scm
  41. (make-initial-system scheme (make-mini-command scheme))
  42. module-system
  43. ensures-loaded
  44. for-reification))) ;foo...
  45. (define i-f (all-file-names initial-system))
  46. ; (display "Usual structures") (newline)
  47. (flatload usual-structures)
  48. (define u-f (all-file-names usual-features initial-system))
  49. (define (write-file-names mumble comment . stuff)
  50. (comment "This file was generated automatically.")
  51. (do ((stuff stuff (cddr stuff)))
  52. ((null? stuff))
  53. (mumble (car stuff) (cadr stuff))
  54. ;; (mumble 'all-files (reverse *all-files*))
  55. ))
  56. ;; Unix
  57. (begin
  58. (display "Writing ") (display "build/filenames.make") (newline)
  59. (call-with-output-file "build/filenames.make"
  60. (lambda (port)
  61. (write-file-names (lambda (name filenames)
  62. (newline port)
  63. (display name port)
  64. (display " = " port)
  65. (for-each (lambda (filename)
  66. (display filename port)
  67. (display " " port))
  68. filenames)
  69. (newline port))
  70. (lambda (comment)
  71. (display "# " port)
  72. (display comment port)
  73. (newline port))
  74. 'initial-files i-f
  75. 'usual-files u-f
  76. 'linker-files q-f))))
  77. ;; Windows
  78. (begin
  79. (display "Writing ") (display "build/filenames.bat") (newline)
  80. (call-with-output-file "build/filenames.bat"
  81. (lambda (port)
  82. (write-file-names (lambda (name filenames)
  83. (newline port)
  84. (display "@set " port)
  85. (display name port)
  86. (display "=" port)
  87. (for-each (lambda (filename)
  88. (display filename port)
  89. (display " " port))
  90. filenames)
  91. (newline port))
  92. (lambda (comment)
  93. (display "@rem " port)
  94. (display comment port)
  95. (newline port))
  96. 'initial-files i-f
  97. 'usual-files u-f
  98. 'linker-files q-f))))