1##===- docs/Makefile ---------------------------------------*- Makefile -*-===## 2# 3# The LLVM Compiler Infrastructure 4# 5# This file is distributed under the University of Illinois Open Source 6# License. See LICENSE.TXT for details. 7# 8##===----------------------------------------------------------------------===## 9 10LEVEL := .. 11DIRS := 12 13ifdef BUILD_FOR_WEBSITE 14PROJ_OBJ_DIR = . 15DOXYGEN = doxygen 16 17$(PROJ_OBJ_DIR)/doxygen.cfg: doxygen.cfg.in 18 cat $< | sed \ 19 -e 's/@DOT@/dot/g' \ 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' \ 35 > $@ 36endif 37 38include $(LEVEL)/Makefile.common 39 40HTML := $(wildcard $(PROJ_SRC_DIR)/*.html) \ 41 $(wildcard $(PROJ_SRC_DIR)/*.css) 42DOXYFILES := doxygen.cfg.in doxygen.intro 43 44.PHONY: install-html install-doxygen doxygen install-ocamldoc ocamldoc generated 45 46install_targets := install-html 47ifeq ($(ENABLE_DOXYGEN),1) 48install_targets += install-doxygen 49endif 50ifdef OCAMLFIND 51ifneq (,$(filter ocaml,$(BINDINGS_TO_BUILD))) 52install_targets += install-ocamldoc 53endif 54endif 55install-local:: $(install_targets) 56 57generated_targets := doxygen 58ifdef OCAMLFIND 59generated_targets += ocamldoc 60endif 61 62# Live documentation is generated for the web site using this target: 63# 'make generated BUILD_FOR_WEBSITE=1' 64generated:: $(generated_targets) 65 66install-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) 71 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 78 79install-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 \ 88 done 89 90doxygen: regendoc $(PROJ_OBJ_DIR)/doxygen.tar.gz 91 92regendoc: 93 $(Echo) Building doxygen documentation 94 $(Verb) $(RM) -rf $(PROJ_OBJ_DIR)/doxygen 95 $(Verb) $(DOXYGEN) $(PROJ_OBJ_DIR)/doxygen.cfg 96 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/ 103 104userloc: $(LLVM_SRC_ROOT)/docs/userloc.html 105 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 110 111install-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 \; 118 119ocamldoc: 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/ 125 126regen-ocamldoc: 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 131 $(Verb) \ 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 '{}' ';'` 135 136uninstall-local:: 137 $(Echo) Uninstalling Documentation 138 $(Verb) $(RM) -rf $(DESTDIR)$(PROJ_docsdir) 139