1 ##===- docs/Makefile ---------------------------------------*- Makefile -*-===##
3 # The LLVM Compiler Infrastructure
5 # This file is distributed under the University of Illinois Open Source
6 # License. See LICENSE.TXT for details.
8 ##===----------------------------------------------------------------------===##
13 ifdef BUILD_FOR_WEBSITE
17 $(PROJ_OBJ_DIR)/doxygen.cfg: doxygen.cfg.in
20 -e 's/@PACKAGE_VERSION@/mainline/' \
21 -e 's/@abs_top_builddir@/../g' \
22 -e 's/@abs_top_srcdir@/../g' \
23 -e 's/@enable_external_search@/NO/g' \
24 -e 's/@enable_searchengine@/NO/g' \
25 -e 's/@enable_server_based_search@/NO/g' \
26 -e 's/@extra_search_mappings@//g' \
27 -e 's/@llvm_doxygen_generate_qhp@//g' \
28 -e 's/@llvm_doxygen_qch_filename@//g' \
29 -e 's/@llvm_doxygen_qhelpgenerator_path@//g' \
30 -e 's/@llvm_doxygen_qhp_cust_filter_attrs@//g' \
31 -e 's/@llvm_doxygen_qhp_cust_filter_name@//g' \
32 -e 's/@llvm_doxygen_qhp_namespace@//g' \
33 -e 's/@searchengine_url@//g' \
37 include $(LEVEL)/Makefile.common
39 HTML := $(wildcard $(PROJ_SRC_DIR)/*.html) \
40 $(wildcard $(PROJ_SRC_DIR)/*.css)
41 DOXYFILES := doxygen.cfg.in doxygen.intro
43 .PHONY: install-html install-doxygen doxygen install-ocamldoc ocamldoc generated
45 install_targets := install-html
46 ifeq ($(ENABLE_DOXYGEN),1)
47 install_targets += install-doxygen
50 ifneq (,$(filter ocaml,$(BINDINGS_TO_BUILD)))
51 install_targets += install-ocamldoc
54 install-local:: $(install_targets)
56 generated_targets := doxygen
58 generated_targets += ocamldoc
61 # Live documentation is generated for the web site using this target:
62 # 'make generated BUILD_FOR_WEBSITE=1'
63 generated:: $(generated_targets)
65 install-html: $(PROJ_OBJ_DIR)/html.tar.gz
66 $(Echo) Installing HTML documentation
67 $(Verb) $(MKDIR) $(DESTDIR)$(PROJ_docsdir)/html
68 $(Verb) $(DataInstall) $(HTML) $(DESTDIR)$(PROJ_docsdir)/html
69 $(Verb) $(DataInstall) $(PROJ_OBJ_DIR)/html.tar.gz $(DESTDIR)$(PROJ_docsdir)
71 $(PROJ_OBJ_DIR)/html.tar.gz: $(HTML)
72 $(Echo) Packaging HTML documentation
73 $(Verb) $(RM) -rf $@ $(PROJ_OBJ_DIR)/html.tar
74 $(Verb) cd $(PROJ_SRC_DIR) && \
75 $(TAR) cf $(PROJ_OBJ_DIR)/html.tar *.html
76 $(Verb) $(GZIPBIN) $(PROJ_OBJ_DIR)/html.tar
78 install-doxygen: doxygen
79 $(Echo) Installing doxygen documentation
80 $(Verb) $(DataInstall) $(PROJ_OBJ_DIR)/doxygen.tar.gz $(DESTDIR)$(PROJ_docsdir)
81 $(Verb) cd $(PROJ_OBJ_DIR)/doxygen/html && \
82 for DIR in $$($(FIND) . -type d); do \
83 DESTSUB="$(DESTDIR)$(PROJ_docsdir)/html/doxygen/$$(echo $$DIR | cut -c 3-)"; \
84 $(MKDIR) $$DESTSUB && \
85 $(FIND) $$DIR -maxdepth 1 -type f -exec $(DataInstall) {} $$DESTSUB \; ; \
86 if [ $$? != 0 ]; then exit 1; fi \
89 doxygen: regendoc $(PROJ_OBJ_DIR)/doxygen.tar.gz
92 $(Echo) Building doxygen documentation
93 $(Verb) $(RM) -rf $(PROJ_OBJ_DIR)/doxygen
94 $(Verb) $(DOXYGEN) $(PROJ_OBJ_DIR)/doxygen.cfg
96 $(PROJ_OBJ_DIR)/doxygen.tar.gz: $(DOXYFILES) $(PROJ_OBJ_DIR)/doxygen.cfg
97 $(Echo) Packaging doxygen documentation
98 $(Verb) $(RM) -rf $@ $(PROJ_OBJ_DIR)/doxygen.tar
99 $(Verb) $(TAR) cf $(PROJ_OBJ_DIR)/doxygen.tar doxygen
100 $(Verb) $(GZIPBIN) $(PROJ_OBJ_DIR)/doxygen.tar
101 $(Verb) $(CP) $(PROJ_OBJ_DIR)/doxygen.tar.gz $(PROJ_OBJ_DIR)/doxygen/html/
103 userloc: $(LLVM_SRC_ROOT)/docs/userloc.html
105 $(LLVM_SRC_ROOT)/docs/userloc.html:
106 $(Echo) Making User LOC Table
107 $(Verb) cd $(LLVM_SRC_ROOT) ; ./utils/userloc.pl -details -recurse \
108 -html lib include tools runtime utils examples autoconf test > docs/userloc.html
110 install-ocamldoc: ocamldoc
111 $(Echo) Installing ocamldoc documentation
112 $(Verb) $(MKDIR) $(DESTDIR)$(PROJ_docsdir)/ocamldoc/html
113 $(Verb) $(DataInstall) $(PROJ_OBJ_DIR)/ocamldoc.tar.gz $(DESTDIR)$(PROJ_docsdir)
114 $(Verb) cd $(PROJ_OBJ_DIR)/ocamldoc && \
115 $(FIND) . -type f -exec \
116 $(DataInstall) {} $(DESTDIR)$(PROJ_docsdir)/ocamldoc/html \;
118 ocamldoc: regen-ocamldoc
119 $(Echo) Packaging ocamldoc documentation
120 $(Verb) $(RM) -rf $(PROJ_OBJ_DIR)/ocamldoc.tar*
121 $(Verb) $(TAR) cf $(PROJ_OBJ_DIR)/ocamldoc.tar ocamldoc
122 $(Verb) $(GZIPBIN) $(PROJ_OBJ_DIR)/ocamldoc.tar
123 $(Verb) $(CP) $(PROJ_OBJ_DIR)/ocamldoc.tar.gz $(PROJ_OBJ_DIR)/ocamldoc/html/
126 $(Echo) Building ocamldoc documentation
127 $(Verb) $(RM) -rf $(PROJ_OBJ_DIR)/ocamldoc
128 $(Verb) $(MAKE) -C $(LEVEL)/bindings/ocaml ocamldoc
129 $(Verb) $(MKDIR) $(PROJ_OBJ_DIR)/ocamldoc/html
131 $(OCAMLFIND) ocamldoc -d $(PROJ_OBJ_DIR)/ocamldoc/html -sort -colorize-code -html \
132 `$(FIND) $(LEVEL)/bindings/ocaml -name "*.odoc" \
133 -path "*/$(BuildMode)/*.odoc" -exec echo -load '{}' ';'`
136 $(Echo) Uninstalling Documentation
137 $(Verb) $(RM) -rf $(DESTDIR)$(PROJ_docsdir)