summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ocamlbuild/main.ml7
-rw-r--r--ocamlbuild/manual/manual.tex15
-rw-r--r--ocamlbuild/options.ml2
-rw-r--r--ocamlbuild/signatures.mli1
4 files changed, 22 insertions, 3 deletions
diff --git a/ocamlbuild/main.ml b/ocamlbuild/main.ml
index bc3652533..b621dc00b 100644
--- a/ocamlbuild/main.ml
+++ b/ocamlbuild/main.ml
@@ -70,8 +70,7 @@ let proceed () =
let target_dirs = List.union [] (List.map Pathname.dirname !Options.targets) in
Configuration.parse_string
- "true: traverse
- <**/*.ml> or <**/*.mli> or <**/*.mlpack> or <**/*.ml.depends>: ocaml
+ "<**/*.ml> or <**/*.mli> or <**/*.mlpack> or <**/*.ml.depends>: ocaml
<**/*.byte>: ocaml, byte, program
<**/*.odoc>: ocaml, doc
<**/*.native>: ocaml, native, program
@@ -83,6 +82,10 @@ let proceed () =
";
Configuration.tag_any !Options.tags;
+ if !Options.recursive
+ || Sys.file_exists (* authorized since we're not in build *) "_tags"
+ || Sys.file_exists (* authorized since we're not in build *) "myocamlbuild.ml"
+ then Configuration.tag_any ["traverse"];
let newpwd = Sys.getcwd () in
Sys.chdir Pathname.pwd;
diff --git a/ocamlbuild/manual/manual.tex b/ocamlbuild/manual/manual.tex
index 94c0e646a..1827e336a 100644
--- a/ocamlbuild/manual/manual.tex
+++ b/ocamlbuild/manual/manual.tex
@@ -538,6 +538,19 @@ There are then two cases. If no other modules named \texttt{Bar} or
Otherwise, you will need to use the plugin mechanism and define the mutual
visibility of the subdirectories using the \texttt{Pathname.define\_context}
function.
+
+\subsubsection{Note on subdirectory traversal}
+\ocb used to traverse by default any subdirectory not explicitly excluded.
+This is no longer the case. Note that you can still have a fine grained
+control using your \tags file and the \texttt{traverse} tag.
+
+There is no longer the \texttt{true: traverse} tag declaration by default. To
+make \ocb recursive use one of these:
+\begin{enumerate}
+\item Give the \texttt{-r} flag to ocamlbuild.
+\item Have a \tags or myocamlbuild.ml file in your top directory.
+\end{enumerate}
+
%***)
%(*** Grouping targets
\subsection{Grouping targets with \texttt{.itarget}}
@@ -550,7 +563,7 @@ stuff.docdir/index.html
\end{verbatim}
Requesting the target \texttt{foo.otarget} will then build every target
listed in the file \texttt{foo.itarget}. Blank lines and lines starting
-with a sharp (\texttt{#}) are ignored.
+with a sharp (\texttt{\#}) are ignored.
%***)
%(*** Packing subdirectories into modules
\subsection{Packing subdirectories into modules}
diff --git a/ocamlbuild/options.ml b/ocamlbuild/options.ml
index b2bb212c2..58e8d0bc6 100644
--- a/ocamlbuild/options.ml
+++ b/ocamlbuild/options.ml
@@ -75,6 +75,7 @@ let ocamlrun = ref N
let program_to_execute = ref false
let must_clean = ref false
let show_documentation = ref false
+let recursive = ref false
let ext_lib = ref "a"
let ext_obj = ref "o"
let ext_dll = ref "so"
@@ -131,6 +132,7 @@ let spec =
"-log", Set_string log_file_internal, "<file> Set log file";
"-no-log", Unit (fun () -> log_file_internal := ""), " No log file";
"-clean", Set must_clean, " Remove build directory and other files, then exit";
+ "-r", Set recursive, " Traverse directories by default (true: traverse)";
"-I", String (add_to' my_include_dirs), "<path> Add to include directories";
"-Is", String (add_to my_include_dirs), "<path,...> (same as above, but accepts a (comma or blank)-separated list)";
diff --git a/ocamlbuild/signatures.mli b/ocamlbuild/signatures.mli
index 4f5353f61..8f8f51356 100644
--- a/ocamlbuild/signatures.mli
+++ b/ocamlbuild/signatures.mli
@@ -369,6 +369,7 @@ module type OPTIONS = sig
val catch_errors : bool ref
val use_menhir : bool ref
val show_documentation : bool ref
+ val recursive : bool ref
val targets : string list ref
val ocaml_libs : string list ref