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' \
34 -e 's/@DOT_IMAGE_FORMAT@/png/g' \
38 include $(LEVEL)/Makefile.common
40 HTML := $(wildcard $(PROJ_SRC_DIR)/*.html) \
41 $(wildcard $(PROJ_SRC_DIR)/*.css)
42 DOXYFILES := doxygen.cfg.in doxygen.intro
44 .PHONY: install-html install-doxygen doxygen install-ocamldoc ocamldoc generated
46 install_targets := install-html
47 ifeq ($(ENABLE_DOXYGEN),1)
48 install_targets += install-doxygen
51 ifneq (,$(filter ocaml,$(BINDINGS_TO_BUILD)))
52 install_targets += install-ocamldoc
55 install-local:: $(install_targets)
57 generated_targets := doxygen
59 generated_targets += ocamldoc
62 # Live documentation is generated for the web site using this target:
63 # 'make generated BUILD_FOR_WEBSITE=1'
64 generated:: $(generated_targets)
66 install-html: $(PROJ_OBJ_DIR)/html.tar.gz
67 $(Echo) Installing HTML documentation
68 $(Verb) $(MKDIR) $(DESTDIR)$(PROJ_docsdir)/html
69 $(Verb) $(DataInstall) $(HTML) $(DESTDIR)$(PROJ_docsdir)/html
70 $(Verb) $(DataInstall) $(PROJ_OBJ_DIR)/html.tar.gz $(DESTDIR)$(PROJ_docsdir)
72 $(PROJ_OBJ_DIR)/html.tar.gz: $(HTML)
73 $(Echo) Packaging HTML documentation
74 $(Verb) $(RM) -rf $@ $(PROJ_OBJ_DIR)/html.tar
75 $(Verb) cd $(PROJ_SRC_DIR) && \
76 $(TAR) cf $(PROJ_OBJ_DIR)/html.tar *.html
77 $(Verb) $(GZIPBIN) $(PROJ_OBJ_DIR)/html.tar
79 install-doxygen: doxygen
80 $(Echo) Installing doxygen documentation
81 $(Verb) $(DataInstall) $(PROJ_OBJ_DIR)/doxygen.tar.gz $(DESTDIR)$(PROJ_docsdir)
82 $(Verb) cd $(PROJ_OBJ_DIR)/doxygen/html && \
83 for DIR in $$($(FIND) . -type d); do \
84 DESTSUB="$(DESTDIR)$(PROJ_docsdir)/html/doxygen/$$(echo $$DIR | cut -c 3-)"; \
85 $(MKDIR) $$DESTSUB && \
86 $(FIND) $$DIR -maxdepth 1 -type f -exec $(DataInstall) {} $$DESTSUB \; ; \
87 if [ $$? != 0 ]; then exit 1; fi \
90 doxygen: regendoc $(PROJ_OBJ_DIR)/doxygen.tar.gz
93 $(Echo) Building doxygen documentation
94 $(Verb) $(RM) -rf $(PROJ_OBJ_DIR)/doxygen
95 $(Verb) $(DOXYGEN) $(PROJ_OBJ_DIR)/doxygen.cfg
97 $(PROJ_OBJ_DIR)/doxygen.tar.gz: $(DOXYFILES) $(PROJ_OBJ_DIR)/doxygen.cfg
98 $(Echo) Packaging doxygen documentation
99 $(Verb) $(RM) -rf $@ $(PROJ_OBJ_DIR)/doxygen.tar
100 $(Verb) $(TAR) cf $(PROJ_OBJ_DIR)/doxygen.tar doxygen
101 $(Verb) $(GZIPBIN) $(PROJ_OBJ_DIR)/doxygen.tar
102 $(Verb) $(CP) $(PROJ_OBJ_DIR)/doxygen.tar.gz $(PROJ_OBJ_DIR)/doxygen/html/
104 userloc: $(LLVM_SRC_ROOT)/docs/userloc.html
106 $(LLVM_SRC_ROOT)/docs/userloc.html:
107 $(Echo) Making User LOC Table
108 $(Verb) cd $(LLVM_SRC_ROOT) ; ./utils/userloc.pl -details -recurse \
109 -html lib include tools runtime utils examples autoconf test > docs/userloc.html
111 install-ocamldoc: ocamldoc
112 $(Echo) Installing ocamldoc documentation
113 $(Verb) $(MKDIR) $(DESTDIR)$(PROJ_docsdir)/ocamldoc/html
114 $(Verb) $(DataInstall) $(PROJ_OBJ_DIR)/ocamldoc.tar.gz $(DESTDIR)$(PROJ_docsdir)
115 $(Verb) cd $(PROJ_OBJ_DIR)/ocamldoc && \
116 $(FIND) . -type f -exec \
117 $(DataInstall) {} $(DESTDIR)$(PROJ_docsdir)/ocamldoc/html \;
119 ocamldoc: regen-ocamldoc
120 $(Echo) Packaging ocamldoc documentation
121 $(Verb) $(RM) -rf $(PROJ_OBJ_DIR)/ocamldoc.tar*
122 $(Verb) $(TAR) cf $(PROJ_OBJ_DIR)/ocamldoc.tar ocamldoc
123 $(Verb) $(GZIPBIN) $(PROJ_OBJ_DIR)/ocamldoc.tar
124 $(Verb) $(CP) $(PROJ_OBJ_DIR)/ocamldoc.tar.gz $(PROJ_OBJ_DIR)/ocamldoc/html/
127 $(Echo) Building ocamldoc documentation
128 $(Verb) $(RM) -rf $(PROJ_OBJ_DIR)/ocamldoc
129 $(Verb) $(MAKE) -C $(LEVEL)/bindings/ocaml ocamldoc
130 $(Verb) $(MKDIR) $(PROJ_OBJ_DIR)/ocamldoc/html
132 $(OCAMLFIND) ocamldoc -d $(PROJ_OBJ_DIR)/ocamldoc/html -sort -colorize-code -html \
133 `$(FIND) $(LEVEL)/bindings/ocaml -name "*.odoc" \
134 -path "*/$(BuildMode)/*.odoc" -exec echo -load '{}' ';'`
137 $(Echo) Uninstalling Documentation
138 $(Verb) $(RM) -rf $(DESTDIR)$(PROJ_docsdir)