Change the path to the root directory before attempting to open
authorKim Nguyễn <kn@lri.fr>
Sun, 10 Mar 2013 11:33:07 +0000 (12:33 +0100)
committerKim Nguyễn <kn@lri.fr>
Sun, 10 Mar 2013 11:33:07 +0000 (12:33 +0100)
any file in the build script

build

diff --git a/build b/build
index 1be54af..2b29bba 100755 (executable)
--- a/build
+++ b/build
@@ -36,6 +36,10 @@ let () =
 let oprofile = if !profile then " -tag profile " else ""
 let odebug = if !profile then " -tag debug " else ""
 let clean_first = ref false
 let oprofile = if !profile then " -tag profile " else ""
 let odebug = if !profile then " -tag debug " else ""
 let clean_first = ref false
+let () =
+  Sys.chdir project_root;
+  Printf.printf "Entering directory `%s'\n%!" project_root
+
 let otarget = List.fold_left (fun acc t ->
   if t = "clean" || t = "-clean" then (clean_first := true; acc)
   else
 let otarget = List.fold_left (fun acc t ->
   if t = "clean" || t = "-clean" then (clean_first := true; acc)
   else
@@ -46,9 +50,6 @@ let otarget = List.fold_left (fun acc t ->
     in
     t ^ " " ^ acc) "" (if (!target == []) then [ "main.otarget" ] else !target)
 let overbose = if !verbose then " -classic-display " else ""
     in
     t ^ " " ^ acc) "" (if (!target == []) then [ "main.otarget" ] else !target)
 let overbose = if !verbose then " -classic-display " else ""
-let () =
-  Sys.chdir project_root;
-  Printf.printf "Entering directory `%s'\n%!" project_root
 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"
 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"