From: Kim Nguyễn Date: Fri, 8 Feb 2013 17:43:27 +0000 (+0100) Subject: Build script can be called from a subdirectory of the project root. X-Git-Tag: v0.1~181 X-Git-Url: http://git.nguyen.vg/gitweb/?p=tatoo.git;a=commitdiff_plain;h=22783ce35e6d14fc45d4d612a4030c0c3fe8adfe Build script can be called from a subdirectory of the project root. --- diff --git a/build b/build index ed3876a..f73479d 100755 --- a/build +++ b/build @@ -5,6 +5,10 @@ let debug = ref false let profile = ref false let verbose = ref false +let dir = Sys.getcwd () +let project_root = Filename.dirname Sys.argv.(0) +let () = Sys.chdir project_root + let () = for i = 1 to Array.length Sys.argv - 1 do match Sys.argv.(i) with @@ -20,5 +24,7 @@ let otarget = if !target = "clean" then " -clean " else !target let overbose = if !verbose then " -classic-display " else "" let cmd = "ocamlbuild -use-ocamlfind " ^ overbose ^ oprofile ^ odebug ^ otarget -let _ = Sys.command cmd +let i = Sys.command cmd +let () = Sys.chdir dir +let _ = exit i