Home | History | Annotate | Download | only in docs
      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 
     10 CLANG_LEVEL := ..
     11 DIRS       := tools
     12 
     13 ifdef BUILD_FOR_WEBSITE
     14 PROJ_OBJ_DIR = .
     15 DOXYGEN = doxygen
     16 
     17 $(PROJ_OBJ_DIR)/doxygen.cfg: doxygen.cfg.in
     18 	cat $< | sed \
     19 	  -e 's/@abs_srcdir@/./g' \
     20 	  -e 's/@DOT@/dot/g' \
     21 	  -e 's/@PACKAGE_VERSION@/mainline/' \
     22 	  -e 's/@abs_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' > $@
     28 endif
     29 
     30 include $(CLANG_LEVEL)/Makefile
     31 
     32 HTML       := $(wildcard $(PROJ_SRC_DIR)/*.html) \
     33               $(wildcard $(PROJ_SRC_DIR)/*.css)
     34 #IMAGES     := $(wildcard $(PROJ_SRC_DIR)/img/*.*)
     35 DOXYFILES  := doxygen.cfg.in doxygen.css doxygen.footer doxygen.header \
     36               doxygen.intro
     37 EXTRA_DIST := $(HTML) $(DOXYFILES) llvm.css CommandGuide img
     38 
     39 .PHONY: install-html install-doxygen doxygen generated
     40 
     41 install_targets :=
     42 ifndef ONLY_MAN_DOCS
     43 install_targets += install-html
     44 endif
     45 ifeq ($(ENABLE_DOXYGEN),1)
     46 install_targets += install-doxygen
     47 endif
     48 install-local:: $(install_targets)
     49 
     50 # Live documentation is generated for the web site using this target:
     51 # 'make generated BUILD_FOR_WEBSITE=1'
     52 generated:: doxygen
     53 
     54 install-html: $(PROJ_OBJ_DIR)/html.tar.gz
     55 	$(Echo) Installing HTML documentation
     56 	$(Verb) $(MKDIR) $(DESTDIR)$(PROJ_docsdir)/html
     57 	$(Verb) $(MKDIR) $(DESTDIR)$(PROJ_docsdir)/html/img
     58 	$(Verb) $(DataInstall) $(HTML) $(DESTDIR)$(PROJ_docsdir)/html
     59 #	$(Verb) $(DataInstall) $(IMAGES) $(DESTDIR)$(PROJ_docsdir)/html/img
     60 	$(Verb) $(DataInstall) $(PROJ_OBJ_DIR)/html.tar.gz $(DESTDIR)$(PROJ_docsdir)
     61 
     62 $(PROJ_OBJ_DIR)/html.tar.gz: $(HTML)
     63 	$(Echo) Packaging HTML documentation
     64 	$(Verb) $(RM) -rf $@ $(PROJ_OBJ_DIR)/html.tar
     65 	$(Verb) cd $(PROJ_SRC_DIR) && \
     66 	  $(TAR) cf $(PROJ_OBJ_DIR)/html.tar *.html
     67 	$(Verb) $(GZIPBIN) $(PROJ_OBJ_DIR)/html.tar
     68 
     69 install-doxygen: doxygen
     70 	$(Echo) Installing doxygen documentation
     71 	$(Verb) $(MKDIR) $(DESTDIR)$(PROJ_docsdir)/html/doxygen
     72 	$(Verb) $(DataInstall) $(PROJ_OBJ_DIR)/doxygen.tar.gz $(DESTDIR)$(PROJ_docsdir)
     73 	$(Verb) cd $(PROJ_OBJ_DIR)/doxygen && \
     74 	  $(FIND) . -type f -exec \
     75 	    $(DataInstall) {} $(DESTDIR)$(PROJ_docsdir)/html/doxygen \;
     76 
     77 doxygen: regendoc $(PROJ_OBJ_DIR)/doxygen.tar.gz
     78 
     79 regendoc:
     80 	$(Echo) Building doxygen documentation
     81 	$(Verb) $(RM) -rf $(PROJ_OBJ_DIR)/doxygen
     82 	$(Verb) $(DOXYGEN) $(PROJ_OBJ_DIR)/doxygen.cfg
     83 	$(Verb) sed -i "s/[$$]LatestRev[$$]/`svnversion $(PROJ_SRC_DIR)`/g" \
     84 	 $(PROJ_OBJ_DIR)/doxygen/html/*.html
     85 
     86 $(PROJ_OBJ_DIR)/doxygen.tar.gz: $(DOXYFILES) $(PROJ_OBJ_DIR)/doxygen.cfg
     87 	$(Echo) Packaging doxygen documentation
     88 	$(Verb) $(RM) -rf $@ $(PROJ_OBJ_DIR)/doxygen.tar
     89 	$(Verb) $(TAR) cf $(PROJ_OBJ_DIR)/doxygen.tar doxygen
     90 	$(Verb) $(GZIPBIN) $(PROJ_OBJ_DIR)/doxygen.tar
     91 	$(Verb) $(CP) $(PROJ_OBJ_DIR)/doxygen.tar.gz $(PROJ_OBJ_DIR)/doxygen/html/
     92 
     93 userloc: $(LLVM_SRC_ROOT)/docs/userloc.html
     94 
     95 $(LLVM_SRC_ROOT)/docs/userloc.html:
     96 	$(Echo) Making User LOC Table
     97 	$(Verb) cd $(LLVM_SRC_ROOT) ; ./utils/userloc.pl -details -recurse \
     98 	  -html lib include tools runtime utils examples autoconf test > docs/userloc.html
     99 
    100 uninstall-local::
    101 	$(Echo) Uninstalling Documentation
    102 	$(Verb) $(RM) -rf $(DESTDIR)$(PROJ_docsdir)
    103