X-Git-Url: http://git.annexia.org/?a=blobdiff_plain;f=examples%2Fcompile-c%2Fcompile.ml;h=151e8b79ec3ca82aecbff533bcf514be2cfb8ff2;hb=7f260be16fe00cab54973a3169c620f1b60ff9f9;hp=043bc9a3a7f84659c7eb1967bb632e24101c8551;hpb=4a78b6d657697537bfd18488cd2177ba833b94af;p=goaljobs.git diff --git a/examples/compile-c/compile.ml b/examples/compile-c/compile.ml index 043bc9a..151e8b7 100644 --- a/examples/compile-c/compile.ml +++ b/examples/compile-c/compile.ml @@ -9,22 +9,11 @@ and built program sources = List.iter (fun s -> require (compiled s)) sources; let objects = List.map (change_file_extension "o") sources in - sh "cc %s -o %s" (String.concat " " objects) program + sh "cd $builddir && cc %s -o %s" (String.concat " " objects) program (* Goal: Make sure a C file is compiled (to an object file). *) and compiled c_file = let o_file = change_file_extension "o" c_file in target (more_recent [o_file] [c_file]); require (file_exists c_file); - sh "cc -c %s -o %s" c_file o_file - -(* XXX IMPLICIT *) -let () = - try goal_all () - with - | Goal_result (Goal_failed msg) -> - prerr_endline ("error: " ^ msg); - exit 1 - | exn -> - prerr_endline (Printexc.to_string exn); - exit 1 + sh "cd $builddir && cc -c %s -o %s" c_file o_file