- let is_built opts mt t mtgt tgt =
- younger_s_t mt t mtgt tgt
- ;;
-
- let assoc6 l k = List.find (fun (k1,_,_,_,_,_) -> k1 = k) l;;
-
- let fst6 = function (x,_,_,_,_,_) -> x;;
-
- let rec needs_build opts deps compiled (t,dependencies,root,tgt,mt,mtgt) =
- prerr_endline ("Checking if "^F.string_of_source_object t^
- " needs to be built");
- if List.mem t compiled then
- (prerr_endline "already compiled";
- false)
- else
- if not (is_built opts mt t mtgt tgt) then
- (prerr_endline (F.string_of_source_object t^
- " is not built, thus needs to be built");
- true)
- else
- try
- let unsat =
- List.find
- (needs_build opts deps compiled)
- (List.map (assoc6 deps) dependencies)
- in
- prerr_endline
- (F.string_of_source_object t^" depends on "^
- F.string_of_source_object (fst6 unsat)^
- " that needs to be built, thus needs to be built");
- true
- with Not_found ->
- try
- let _,_,_,unsat,_,_ =
- List.find
- (fun (_,_,_,tgt1,_,mtgt1) -> younger_t_t mtgt tgt mtgt1 tgt1)
- (List.map (assoc6 deps) dependencies)
- in
- prerr_endline
- (F.string_of_source_object t^" depends on "^F.string_of_target_object
- unsat^" and "^F.string_of_source_object t^".o is younger than "^
- F.string_of_target_object unsat^", thus needs to be built");
- true
- with Not_found -> false
- ;;
-
- let is_buildable opts compiled deps (t,dependencies,root,tgt,_,_ as what) =
- prerr_endline ("Checking if "^F.string_of_source_object t^" is buildable");
- let b = needs_build opts deps compiled what in
- if not b then
- (prerr_endline (F.string_of_source_object t^
- " does not need to be built, thus it not buildable");
- false)
- else
- try
- let unsat,_,_,_,_,_ =
- List.find (needs_build opts deps compiled)
- (List.map (assoc6 deps) dependencies)
- in
- prerr_endline
- (F.string_of_source_object t^" depends on "^
- F.string_of_source_object unsat^
- " that needs build, thus is not buildable");
- false
- with Not_found ->
- prerr_endline
- ("None of "^F.string_of_source_object t^
- " dependencies needs to be built, thus it is buildable");
- true
- ;;
-