diff options
author | Nicolas Pouillard <np@nicolaspouillard.fr> | 2007-11-28 16:10:13 +0000 |
---|---|---|
committer | Nicolas Pouillard <np@nicolaspouillard.fr> | 2007-11-28 16:10:13 +0000 |
commit | c32b7dbb0eba7681da8edb0ae84e4df464832c9a (patch) | |
tree | 78568350a8caaa23f8f3e22b6266242ab3eb3186 | |
parent | 3a4356befd69933ea749e6f832dec91bbffc7ce8 (diff) |
[ocamlbuild] ocamlbuild is no longer recursive by default.
You can still have a fine grained control using your _tags
file and the "traverse" tag.
There is no longer the "true: traverse" tag declaration by default.
To make ocamlbuild recursive use one of these:
1) Give the -r flag to ocamlbuild.
2) Have a _tags or myocamlbuild.ml file in your top directory.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@8669 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
-rw-r--r-- | ocamlbuild/main.ml | 7 | ||||
-rw-r--r-- | ocamlbuild/manual/manual.tex | 15 | ||||
-rw-r--r-- | ocamlbuild/options.ml | 2 | ||||
-rw-r--r-- | ocamlbuild/signatures.mli | 1 |
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 |