Clean-up the build system.
[tatoo.git] / build
1 #!/usr/bin/env ocaml
2
3 let target = ref "main.otarget"
4 let debug = ref false
5 let profile = ref false
6 let verbose = ref false
7
8 let () =
9   for i = 1 to Array.length Sys.argv - 1 do
10     match Sys.argv.(i) with
11     | "-d" -> debug := true
12     | "-p" -> profile := true
13     | "-v" -> verbose := true
14     | x -> target := x
15   done
16
17 let oprofile = if !profile then " -tag profile " else ""
18 let odebug = if !profile then " -tag debug " else ""
19 let otarget = if !target = "clean" then " -clean " else !target
20 let overbose = if !verbose then " -classic-display " else ""
21
22 let cmd = "ocamlbuild -use-ocamlfind " ^ overbose ^ oprofile ^ odebug ^ otarget
23 let _ = Sys.command cmd
24