summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Pouillard <np@nicolaspouillard.fr>2010-02-03 13:11:20 +0000
committerNicolas Pouillard <np@nicolaspouillard.fr>2010-02-03 13:11:20 +0000
commitda8e2346a0046f3b7759c393aa632fdd6d57c7cb (patch)
tree152e3bcce48852adcf7755790bcebf9dab62af7e
parentee0f1a1bb2d7f652182be81d504882cff6f660ab (diff)
downloadocaml-da8e2346a0046f3b7759c393aa632fdd6d57c7cb.tar.gz
ocamlbuild,solver: add two comments.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@9614 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
-rw-r--r--ocamlbuild/solver.ml12
1 files changed, 12 insertions, 0 deletions
diff --git a/ocamlbuild/solver.ml b/ocamlbuild/solver.ml
index 1f4f4ef03b..8077bd2ed7 100644
--- a/ocamlbuild/solver.ml
+++ b/ocamlbuild/solver.ml
@@ -82,12 +82,24 @@ let rec self depth on_the_go_orig target =
| Target _ | Choice _ | Leaf _ -> ()
in until_works rs (backtrace :: backtraces)
in until_works matching_rules []
+
+(* Build the first target that is buildable *)
and self_first depth on_the_go already_failed rs =
match rs with
| [] -> Bad (Failed (Choice already_failed))
| r :: rs ->
try self depth on_the_go r; Good r
with Failed backtrace -> self_first depth on_the_go (backtrace :: already_failed) rs
+
+(* This variant is the one (once partially applied) called the 'build'
+ * function in the rule actions.
+ *
+ * This one takes a list of list of pathnames to build.
+ * This is a parallel conjonction of sequential alternatives.
+ * This means that in each sublist of pathnames, the first
+ * target that is buildable will be picked. The outer list
+ * denotes that one can build each target in parallel.
+ *)
and self_firsts depth on_the_go rss =
let results = List.map (self_first depth on_the_go []) rss in
let cmds, thunks =