X-Git-Url: http://git.nguyen.vg/gitweb/?p=tatoo.git;a=blobdiff_plain;f=build;h=f381c946f2e9672364178de169a361afaf584249;hp=2b29bbad9a2f422ca675337e99cad40a66e7943d;hb=ce09a30489dce8ac9e389c8c1525a34d1e02354e;hpb=3b653edd20248b66a005637c2b1e217042cef62b diff --git a/build b/build index 2b29bba..f381c94 100755 --- a/build +++ b/build @@ -20,6 +20,7 @@ let target = ref [ ] let debug = ref false let profile = ref false let verbose = ref false +let trace = ref false let dir = Sys.getcwd () let project_root = Filename.dirname Sys.argv.(0) @@ -30,11 +31,12 @@ let () = | "-d" -> debug := true | "-p" -> profile := true | "-v" -> verbose := true + | "-t" -> trace := true | x -> target := x :: !target done - +let otrace = if !trace then " -tag htmltrace " else "" let oprofile = if !profile then " -tag profile " else "" -let odebug = if !profile then " -tag debug " else "" +let odebug = if !debug then " -tag debug " else "" let clean_first = ref false let () = Sys.chdir project_root; @@ -52,8 +54,8 @@ let otarget = List.fold_left (fun acc t -> let overbose = if !verbose then " -classic-display " else "" let clean_cmd = if !clean_first then "ocamlbuild -clean;" else "" let build_cmd = if otarget = "" then "" else - Printf.sprintf "ocamlbuild -use-ocamlfind %s %s %s %s" - overbose oprofile odebug otarget + Printf.sprintf "ocamlbuild -use-ocamlfind %s %s %s %s %s" + overbose otrace oprofile odebug otarget let i = Sys.command (clean_cmd ^ build_cmd) let () = Sys.chdir dir; Printf.printf "Leaving directory `%s'\n%!" project_root