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)
10 let () = Sys.chdir project_root
13 for i = 1 to Array.length Sys.argv - 1 do
14 match Sys.argv.(i) with
15 | "-d" -> debug := true
16 | "-p" -> profile := true
17 | "-v" -> verbose := true
21 let oprofile = if !profile then " -tag profile " else ""
22 let odebug = if !profile then " -tag debug " else ""
23 let otarget = if !target = "clean" then " -clean " else !target
24 let overbose = if !verbose then " -classic-display " else ""
26 let cmd = "ocamlbuild -use-ocamlfind " ^ overbose ^ oprofile ^ odebug ^ otarget
27 let i = Sys.command cmd
28 let () = Sys.chdir dir