X-Git-Url: http://git.nguyen.vg/gitweb/?a=blobdiff_plain;f=build;h=4dba7565c4ab9e2b9dc14b9f1d21a9c730cc9ec6;hb=10aa93a09950c79d316594aa7d4bb62b64c1a60b;hp=ed3876a9cdbfcd54f8ab1d39e9e1c7a657ff051d;hpb=d89f59cf6220e605bfbb67fd3cb83f9165fde5a5;p=tatoo.git diff --git a/build b/build index ed3876a..4dba756 100755 --- a/build +++ b/build @@ -5,6 +5,9 @@ let debug = ref false let profile = ref false let verbose = ref false +let dir = Sys.getcwd () +let project_root = Filename.dirname Sys.argv.(0) + let () = for i = 1 to Array.length Sys.argv - 1 do match Sys.argv.(i) with @@ -18,7 +21,14 @@ let oprofile = if !profile then " -tag profile " else "" let odebug = if !profile then " -tag debug " else "" let otarget = if !target = "clean" then " -clean " else !target let overbose = if !verbose then " -classic-display " else "" +let () = + Sys.chdir project_root; + Printf.printf "Entering directory `%s'\n%!" project_root -let cmd = "ocamlbuild -use-ocamlfind " ^ overbose ^ oprofile ^ odebug ^ otarget -let _ = Sys.command cmd +let cmd = Printf.sprintf "ocamlbuild -use-ocamlfind %s %s %s %s" + overbose oprofile odebug otarget +let i = Sys.command cmd +let () = Sys.chdir dir; + Printf.printf "Leaving directory `%s'\n%!" project_root +let _ = exit i