[llvm-commits] [llvm] r48147 - in /llvm/trunk: Makefile.config.in autoconf/configure.ac bindings/ocaml/Makefile bindings/ocaml/Makefile.ocaml docs/Makefile

Gordon Henriksen gordonhenriksen at mac.com
Mon Mar 10 08:49:16 PDT 2008


Author: gordon
Date: Mon Mar 10 10:49:16 2008
New Revision: 48147

URL: http://llvm.org/viewvc/llvm-project?rev=48147&view=rev
Log:
Adding ocamldoc generation.

Patch by Erick Tryzelaar.

Modified:
    llvm/trunk/Makefile.config.in
    llvm/trunk/autoconf/configure.ac
    llvm/trunk/bindings/ocaml/Makefile
    llvm/trunk/bindings/ocaml/Makefile.ocaml
    llvm/trunk/docs/Makefile

Modified: llvm/trunk/Makefile.config.in
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/Makefile.config.in?rev=48147&r1=48146&r2=48147&view=diff

==============================================================================
--- llvm/trunk/Makefile.config.in (original)
+++ llvm/trunk/Makefile.config.in Mon Mar 10 10:49:16 2008
@@ -154,6 +154,7 @@
 OCAMLC     := @OCAMLC@
 OCAMLOPT   := @OCAMLOPT@
 OCAMLDEP   := @OCAMLDEP@
+OCAMLDOC   := @OCAMLDOC@
 POD2HTML   := @POD2HTML@
 POD2MAN    := @POD2MAN@
 RUNTEST    := @RUNTEST@

Modified: llvm/trunk/autoconf/configure.ac
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/autoconf/configure.ac?rev=48147&r1=48146&r2=48147&view=diff

==============================================================================
--- llvm/trunk/autoconf/configure.ac (original)
+++ llvm/trunk/autoconf/configure.ac Mon Mar 10 10:49:16 2008
@@ -592,6 +592,7 @@
 AC_PATH_PROGS(OCAMLC, [ocamlc.opt ocamlc])
 AC_PATH_PROGS(OCAMLOPT, [ocamlopt.opt ocamlopt])
 AC_PATH_PROGS(OCAMLDEP, [ocamldep.opt ocamldep])
+AC_PATH_PROGS(OCAMLDOC, [ocamldoc.opt ocamldoc])
 
 dnl Determine if the linker supports the -R option.
 AC_LINK_USE_R

Modified: llvm/trunk/bindings/ocaml/Makefile
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/bindings/ocaml/Makefile?rev=48147&r1=48146&r2=48147&view=diff

==============================================================================
--- llvm/trunk/bindings/ocaml/Makefile (original)
+++ llvm/trunk/bindings/ocaml/Makefile Mon Mar 10 10:49:16 2008
@@ -10,4 +10,9 @@
 LEVEL := ../..
 DIRS = llvm bitreader bitwriter analysis executionengine
 
+ocamldoc:
+	$(Verb) for i in $(DIRS) ; do \
+		$(MAKE) -C $$i ocamldoc; \
+	done
+
 include $(LEVEL)/Makefile.common

Modified: llvm/trunk/bindings/ocaml/Makefile.ocaml
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/bindings/ocaml/Makefile.ocaml?rev=48147&r1=48146&r2=48147&view=diff

==============================================================================
--- llvm/trunk/bindings/ocaml/Makefile.ocaml (original)
+++ llvm/trunk/bindings/ocaml/Makefile.ocaml Mon Mar 10 10:49:16 2008
@@ -285,6 +285,13 @@
 
 endif
 
+##===- Generate documentation ---------------------------------------------===##
+
+$(ObjDir)/$(LIBRARYNAME).odoc: $(ObjectsCMI)
+	$(Echo) "Documenting $(notdir $@)"
+	$(Verb) $(OCAMLDOC) -I $(OcamlDir) -I $(ObjDir) -dump $@ $(OcamlHeaders)
+
+ocamldoc: $(ObjDir)/$(LIBRARYNAME).odoc
 
 ##===- Debugging gunk -----------------------------------------------------===##
 printvars:: printcamlvars

