racket/rktboot/parse-makefile.rkt
Matthew Flatt aa9bba9328 add Racket-based bootstrap support
Move "racket/src/cs/bootstrap" from the Racket source repository to
this one, because the bootstrapping implementation needs to track the
Chez Scheme source much more closely than the Racket implementation.
Currently, any Racket v7.1 or later works.

Also update "README.md" and "BUILDING" to get all the information
consistent and in sync with revised build options.

original commit: a9e6e99ea414b4625fe9705e4f3cfd62bbf38ae2
2020-07-25 14:10:25 -06:00

18 lines
586 B
Racket

#lang racket/base
(require racket/string)
(provide get-sources-from-makefile)
(define (get-sources-from-makefile scheme-dir)
(call-with-input-file*
(build-path scheme-dir "s" "Mf-base")
#:mode 'text
(lambda (i)
(define (extract-files m)
(string-split (regexp-replace* #rx"\\\\" (bytes->string/utf-8 (cadr m)) "")))
(define bases (extract-files (regexp-match #rx"basesrc =((?:[^\\\n]*\\\\\n)*[^\\\n]*)\n" i)))
(define compilers (extract-files (regexp-match #rx"compilersrc =((?:[^\\\n]*\\\\\n)*[^\\\n]*)\n" i)))
(values bases compilers))))