summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGordon Henriksen <gordonhenriksen@mac.com>2008-03-10 15:49:16 +0000
committerGordon Henriksen <gordonhenriksen@mac.com>2008-03-10 15:49:16 +0000
commitb04776696359e54153e20c426419fe54b6766473 (patch)
tree68e231db7372b409c5c8661543d2ee395afccb25
parenta523380c6b5ad1d53dc7b38e9aee6bc9868d18c5 (diff)
downloadllvm-b04776696359e54153e20c426419fe54b6766473.tar.gz
llvm-b04776696359e54153e20c426419fe54b6766473.tar.bz2
llvm-b04776696359e54153e20c426419fe54b6766473.tar.xz
Adding ocamldoc generation.
Patch by Erick Tryzelaar. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48147 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--Makefile.config.in1
-rw-r--r--autoconf/configure.ac1
-rw-r--r--bindings/ocaml/Makefile5
-rw-r--r--bindings/ocaml/Makefile.ocaml7
-rw-r--r--docs/Makefile41
5 files changed, 49 insertions, 6 deletions
diff --git a/Makefile.config.in b/Makefile.config.in
index 94dce300bb..f3a9346592 100644
--- a/Makefile.config.in
+++ b/Makefile.config.in
@@ -154,6 +154,7 @@ GZIP := @GZIP@
OCAMLC := @OCAMLC@
OCAMLOPT := @OCAMLOPT@
OCAMLDEP := @OCAMLDEP@
+OCAMLDOC := @OCAMLDOC@
POD2HTML := @POD2HTML@
POD2MAN := @POD2MAN@
RUNTEST := @RUNTEST@
diff --git a/autoconf/configure.ac b/autoconf/configure.ac
index b6f23a381c..86459b8f71 100644
--- a/autoconf/configure.ac
+++ b/autoconf/configure.ac
@@ -592,6 +592,7 @@ AC_PATH_PROG(ZIP, [zip])
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
diff --git a/bindings/ocaml/Makefile b/bindings/ocaml/Makefile
index 5cd3b89b57..5f1788e33e 100644
--- a/bindings/ocaml/Makefile
+++ b/bindings/ocaml/Makefile
@@ -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
diff --git a/bindings/ocaml/Makefile.ocaml b/bindings/ocaml/Makefile.ocaml
index 8edb180c3d..55a052af7e 100644
--- a/bindings/ocaml/Makefile.ocaml
+++ b/bindings/ocaml/Makefile.ocaml
@@ -285,6 +285,13 @@ uninstall-cmxa::
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
diff --git a/docs/Makefile b/docs/Makefile
index a66d5ae4e8..1b5987914d 100644
--- a/docs/Makefile
+++ b/docs/Makefile
@@ -31,13 +31,16 @@ DOXYFILES := doxygen.cfg.in doxygen.css doxygen.footer doxygen.header \
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 @@ $(PROJ_OBJ_DIR)/html.tar.gz: $(HTML)
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 @@ $(LLVM_SRC_ROOT)/docs/userloc.html:
$(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/