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 10CLANG_LEVEL := .. 11 12ifdef BUILD_FOR_WEBSITE 13PROJ_OBJ_DIR = . 14DOXYGEN = doxygen 15 16$(PROJ_OBJ_DIR)/doxygen.cfg: doxygen.cfg.in 17 cat $< | sed \ 18 -e 's/@DOT@/dot/g' \ 19 -e 's/@PACKAGE_VERSION@/mainline/' \ 20 -e 's/@abs_builddir@/./g' \ 21 -e 's/@abs_srcdir@/./g' \ 22 -e 's/@clang_doxygen_generate_qhp@/NO/g' \ 23 -e 's/@clang_doxygen_qch_filename@//g' \ 24 -e 's/@clang_doxygen_qhelpgenerator_path@//g' \ 25 -e 's/@clang_doxygen_qhp_cust_filter_attrs@//g' \ 26 -e 's/@clang_doxygen_qhp_cust_filter_name@//g' \ 27 -e 's/@clang_doxygen_qhp_namespace@//g' \ 28 -e 's/@enable_external_search@/NO/g' \ 29 -e 's/@enable_searchengine@/NO/g' \ 30 -e 's/@enable_server_based_search@/NO/g' \ 31 -e 's/@extra_search_mappings@//g' \ 32 -e 's/@searchengine_url@//g' \ 33 -e 's/@DOT_IMAGE_FORMAT@/png/g' \ 34 > $@ 35endif 36 37include $(CLANG_LEVEL)/Makefile 38 39HTML := $(wildcard $(PROJ_SRC_DIR)/*.html) \ 40 $(wildcard $(PROJ_SRC_DIR)/*.css) 41#IMAGES := $(wildcard $(PROJ_SRC_DIR)/img/*.*) 42DOXYFILES := doxygen.cfg.in doxygen.intro 43 44.PHONY: install-html install-doxygen doxygen generated 45 46install_targets := 47ifndef ONLY_MAN_DOCS 48install_targets += install-html 49endif 50ifeq ($(ENABLE_DOXYGEN),1) 51install_targets += install-doxygen 52endif 53install-local:: $(install_targets) 54 55# Live documentation is generated for the web site using this target: 56# 'make generated BUILD_FOR_WEBSITE=1' 57generated:: doxygen 58 59install-html: $(PROJ_OBJ_DIR)/html.tar.gz 60 $(Echo) Installing HTML documentation 61 $(Verb) $(MKDIR) $(DESTDIR)$(PROJ_docsdir)/html 62 $(Verb) $(MKDIR) $(DESTDIR)$(PROJ_docsdir)/html/img 63 $(Verb) $(DataInstall) $(HTML) $(DESTDIR)$(PROJ_docsdir)/html 64# $(Verb) $(DataInstall) $(IMAGES) $(DESTDIR)$(PROJ_docsdir)/html/img 65 $(Verb) $(DataInstall) $(PROJ_OBJ_DIR)/html.tar.gz $(DESTDIR)$(PROJ_docsdir) 66 67$(PROJ_OBJ_DIR)/html.tar.gz: $(HTML) 68 $(Echo) Packaging HTML documentation 69 $(Verb) $(RM) -rf $@ $(PROJ_OBJ_DIR)/html.tar 70 $(Verb) cd $(PROJ_SRC_DIR) && \ 71 $(TAR) cf $(PROJ_OBJ_DIR)/html.tar *.html 72 $(Verb) $(GZIPBIN) $(PROJ_OBJ_DIR)/html.tar 73 74install-doxygen: doxygen 75 $(Echo) Installing doxygen documentation 76 $(Verb) $(DataInstall) $(PROJ_OBJ_DIR)/doxygen.tar.gz $(DESTDIR)$(PROJ_docsdir) 77 $(Verb) cd $(PROJ_OBJ_DIR)/doxygen/html && \ 78 for DIR in $$($(FIND) . -type d); do \ 79 DESTSUB="$(DESTDIR)$(PROJ_docsdir)/html/doxygen/$$(echo $$DIR | cut -c 3-)"; \ 80 $(MKDIR) $$DESTSUB && \ 81 $(FIND) $$DIR -maxdepth 1 -type f -exec $(DataInstall) {} $$DESTSUB \; ; \ 82 if [ $$? != 0 ]; then exit 1; fi \ 83 done 84 85doxygen: regendoc $(PROJ_OBJ_DIR)/doxygen.tar.gz 86 87regendoc: 88 $(Echo) Building doxygen documentation 89 $(Verb) $(RM) -rf $(PROJ_OBJ_DIR)/doxygen 90 $(Verb) $(DOXYGEN) $(PROJ_OBJ_DIR)/doxygen.cfg 91 $(Verb) sed -i "s/[$$]LatestRev[$$]/`svnversion $(PROJ_SRC_DIR)`/g" \ 92 $(PROJ_OBJ_DIR)/doxygen/html/*.html 93 94$(PROJ_OBJ_DIR)/doxygen.tar.gz: $(DOXYFILES) $(PROJ_OBJ_DIR)/doxygen.cfg 95 $(Echo) Packaging doxygen documentation 96 $(Verb) $(RM) -rf $@ $(PROJ_OBJ_DIR)/doxygen.tar 97 $(Verb) $(TAR) cf $(PROJ_OBJ_DIR)/doxygen.tar doxygen 98 $(Verb) $(GZIPBIN) $(PROJ_OBJ_DIR)/doxygen.tar 99 $(Verb) $(CP) $(PROJ_OBJ_DIR)/doxygen.tar.gz $(PROJ_OBJ_DIR)/doxygen/html/ 100 101userloc: $(LLVM_SRC_ROOT)/docs/userloc.html 102 103$(LLVM_SRC_ROOT)/docs/userloc.html: 104 $(Echo) Making User LOC Table 105 $(Verb) cd $(LLVM_SRC_ROOT) ; ./utils/userloc.pl -details -recurse \ 106 -html lib include tools runtime utils examples autoconf test > docs/userloc.html 107 108uninstall-local:: 109 $(Echo) Uninstalling Documentation 110 $(Verb) $(RM) -rf $(DESTDIR)$(PROJ_docsdir) 111