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 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 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