diff options
| author | Wojciech Meyer <wojciech.meyer@gmail.com> | 2013-01-03 17:38:21 +0000 |
|---|---|---|
| committer | Wojciech Meyer <wojciech.meyer@gmail.com> | 2013-01-03 17:38:21 +0000 |
| commit | 7efba284ceff49b3e9de91a6d229b6b5caa6ca9b (patch) | |
| tree | 1c51c3a7af1c20e4cf9af15c88c3a36e38d4e386 | |
| parent | 88c6ce7d943a50f54e2bf09dc60d08cbade336fa (diff) | |
| download | ocaml-7efba284ceff49b3e9de91a6d229b6b5caa6ca9b.tar.gz | |
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: http://caml.inria.fr/svn/ocaml/trunk@13202 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
| -rw-r--r-- | tools/ocamldep.ml | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/tools/ocamldep.ml b/tools/ocamldep.ml index e542dbd007..c6b11de3a6 100644 --- a/tools/ocamldep.ml +++ b/tools/ocamldep.ml @@ -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; end let mli_file_dependencies source_file = |
