[llvm-commits] [PATCH] Add support for generating ocaml documentation.

Gordon Henriksen gordonhenriksen at mac.com
Mon Mar 31 11:09:24 PDT 2008


On Mar 9, 2008, at 05:16, Erick Tryzelaar wrote:

> This patch integrates automatic generation of ocaml documation
> with the build system. It copies the doxygen install and
> directory hierarchy. Gordon, I'll leave the re-configuration to
> you.
> ---
> Makefile.config.in            |    4 ++++
> autoconf/configure.ac         |   13 +++++++++++++
> bindings/ocaml/Makefile       |    6 ++++++
> bindings/ocaml/Makefile.ocaml |    6 ++++++
> docs/Makefile                 |   41 ++++++++++++++++++++++++++++++++ 
> +++------
> 5 files changed, 64 insertions(+), 6 deletions(-)


Hi Erick,

Could you see if it's possible to get this set up so that it builds  
without having previously built the rest of the source tree?

I guess there are two approaches here. The first is modifying  
Makefile.ocaml up so that it doesn't rely upon llvm-config when  
invoking just the 'ocamldoc' target. I expect that's not practical.

The second would be to not invoke those makefiles at all, which does  
mean we have to work harder to find source files to ocamldoc. We have  
to be careful because the .mli's are copied into the intermediate  
Debug|Release|Release+Asserts|etc. build directory for compatibility  
with retrograde compilers that don't support -c -o. It makes me  
squeamish, but something like this command seems to work:

find `find $(LLVM_SRC_DIR)/bindings/ocaml -name Makefile -exec dirname  
'{}' ';'` -type d -depth 1 -prune -o -name '*.mli' -print

Hopefully, just handing that blob off to ocamldoc and generating a  
single .odoc dump for the entire tree will work.

Please test your changes with both srcdir=objdir and srcdir≠objdir  
builds; both offer gotchas in this instance.

Thanks!
— Gordon


P.S. –
You can quickly achieve a pseudo-pristine source tree like this:

svn status --no-ignore | perl -ne '/^I      (.*)/ && print "$1\0"' |  
xargs -0 rm -rf

(That nukes all the svn:ignore'd files.)





More information about the llvm-commits mailing list