Allow one to pass several targets to the build script.
authorKim Nguyễn <kn@lri.fr>
Mon, 4 Mar 2013 20:49:55 +0000 (21:49 +0100)
committerKim Nguyễn <kn@lri.fr>
Mon, 4 Mar 2013 20:49:55 +0000 (21:49 +0100)
build

diff --git a/build b/build
index 4dba756..d5eb3a5 100755 (executable)
--- a/build
+++ b/build
@@ -1,6 +1,6 @@
 #!/usr/bin/env ocaml
 
-let target = ref "main.otarget"
+let target = ref [ "main.otarget" ]
 let debug = ref false
 let profile = ref false
 let verbose = ref false
@@ -14,12 +14,14 @@ let () =
     | "-d" -> debug := true
     | "-p" -> profile := true
     | "-v" -> verbose := true
-    | x -> target := x
+    | x -> target := x :: !target
   done
 
 let oprofile = if !profile then " -tag profile " else ""
 let odebug = if !profile then " -tag debug " else ""
-let otarget = if !target = "clean" then " -clean " else !target
+let otarget = List.fold_left (fun acc t ->
+  let t = if t = "clean" then "-clean" else t in
+  t ^ " " ^ acc) "" !target
 let overbose = if !verbose then " -classic-display " else ""
 let () =
   Sys.chdir project_root;