Modified: llvm/trunk/docs/Makefile
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/Makefile?rev=48147&r1=48146&r2=48147&view=diff

==============================================================================
--- llvm/trunk/docs/Makefile (original)
+++ llvm/trunk/docs/Makefile Mon Mar 10 10:49:16 2008
@@ -31,13 +31,16 @@
               doxygen.intro
 EXTRA_DIST := $(HTML) $(DOXYFILES) llvm.css CommandGuide img
 
-.PHONY: install-html install-doxygen doxygen
+.PHONY: install-html install-doxygen doxygen install-ocamldoc ocamldoc
 
+install_targets := install-html
 ifeq ($(ENABLE_DOXYGEN),1)
-install-local:: install-html install-doxygen
-else
-install-local:: install-html
+install_targets += install-doxygen
 endif
+ifneq (,$(filter ocaml,$(BINDINGS_TO_BUILD)))
+install_targets += install-ocamldoc
+endif
+install-local:: $(install_targets)
 
 install-html: $(PROJ_OBJ_DIR)/html.tar.gz
 	$(Echo) Installing HTML documentation
@@ -56,7 +59,6 @@
 
 install-doxygen: doxygen
 	$(Echo) Installing doxygen documentation
-	$(Echo) Installing doxygen documentation
 	$(Verb) $(MKDIR) $(PROJ_docsdir)/html/doxygen
 	$(Verb) $(DataInstall) $(PROJ_OBJ_DIR)/doxygen.tar.gz $(PROJ_docsdir)
 	$(Verb) cd $(PROJ_OBJ_DIR)/doxygen && \
@@ -85,4 +87,31 @@
 	$(Echo) Making User LOC Table
 	$(Verb) cd $(LLVM_SRC_ROOT) ; ./utils/userloc.pl -details -recurse \
 	  -html lib include tools runtime utils examples autoconf test > docs/userloc.html
-	  
+
+install-ocamldoc: ocamldoc
+	$(Echo) Installing ocamldoc documentation
+	$(Verb) $(MKDIR) $(PROJ_docsdir)/ocamldoc/html
+	$(Verb) $(DataInstall) $(PROJ_OBJ_DIR)/ocamldoc.tar.gz $(PROJ_docsdir)
+	$(Verb) cd $(PROJ_OBJ_DIR)/ocamldoc && \
+	  $(FIND) . -type f -exec \
+	    $(DataInstall) {} $(PROJ_docsdir)/ocamldoc/html \;
+
+ocamldoc: regen-ocamldoc $(PROJ_OBJ_DIR)/ocamldoc.tar.gz
+
+regen-ocamldoc:
+	$(Echo) Building ocamldoc documentation
+	$(Verb) if test -e $(PROJ_OBJ_DIR)/ocamldoc ; then \
+		$(RM) -rf $(PROJ_OBJ_DIR)/ocamldoc ; \
+	fi
+	$(Verb) $(MAKE) -C $(LEVEL)/bindings/ocaml ocamldoc
+	$(Verb) $(MKDIR) $(PROJ_OBJ_DIR)/ocamldoc/html
+	$(Verb) \
+		$(OCAMLDOC) -d $(PROJ_OBJ_DIR)/ocamldoc/html -sort -colorize-code -html \
+		`$(FIND) $(LEVEL)/bindings/ocaml -name "*.odoc" -exec echo -load '{}' ';'`
+
+$(PROJ_OBJ_DIR)/ocamldoc.tar.gz:
+	$(Echo) Packaging ocamldoc documentation
+	$(Verb) $(RM) -rf $@ $(PROJ_OBJ_DIR)/ocamldoc.tar
+	$(Verb) $(TAR) cf $(PROJ_OBJ_DIR)/ocamldoc.tar ocamldoc
+	$(Verb) $(GZIP) $(PROJ_OBJ_DIR)/ocamldoc.tar
+	$(Verb) $(CP) $(PROJ_OBJ_DIR)/ocamldoc.tar.gz $(PROJ_OBJ_DIR)/ocamldoc/html/





More information about the llvm-commits mailing list