2
0
Nicolas Cannasse 18 жил өмнө
parent
commit
943cf642c6
3 өөрчлөгдсөн 14 нэмэгдсэн , 6 устгасан
  1. 8 4
      Makefile.win
  2. 3 2
      genneko.ml
  3. 3 0
      haxe.vcproj

+ 8 - 4
Makefile.win

@@ -7,12 +7,16 @@ LIBS=extLib.cmxa extc.cmxa swfLib.cmxa unix.cmxa xml-light.cmxa
 LFLAGS= -o haxe.exe -I ../neko/libs/include/ocaml
 OUTPUT=sed 's/File "\([^"]\+\)", line \([0-9]\+\), \(.*\)/\1(\2): \3/' tmp.cmi
 
+FILES = ../neko/libs/include/ocaml/nast.cmx ast.cmx plugin.cmx ../neko/libs/include/ocaml/nxml.cmx ../neko/libs/include/ocaml/binast.cmx lexer.cmx type.cmx parser.cmx transform.cmx typer.cmx genswf9.cmx genneko.cmx genjs.cmx genswf.cmx genxml.cmx genas3.cmx main.cmx
+
 all: haxe.exe
 
-haxe.exe: ../neko/libs/include/ocaml/nast.cmx ast.cmx plugin.cmx ../neko/libs/include/ocaml/nxml.cmx lexer.cmx type.cmx genswf9.cmx parser.cmx transform.cmx typer.cmx genneko.cmx genjs.cmx genswf.cmx genxml.cmx genas3.cmx main.cmx
-	ocamlopt $(LFLAGS) $(LIBS) ../neko/libs/include/ocaml/nast.cmx ast.cmx plugin.cmx ../neko/libs/include/ocaml/nxml.cmx lexer.cmx type.cmx parser.cmx transform.cmx typer.cmx genneko.cmx genjs.cmx genswf9.cmx genswf.cmx genxml.cmx genas3.cmx main.cmx
+haxe.exe: $(FILES)
+	ocamlopt $(LFLAGS) $(LIBS) $(FILES)
+
+genneko.cmx: typer.cmx type.cmx plugin.cmx ../neko/libs/include/ocaml/binast.cmx ../neko/libs/include/ocaml/nast.cmx lexer.cmx ast.cmx
 
-genneko.cmx: typer.cmx type.cmx plugin.cmx ../neko/libs/include/ocaml/nxml.cmx ../neko/libs/include/ocaml/nast.cmx lexer.cmx ast.cmx
+../neko/libs/include/ocaml/binast.cmx: ../neko/libs/include/ocaml/nast.cmx
 
 ../neko/libs/include/ocaml/nxml.cmx: ../neko/libs/include/ocaml/nast.cmx
 
@@ -43,7 +47,7 @@ typer.cmx: type.cmx plugin.cmx parser.cmx lexer.cmx ast.cmx
 
 clean:
 	rm -f haxe.exe
-	rm -f typer.obj typer.cmx typer.cmi type.obj type.cmx type.cmi transform.obj transform.cmx transform.cmi plugin.obj plugin.cmx plugin.cmi parser.obj parser.cmx parser.cmi main.obj main.cmx main.cmi lexer.obj lexer.cmx lexer.cmi lexer.ml genxml.obj genxml.cmx genxml.cmi genswf9.obj genswf9.cmx genswf9.cmi genswf.obj genswf.cmx genswf.cmi genjs.obj genjs.cmx genjs.cmi ast.obj ast.cmx ast.cmi ../neko/libs/include/ocaml/nxml.obj ../neko/libs/include/ocaml/nxml.cmx ../neko/libs/include/ocaml/nxml.cmi ../neko/libs/include/ocaml/nast.obj ../neko/libs/include/ocaml/nast.cmx ../neko/libs/include/ocaml/nast.cmi genneko.obj genneko.cmx genneko.cmi
+	rm -f $(FILES) $(FILES:.cmx=.obj) $(FILES:.cmx=.cmi)
 
 # SUFFIXES
 .ml.cmo:

+ 3 - 2
genneko.ml

@@ -745,9 +745,10 @@ let generate file types hres libs =
 	t();
 	let neko_file = (try Filename.chop_extension file with _ -> file) ^ ".neko" in
 	let w = Plugin.timer "neko ast write" in
-	let ch = IO.output_channel (open_out neko_file) in
+	let ch = IO.output_channel (open_out_bin neko_file) in
 	let source = Plugin.defined "neko_source" in
-	(if source then Nxml.write_fmt else Nxml.write) ch (Nxml.to_xml e);
+	Binast.write ch e;
+	(*// Nxml.write ch (Nxml.to_xml e); *)
 	IO.close_out ch;
 	let command cmd = try Sys.command cmd with _ -> -1 in
 	if source then begin

+ 3 - 0
haxe.vcproj

@@ -41,6 +41,9 @@
 		<Filter
 			Name="neko"
 			Filter="">
+			<File
+				RelativePath="..\neko\libs\include\ocaml\binast.ml">
+			</File>
 			<File
 				RelativePath=".\genneko.ml">
 			</File>