let rec analyze f bt =
match bt with
| Leaf r ->
fprintf f "Ocamlbuild knows of no rules that apply to a target named %a. This can happen if you ask Ocamlbuild to build a target with the wrong extension (e.g. .opt instead of .native) or if the source files live in directories that have not been specified as include directories."
Resource.print r;
false
| Depth(r, bt) ->
if Glob.eval sources_glob r then
begin
fprintf f "Ocamlbuild cannot find or build %a. A file with such a name would usually be a source file. I suspect you have given a wrong target name to Ocamlbuild."
Resource.print r;
false
end
else
analyze f bt
| Choice bl -> List.for_all (analyze f) bl
| Target(_, bt) -> analyze f bt