dbuild.lsp 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. % Build a CSL REDUCE "in core" as first stage of a bootstrap. To be
  2. % run starting from a cold-start CSL, i.e. with the -z option.
  3. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  4. %
  5. % smallred -z dbuild.lsp -l dbuild.log
  6. %
  7. % where this job rebuilds a bootstrap REDUCE etc etc from scratch
  8. %
  9. % This file first builds REDUCE, it then makes a set of FASL modules
  10. % for auto-loadable parts of the system, compiles a load of Lisp into
  11. % C and processes the Lisp interface code generated in the process.
  12. %
  13. % Here I build modules for all the things that will be included in the
  14. % demonstration version of REDUCE, and all the parts of the code that
  15. % will be subject to compilation into C.
  16. %
  17. % Author: Anthony C. Hearn.
  18. % Modifications by Stanley L. Kameny and Arthur Norman
  19. (verbos 3)
  20. (rdf "$reduce/lisp/csl/cslbase/compat.lsp")
  21. (rdf "$reduce/lisp/csl/cslbase/extras.lsp")
  22. (rdf "$reduce/lisp/csl/cslbase/compiler.lsp")
  23. % Now be brave and compile the compiler - I hand-compile the
  24. % most speed-critical functions first
  25. (compile '(s!:resolve!_labels s!:plant!_basic!_block s!:tidy!_flowgraph
  26. s!:endprocedure s!:outopcode1 s!:outjump s!:findliteral
  27. s!:destination!_label s!:compile1 s!:outoperation
  28. s!:add!_pending s!:iseasy s!:set!_label s!:outextend
  29. s!:start!_procedure s!:outexit))
  30. (compile!-all)
  31. % Finally build fasl files for the compatibility code and the two
  32. % versions of the compiler.
  33. (faslout 'compat)
  34. (rdf "$reduce/lisp/csl/cslbase/compat.lsp")
  35. (rdf "$reduce/lisp/csl/cslbase/extras.lsp")
  36. (faslend)
  37. (faslout 'compiler)
  38. (rdf "$reduce/lisp/csl/cslbase/compiler.lsp")
  39. (faslend)
  40. (faslout 'ccomp)
  41. (rdf "$reduce/lisp/csl/cslbase/ccomp.lsp")
  42. (faslend)
  43. (de concat (u v)
  44. (compress (cons '!" (append (explode2 u)
  45. (nconc (explode2 v) (list '!"))))))
  46. (global '(oldchan!*))
  47. (setq prolog_file 'cslprolo)
  48. (setq rend_file 'cslrend)
  49. (setq oldchan2!*
  50. (rds (setq oldchan!* (open "$reduce/packages/support/dbuild2.sl" 'input))))
  51. % CSL independent code.
  52. (close oldchan!*)
  53. (setq !*savedef nil)
  54. (begin)
  55. symbolic;
  56. faslout "remake";
  57. in "$reduce/packages/support/remake.red"$
  58. faslend;
  59. << initreduce();
  60. date!* := "Bootstrap version";
  61. % I call mapstore() here to reset all counts to zero,
  62. % thereby making future statistics at least marginally meaningful!
  63. mapstore 4;
  64. !*savedef := nil;
  65. preserve 'begin >>;
  66. % End of dbuild.lsp.