Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Browse files

Reverting "PR#5868: Bytecode dependencies should not appear in output…

… of ocamldep"

-native flag semantics are currently different to that what the user
expects, and what was attempted to be fixed. The semantics of -native
are not to completely disable generation of dependencies for bytecode
instead make the compilation to native code more efficient.

Most of the project are expected to be buildable with both versions of
the compiler. So ocamldep is expected to always generate the
dependencies in both cases. When the .mli file is absent ocamldep
needs to still generate dependencies in bytecode to build the cmi only
and to build cmi and cmx for the dependent compilation unit . Because
of some make tool pecularities, handling of two different rules that
include the same depenency is problematic, so instead when the -native
flag is not used the cmo file is used as a proxy to build cmi, when
the -native enabled however, the cmx file is used as proxy to build
cmi file for the dependencies to avoid recompilation of the dependent
.cmo file just to get .cmi file.

git-svn-id: f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
  • Loading branch information...
commit c80aac9a3661ce85e44f2e6ff9cab0e49fe2590f 1 parent 023bfce
meyer authored
Showing with 3 additions and 5 deletions.
  1. +3 −5 tools/
8 tools/
@@ -233,7 +233,7 @@ let ml_file_dependencies source_file =
print_raw_dependencies source_file extracted_deps
end else begin
let basename = Filename.chop_extension source_file in
- let byte_targets = if !native_only then [] else [ basename ^ ".cmo" ] in
+ let byte_targets = [ basename ^ ".cmo" ] in
let native_targets =
if !all_dependencies
then [ basename ^ ".cmx"; basename ^ ".o" ]
@@ -250,10 +250,8 @@ let ml_file_dependencies source_file =
let (byt_deps, native_deps) =
Depend.StringSet.fold (find_dependency ML)
extracted_deps init_deps in
- (match byte_targets @ extra_targets with
- | [] -> ()
- | targets -> print_dependencies targets byt_deps);
- print_dependencies (native_targets @ extra_targets) native_deps
+ print_dependencies (byte_targets @ extra_targets) byt_deps;
+ print_dependencies (native_targets @ extra_targets) native_deps;
let mli_file_dependencies source_file =
Please sign in to comment.
Something went wrong with that request. Please try again.