Ostapers/ostap — pull request #1 by gasche (2013-10-29 09:54:37+00:00)
Title: fix root ostap.mlpack to avoid double-building

The meaning of "include" in ocamlbuild corresponds to an "open" in the
OCaml module system: the compilation units in the included directory
become available with their basename, without having to give their
directory as well. If you have a directory foo with module mod.ml, using
"foo": include
will make the module accessible as Mod, while with only
"foo": traverse
it is known by ocamlbuild, but only with name foo/Mod.

Before this patch, the makefile passed flag -I lib to the last packing
step, which means that 'Ostap' was an ambiguous name: it could be
produced from either the root ostap.mlpack or lib/ostap.mlpack. This
confused ocamlbuild digest checking (the caching information for both
packs is probably stored in the same place).

After this change, lib is not "include"-ed during the last packing
run, only traversed, and its modules are referred to explicit as, for
example, lib/BNF3 in the root ostap.mlpack.

You can check that running "make" a second time doesn't perform any
compilation anymore.

Note: the reason why there are two mlpack of the same name is that
pa_ostap produces code referring to the "Ostap" module directly. In
a usual project one would simply rename lib/ostap.mlpack into
something like lib/inner_ostap.mlpack, to avoid any confusion, but
here it is crucial that both packs have the same name to be able to
the same syntax extension (provided for users) to build the Util
module (in presence of a simplified Ostap module).