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
19 -e 's/@abs_top_srcdir@/../g' \
21 -e 's/@PACKAGE_VERSION@/mainline/' \
22 -e 's/@abs_top_builddir@/../g' \
23 -e 's/@enable_searchengine@/NO/g' \
24 -e 's/@searchengine_url@//g' \
25 -e 's/@enable_server_based_search@/NO/g' \
26 -e 's/@enable_external_search@/NO/g' \
27 -e 's/@extra_search_mappings@//g' > $@
30 include $(LEVEL)/Makefile.common
32 HTML := $(wildcard $(PROJ_SRC_DIR)/*.html) \
33 $(wildcard $(PROJ_SRC_DIR)/*.css)
34 DOXYFILES := doxygen.cfg.in doxygen.css doxygen.footer doxygen.header \
36 EXTRA_DIST := $(HTML) $(DOXYFILES) llvm.css CommandGuide
38 .PHONY: install-html install-doxygen doxygen install-ocamldoc ocamldoc generated
40 install_targets := install-html
41 ifeq ($(ENABLE_DOXYGEN),1)
42 install_targets += install-doxygen
45 ifneq (,$(filter ocaml,$(BINDINGS_TO_BUILD)))
46 install_targets += install-ocamldoc
49 install-local:: $(install_targets)
51 generated_targets := doxygen
53 generated_targets += ocamldoc
56 # Live documentation is generated for the web site using this target:
57 # 'make generated BUILD_FOR_WEBSITE=1'
58 generated:: $(generated_targets)
60 install-html: $(PROJ_OBJ_DIR)/html.tar.gz
61 $(Echo) Installing HTML documentation
62 $(Verb) $(MKDIR) $(DESTDIR)$(PROJ_docsdir)/html
63 $(Verb) $(DataInstall) $(HTML) $(DESTDIR)$(PROJ_docsdir)/html
64 $(Verb) $(DataInstall) $(PROJ_OBJ_DIR)/html.tar.gz $(DESTDIR)$(PROJ_docsdir)
66 $(PROJ_OBJ_DIR)/html.tar.gz: $(HTML)
67 $(Echo) Packaging HTML documentation
68 $(Verb) $(RM) -rf $@ $(PROJ_OBJ_DIR)/html.tar
69 $(Verb) cd $(PROJ_SRC_DIR) && \
70 $(TAR) cf $(PROJ_OBJ_DIR)/html.tar *.html
71 $(Verb) $(GZIPBIN) $(PROJ_OBJ_DIR)/html.tar
73 install-doxygen: doxygen
74 $(Echo) Installing doxygen documentation
75 $(Verb) $(MKDIR) $(DESTDIR)$(PROJ_docsdir)/html/doxygen
76 $(Verb) $(DataInstall) $(PROJ_OBJ_DIR)/doxygen.tar.gz $(DESTDIR)$(PROJ_docsdir)
77 $(Verb) cd $(PROJ_OBJ_DIR)/doxygen && \
78 $(FIND) . -type f -exec \
79 $(DataInstall) {} $(DESTDIR)$(PROJ_docsdir)/html/doxygen \;
81 doxygen: regendoc $(PROJ_OBJ_DIR)/doxygen.tar.gz
84 $(Echo) Building doxygen documentation
85 $(Verb) $(RM) -rf $(PROJ_OBJ_DIR)/doxygen
86 $(Verb) $(DOXYGEN) $(PROJ_OBJ_DIR)/doxygen.cfg
88 $(PROJ_OBJ_DIR)/doxygen.tar.gz: $(DOXYFILES) $(PROJ_OBJ_DIR)/doxygen.cfg
89 $(Echo) Packaging doxygen documentation
90 $(Verb) $(RM) -rf $@ $(PROJ_OBJ_DIR)/doxygen.tar
91 $(Verb) $(TAR) cf $(PROJ_OBJ_DIR)/doxygen.tar doxygen
92 $(Verb) $(GZIPBIN) $(PROJ_OBJ_DIR)/doxygen.tar
93 $(Verb) $(CP) $(PROJ_OBJ_DIR)/doxygen.tar.gz $(PROJ_OBJ_DIR)/doxygen/html/
95 userloc: $(LLVM_SRC_ROOT)/docs/userloc.html
97 $(LLVM_SRC_ROOT)/docs/userloc.html:
98 $(Echo) Making User LOC Table
99 $(Verb) cd $(LLVM_SRC_ROOT) ; ./utils/userloc.pl -details -recurse \
100 -html lib include tools runtime utils examples autoconf test > docs/userloc.html
102 install-ocamldoc: ocamldoc
103 $(Echo) Installing ocamldoc documentation
104 $(Verb) $(MKDIR) $(DESTDIR)$(PROJ_docsdir)/ocamldoc/html
105 $(Verb) $(DataInstall) $(PROJ_OBJ_DIR)/ocamldoc.tar.gz $(DESTDIR)$(PROJ_docsdir)
106 $(Verb) cd $(PROJ_OBJ_DIR)/ocamldoc && \
107 $(FIND) . -type f -exec \
108 $(DataInstall) {} $(DESTDIR)$(PROJ_docsdir)/ocamldoc/html \;
110 ocamldoc: regen-ocamldoc
111 $(Echo) Packaging ocamldoc documentation
112 $(Verb) $(RM) -rf $(PROJ_OBJ_DIR)/ocamldoc.tar*
113 $(Verb) $(TAR) cf $(PROJ_OBJ_DIR)/ocamldoc.tar ocamldoc
114 $(Verb) $(GZIPBIN) $(PROJ_OBJ_DIR)/ocamldoc.tar
115 $(Verb) $(CP) $(PROJ_OBJ_DIR)/ocamldoc.tar.gz $(PROJ_OBJ_DIR)/ocamldoc/html/
118 $(Echo) Building ocamldoc documentation
119 $(Verb) $(RM) -rf $(PROJ_OBJ_DIR)/ocamldoc
120 $(Verb) $(MAKE) -C $(LEVEL)/bindings/ocaml ocamldoc
121 $(Verb) $(MKDIR) $(PROJ_OBJ_DIR)/ocamldoc/html
123 $(OCAMLDOC) -d $(PROJ_OBJ_DIR)/ocamldoc/html -sort -colorize-code -html \
124 `$(FIND) $(LEVEL)/bindings/ocaml -name "*.odoc" -exec echo -load '{}' ';'`
127 $(Echo) Uninstalling Documentation
128 $(Verb) $(RM) -rf $(DESTDIR)$(PROJ_docsdir)