|
@@ -36,7 +36,7 @@ let exe_ext = match os_type with "Win32" | "Cygwin" -> ".exe" | _ -> ""
|
|
let ocamloptflags = match os_type with "Unix" -> "-cclib -fno-stack-protector " | _ -> ""
|
|
let ocamloptflags = match os_type with "Unix" -> "-cclib -fno-stack-protector " | _ -> ""
|
|
|
|
|
|
let zlib_path = match os_type with
|
|
let zlib_path = match os_type with
|
|
- | "Win32" -> "../ocaml/extc/zlib/"
|
|
|
|
|
|
+ | "Win32" -> "libs/extc/zlib/"
|
|
| _ -> "./"
|
|
| _ -> "./"
|
|
|
|
|
|
let zlib = match os_type with
|
|
let zlib = match os_type with
|
|
@@ -68,87 +68,84 @@ let modules l ext =
|
|
|
|
|
|
;;
|
|
;;
|
|
|
|
|
|
-let motiontwin = ":pserver:[email protected]:/cvsroot" in
|
|
|
|
-
|
|
|
|
-let download_libs() =
|
|
|
|
- cvs motiontwin "co ocaml/swflib";
|
|
|
|
- cvs motiontwin "co ocaml/extc";
|
|
|
|
- cvs motiontwin "co ocaml/extlib-dev";
|
|
|
|
- cvs motiontwin "co ocaml/xml-light";
|
|
|
|
- command "svn co http://nekovm.googlecode.com/svn/trunk/libs/include/ocaml neko/libs/include/ocaml";
|
|
|
|
-in
|
|
|
|
|
|
|
|
let download() =
|
|
let download() =
|
|
command "svn co http://haxe.googlecode.com/svn/trunk haxe";
|
|
command "svn co http://haxe.googlecode.com/svn/trunk haxe";
|
|
- download_libs();
|
|
|
|
in
|
|
in
|
|
|
|
|
|
let compile_libs() =
|
|
let compile_libs() =
|
|
|
|
+ Sys.chdir "haxe/libs";
|
|
|
|
+
|
|
(* EXTLIB *)
|
|
(* EXTLIB *)
|
|
- Sys.chdir "ocaml/extlib-dev";
|
|
|
|
|
|
+ Sys.chdir "extlib";
|
|
command ("ocaml install.ml -nodoc -d .. " ^ (if bytecode then "-b " else "") ^ (if native then "-n" else ""));
|
|
command ("ocaml install.ml -nodoc -d .. " ^ (if bytecode then "-b " else "") ^ (if native then "-n" else ""));
|
|
msg "";
|
|
msg "";
|
|
- Sys.chdir "../..";
|
|
|
|
|
|
+ Sys.chdir "..";
|
|
|
|
|
|
(* EXTC *)
|
|
(* EXTC *)
|
|
- Sys.chdir "ocaml/extc";
|
|
|
|
|
|
+ Sys.chdir "extc";
|
|
let c_opts = (if Sys.ocaml_version < "3.08" then " -ccopt -Dcaml_copy_string=copy_string " else " ") in
|
|
let c_opts = (if Sys.ocaml_version < "3.08" then " -ccopt -Dcaml_copy_string=copy_string " else " ") in
|
|
- command ("ocamlc" ^ c_opts ^ " -I .. -I ../" ^ zlib_path ^ " extc_stubs.c");
|
|
|
|
|
|
+ command ("ocamlc" ^ c_opts ^ " -I .. -I ../../" ^ zlib_path ^ " extc_stubs.c");
|
|
|
|
|
|
- let options = "-cclib ../ocaml/extc/extc_stubs" ^ obj_ext ^ " -cclib " ^ zlib ^ " extc.ml" in
|
|
|
|
|
|
+ let options = "-cclib libs/extc/extc_stubs" ^ obj_ext ^ " -cclib " ^ zlib ^ " extc.ml" in
|
|
let options = if Sys.os_type = "Win32" then options ^ " -cclib shell32.lib" else options in
|
|
let options = if Sys.os_type = "Win32" then options ^ " -cclib shell32.lib" else options in
|
|
if bytecode then command ("ocamlc -a -I .. -o extc.cma " ^ options);
|
|
if bytecode then command ("ocamlc -a -I .. -o extc.cma " ^ options);
|
|
if native then command ("ocamlopt -a -I .. -o extc.cmxa " ^ options);
|
|
if native then command ("ocamlopt -a -I .. -o extc.cmxa " ^ options);
|
|
- Sys.chdir "../..";
|
|
|
|
|
|
+ Sys.chdir "..";
|
|
|
|
|
|
(* SWFLIB *)
|
|
(* SWFLIB *)
|
|
- Sys.chdir "ocaml/swflib";
|
|
|
|
|
|
+ Sys.chdir "swflib";
|
|
let files = "-I .. -I ../extc as3.mli as3hl.mli as3code.ml as3parse.ml as3hlparse.ml swf.ml actionScript.ml swfParser.ml" in
|
|
let files = "-I .. -I ../extc as3.mli as3hl.mli as3code.ml as3parse.ml as3hlparse.ml swf.ml actionScript.ml swfParser.ml" in
|
|
if bytecode then command ("ocamlc -a -o swflib.cma " ^ files);
|
|
if bytecode then command ("ocamlc -a -o swflib.cma " ^ files);
|
|
if native then command ("ocamlopt -a -o swflib.cmxa " ^ files);
|
|
if native then command ("ocamlopt -a -o swflib.cmxa " ^ files);
|
|
- Sys.chdir "../..";
|
|
|
|
|
|
+ Sys.chdir "..";
|
|
|
|
+
|
|
|
|
+ (* NEKO *)
|
|
|
|
+ Sys.chdir "neko";
|
|
|
|
+ let files = "-I .. nast.ml nxml.ml binast.ml" in
|
|
|
|
+ if bytecode then command ("ocamlc -a -o neko.cma " ^ files);
|
|
|
|
+ if native then command ("ocamlopt -a -o neko.cmxa " ^ files);
|
|
|
|
+ Sys.chdir "..";
|
|
|
|
|
|
(* XML-LIGHT *)
|
|
(* XML-LIGHT *)
|
|
- Sys.chdir "ocaml/xml-light";
|
|
|
|
|
|
+ Sys.chdir "xml-light";
|
|
command ("ocamlyacc xml_parser.mly");
|
|
command ("ocamlyacc xml_parser.mly");
|
|
command ("ocamlc xml.mli dtd.mli xml_parser.mli xml_lexer.mli");
|
|
command ("ocamlc xml.mli dtd.mli xml_parser.mli xml_lexer.mli");
|
|
command ("ocamllex xml_lexer.mll");
|
|
command ("ocamllex xml_lexer.mll");
|
|
let files = "xml_parser.ml xml_lexer.ml dtd.ml xmlParser.mli xmlParser.ml xml.ml" in
|
|
let files = "xml_parser.ml xml_lexer.ml dtd.ml xmlParser.mli xmlParser.ml xml.ml" in
|
|
if bytecode then command ("ocamlc -a -o xml-light.cma " ^ files);
|
|
if bytecode then command ("ocamlc -a -o xml-light.cma " ^ files);
|
|
if native then command ("ocamlopt -a -o xml-light.cmxa " ^ files);
|
|
if native then command ("ocamlopt -a -o xml-light.cmxa " ^ files);
|
|
- Sys.chdir "../..";
|
|
|
|
|
|
+ Sys.chdir "..";
|
|
|
|
|
|
|
|
+ Sys.chdir "../..";
|
|
in
|
|
in
|
|
|
|
|
|
let compile() =
|
|
let compile() =
|
|
|
|
|
|
(try Unix.mkdir "bin" 0o740 with Unix.Unix_error(Unix.EEXIST,_,_) -> ());
|
|
(try Unix.mkdir "bin" 0o740 with Unix.Unix_error(Unix.EEXIST,_,_) -> ());
|
|
|
|
|
|
- compile_libs();
|
|
|
|
-
|
|
|
|
- (* HAXE *)
|
|
|
|
Sys.chdir "haxe";
|
|
Sys.chdir "haxe";
|
|
|
|
+ (* HAXE *)
|
|
command "ocamllex lexer.mll";
|
|
command "ocamllex lexer.mll";
|
|
let libs = [
|
|
let libs = [
|
|
- "../ocaml/extLib";
|
|
|
|
- "../ocaml/extc/extc";
|
|
|
|
- "../ocaml/swflib/swflib";
|
|
|
|
- "../ocaml/xml-light/xml-light";
|
|
|
|
|
|
+ "libs/extLib";
|
|
|
|
+ "libs/extc/extc";
|
|
|
|
+ "libs/swflib/swflib";
|
|
|
|
+ "libs/xml-light/xml-light";
|
|
|
|
+ "libs/neko/neko";
|
|
"unix";
|
|
"unix";
|
|
"str"
|
|
"str"
|
|
] in
|
|
] in
|
|
- let neko = "../neko/libs/include/ocaml" in
|
|
|
|
let paths = [
|
|
let paths = [
|
|
- "../ocaml";
|
|
|
|
- "../ocaml/swflib";
|
|
|
|
- "../ocaml/xml-light";
|
|
|
|
- "../ocaml/extc";
|
|
|
|
- neko
|
|
|
|
|
|
+ "libs";
|
|
|
|
+ "libs/swflib";
|
|
|
|
+ "libs/xml-light";
|
|
|
|
+ "libs/extc";
|
|
|
|
+ "libs/neko"
|
|
] in
|
|
] in
|
|
let mlist = [
|
|
let mlist = [
|
|
"ast";"lexer";"type";"common";"parser";"typecore";
|
|
"ast";"lexer";"type";"common";"parser";"typecore";
|
|
"genxml";"optimizer";"typeload";"codegen";
|
|
"genxml";"optimizer";"typeload";"codegen";
|
|
- neko^"/nast";neko^"/binast";neko^"/nxml";
|
|
|
|
"gencommon";"genneko";"genas3";"genjs";"genswf8";"genswf9";"genswf";"genphp";"gencpp";"gencs";"genjava";
|
|
"gencommon";"genneko";"genas3";"genjs";"genswf8";"genswf9";"genswf";"genphp";"gencpp";"gencs";"genjava";
|
|
"interp";"typer";"main";
|
|
"interp";"typer";"main";
|
|
] in
|
|
] in
|
|
@@ -157,12 +154,20 @@ let compile() =
|
|
ocamlc (path_str ^ " -pp camlp4o " ^ modules mlist ".ml");
|
|
ocamlc (path_str ^ " -pp camlp4o " ^ modules mlist ".ml");
|
|
if bytecode then command ("ocamlc -custom -o ../bin/haxe-byte" ^ exe_ext ^ libs_str ".cma" ^ modules mlist ".cmo");
|
|
if bytecode then command ("ocamlc -custom -o ../bin/haxe-byte" ^ exe_ext ^ libs_str ".cma" ^ modules mlist ".cmo");
|
|
if native then command ("ocamlopt -o ../bin/haxe" ^ exe_ext ^ libs_str ".cmxa" ^ modules mlist ".cmx");
|
|
if native then command ("ocamlopt -o ../bin/haxe" ^ exe_ext ^ libs_str ".cmxa" ^ modules mlist ".cmx");
|
|
|
|
+in
|
|
|
|
+
|
|
|
|
+let make_std() =
|
|
|
|
+
|
|
|
|
+ if Sys.file_exists "../bin/std" then command (if os_type = "Win32" then "rmdir /S /Q ..\\bin\\std" else "rm -rf ../bin/std");
|
|
|
|
+ command "svn export -q std ../bin/std";
|
|
|
|
|
|
in
|
|
in
|
|
let startdir = Sys.getcwd() in
|
|
let startdir = Sys.getcwd() in
|
|
try
|
|
try
|
|
download();
|
|
download();
|
|
|
|
+ compile_libs();
|
|
compile();
|
|
compile();
|
|
|
|
+ make_std();
|
|
Sys.chdir startdir;
|
|
Sys.chdir startdir;
|
|
with
|
|
with
|
|
Failure msg ->
|
|
Failure msg ->
|