From eb43a243ba418e6023de2fc76b129542a5a49aff Mon Sep 17 00:00:00 2001 From: =?utf8?q?Kim=20Nguy=E1=BB=85n?= Date: Mon, 4 Mar 2013 21:49:55 +0100 Subject: [PATCH] Allow one to pass several targets to the build script. --- build | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/build b/build index 4dba756..d5eb3a5 100755 --- 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; -- 2.17.1