home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 7 / Apprentice-Release7.iso / Source Code / C / Applications / Moscow ML 1.42 / e_SML / make_mosml.sml < prev    next >
Encoding:
Text File  |  1997-07-28  |  2.6 KB  |  86 lines  |  [TEXT/Moml]

  1. (* make_mosml.sml   *)
  2. (* 23Jul97 e -- 142 *)
  3.  
  4. load "Path";
  5. load "Process";
  6.  
  7. val home =
  8.   case Process.getEnv "PATH_TRANSLATED" of
  9.     SOME n => Path.dir n
  10.   | NONE => ":"
  11. ;
  12.  
  13. (* requires copyrelease.sml *)
  14.  
  15. use (home ^ "e_SML:copyrelease.sml");
  16.  
  17. clean_dir_bin (home ^ "src:mosmllib:");
  18. clean_dir_bin (home ^ "src:compiler:");
  19. clean_dir_bin (home ^ "src:lex:");
  20. clean_dir_bin (home ^ "src:toolssrc:");
  21.  
  22. moolevel := 2;
  23.  
  24. (* to compile the toplevel mosml image and the lexer *)
  25.  
  26. let val base = home ^ "src:"
  27. in
  28.   valuepoly := false;
  29.   make "none" (base ^ "mosmllib") [] (base ^ "mosmllib");
  30.   valuepoly := true;
  31.   make "none" (base ^ "mosmllib") [] (base ^ "compiler");
  32.   make "none" (base ^ "mosmllib") [(base ^ "compiler")] (base ^ "toolssrc");
  33.   make "none" (base ^ "mosmllib") [(base ^ "compiler")] (base ^ "lex")
  34. end;
  35.  
  36. let val base = home ^ "src:"
  37. in
  38.   chDir base; chDir "::";
  39.   link "testtop.image"
  40.        (true,true) (* -g -noheader *)
  41.        (true,"")   (* -autolink -P *)
  42.        (base ^ "mosmllib") [(base ^ "compiler"),(base ^ "toolssrc")]
  43.        ["Maine.uo"]
  44. end;
  45.  
  46. let val base = home ^ "src:"
  47. in
  48.   chDir base; chDir "::";
  49.   link "mosmllex.image"
  50.        (true,true) (* -g -noheader *)
  51.        (true,"")   (* -autolink -P *)
  52.        (base ^ "mosmllib") [(base ^ "compiler"),(base ^ "lex")]
  53.        ["Mainlex.uo"]
  54. end;
  55.  
  56. copy_dir_obj (home ^ "src:mosmllib:") (home ^ "lib2:");
  57. compare_dirs_obj (home ^ "src:mosmllib:") (home ^ "lib2:");
  58.  
  59. (* some useful lexer command lines...
  60. :mosmllex.image :src:lex:Scanner.lex
  61. :mosmllex.image :src:compiler:Lexer.lex
  62. :mosmllex.image :src:toolssrc:Deplex.lex
  63. *)
  64. (* and linker command lines...
  65. mosmllink.image -stdlib jalaMPW:ml:mosml142:src:mosmllib: -P none -g -I jalaMPW:ml:mosml142:src:compiler: -I jalaMPW:ml:mosml142:src:toolssrc: -I jalaMPW:ml:mosml142:src:lex:  -noheader -o mosmltope jalaMPW:ml:mosml142:src:toolssrc:Maine.uo
  66. mosmllink.image -stdlib jalaMPW:ml:mosml142:src:mosmllib: -P none -g -I jalaMPW:ml:mosml142:src:compiler: -I jalaMPW:ml:mosml142:src:lex:  -noheader -o mosmllex jalaMPW:ml:mosml142:src:lex:Mainlex.uo
  67. mosmllink.image -stdlib jalaMPW:ml:mosml142:src:mosmllib: -P none -g -I jalaMPW:ml:mosml142:src:compiler: -noheader -o mosmllink jalaMPW:ml:mosml142:src:compiler:Mainl.uo
  68. *)
  69.  
  70. (*
  71. fun compare_files_contents src tgt =
  72.    let val is = BasicIO.open_in_bin src
  73.    in let val os = BasicIO.open_in_bin tgt
  74.       in
  75.          (compare_file_guts is os;
  76.           BasicIO.close_in is;
  77.           BasicIO.close_in os)
  78.          handle x => (BasicIO.close_in os; raise x)
  79.       end
  80.       handle x => (BasicIO.close_in is; raise x)
  81.    end
  82. ;
  83.  
  84. compare_files_contents (home ^ "mosml.image") (home ^ "testtop.image");
  85. *)
  86.