3 let target = ref "main.otarget"
5 let profile = ref false
6 let verbose = ref false
8 let dir = Sys.getcwd ()
9 let project_root = Filename.dirname Sys.argv.(0)
12 for i = 1 to Array.length Sys.argv - 1 do
13 match Sys.argv.(i) with
14 | "-d" -> debug := true
15 | "-p" -> profile := true
16 | "-v" -> verbose := true
20 let oprofile = if !profile then " -tag profile " else ""
21 let odebug = if !profile then " -tag debug " else ""
22 let otarget = if !target = "clean" then " -clean " else !target
23 let overbose = if !verbose then " -classic-display " else ""
25 Sys.chdir project_root;
26 Printf.printf "Entering directory `%s'\n%!" project_root
28 let cmd = Printf.sprintf "ocamlbuild -use-ocamlfind %s %s %s %s"
29 overbose oprofile odebug otarget
30 let i = Sys.command cmd
31 let () = Sys.chdir dir;
32 Printf.printf "Leaving directory `%s'\n%!" project_root