llvm.org GIT mirror llvm / b047766
Adding ocamldoc generation. Patch by Erick Tryzelaar. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48147 91177308-0d34-0410-b5e6-96231b3b80d8 Gordon Henriksen 11 years ago
5 changed file(s) with 49 addition(s) and 6 deletion(s). Raw diff Collapse all Expand all
153153 OCAMLC := @OCAMLC@
154154 OCAMLOPT := @OCAMLOPT@
155155 OCAMLDEP := @OCAMLDEP@
156 OCAMLDOC := @OCAMLDOC@
156157 POD2HTML := @POD2HTML@
157158 POD2MAN := @POD2MAN@
158159 RUNTEST := @RUNTEST@
591591 AC_PATH_PROGS(OCAMLC, [ocamlc.opt ocamlc])
592592 AC_PATH_PROGS(OCAMLOPT, [ocamlopt.opt ocamlopt])
593593 AC_PATH_PROGS(OCAMLDEP, [ocamldep.opt ocamldep])
594 AC_PATH_PROGS(OCAMLDOC, [ocamldoc.opt ocamldoc])
594595
595596 dnl Determine if the linker supports the -R option.
596597 AC_LINK_USE_R
99 LEVEL := ../..
1010 DIRS = llvm bitreader bitwriter analysis executionengine
1111
12 ocamldoc:
13 $(Verb) for i in $(DIRS) ; do \
14 $(MAKE) -C $$i ocamldoc; \
15 done
16
1217 include $(LEVEL)/Makefile.common
284284
285285 endif
286286
287 ##===- Generate documentation ---------------------------------------------===##
288
289 $(ObjDir)/$(LIBRARYNAME).odoc: $(ObjectsCMI)
290 $(Echo) "Documenting $(notdir $@)"
291 $(Verb) $(OCAMLDOC) -I $(OcamlDir) -I $(ObjDir) -dump $@ $(OcamlHeaders)
292
293 ocamldoc: $(ObjDir)/$(LIBRARYNAME).odoc
287294
288295 ##===- Debugging gunk -----------------------------------------------------===##
289296 printvars:: printcamlvars
3030 doxygen.intro
3131 EXTRA_DIST := $(HTML) $(DOXYFILES) llvm.css CommandGuide img
3232
33 .PHONY: install-html install-doxygen doxygen
33 .PHONY: install-html install-doxygen doxygen install-ocamldoc ocamldoc
3434
35 install_targets := install-html
3536 ifeq ($(ENABLE_DOXYGEN),1)
36 install-local:: install-html install-doxygen
37 else
38 install-local:: install-html
37 install_targets += install-doxygen
3938 endif
39 ifneq (,$(filter ocaml,$(BINDINGS_TO_BUILD)))
40 install_targets += install-ocamldoc
41 endif
42 install-local:: $(install_targets)
4043
4144 install-html: $(PROJ_OBJ_DIR)/html.tar.gz
4245 $(Echo) Installing HTML documentation
5457 $(Verb) $(GZIP) $(PROJ_OBJ_DIR)/html.tar
5558
5659 install-doxygen: doxygen
57 $(Echo) Installing doxygen documentation
5860 $(Echo) Installing doxygen documentation
5961 $(Verb) $(MKDIR) $(PROJ_docsdir)/html/doxygen
6062 $(Verb) $(DataInstall) $(PROJ_OBJ_DIR)/doxygen.tar.gz $(PROJ_docsdir)
8486 $(Echo) Making User LOC Table
8587 $(Verb) cd $(LLVM_SRC_ROOT) ; ./utils/userloc.pl -details -recurse \
8688 -html lib include tools runtime utils examples autoconf test > docs/userloc.html
87
89
90 install-ocamldoc: ocamldoc
91 $(Echo) Installing ocamldoc documentation
92 $(Verb) $(MKDIR) $(PROJ_docsdir)/ocamldoc/html
93 $(Verb) $(DataInstall) $(PROJ_OBJ_DIR)/ocamldoc.tar.gz $(PROJ_docsdir)
94 $(Verb) cd $(PROJ_OBJ_DIR)/ocamldoc && \
95 $(FIND) . -type f -exec \
96 $(DataInstall) {} $(PROJ_docsdir)/ocamldoc/html \;
97
98 ocamldoc: regen-ocamldoc $(PROJ_OBJ_DIR)/ocamldoc.tar.gz
99
100 regen-ocamldoc:
101 $(Echo) Building ocamldoc documentation
102 $(Verb) if test -e $(PROJ_OBJ_DIR)/ocamldoc ; then \
103 $(RM) -rf $(PROJ_OBJ_DIR)/ocamldoc ; \
104 fi
105 $(Verb) $(MAKE) -C $(LEVEL)/bindings/ocaml ocamldoc
106 $(Verb) $(MKDIR) $(PROJ_OBJ_DIR)/ocamldoc/html
107 $(Verb) \
108 $(OCAMLDOC) -d $(PROJ_OBJ_DIR)/ocamldoc/html -sort -colorize-code -html \
109 `$(FIND) $(LEVEL)/bindings/ocaml -name "*.odoc" -exec echo -load '{}' ';'`
110
111 $(PROJ_OBJ_DIR)/ocamldoc.tar.gz:
112 $(Echo) Packaging ocamldoc documentation
113 $(Verb) $(RM) -rf $@ $(PROJ_OBJ_DIR)/ocamldoc.tar
114 $(Verb) $(TAR) cf $(PROJ_OBJ_DIR)/ocamldoc.tar ocamldoc
115 $(Verb) $(GZIP) $(PROJ_OBJ_DIR)/ocamldoc.tar
116 $(Verb) $(CP) $(PROJ_OBJ_DIR)/ocamldoc.tar.gz $(PROJ_OBJ_DIR)/ocamldoc/html/