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 LEVEL      := ..
     11 DIRS       :=
     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_top_srcdir@/../g' \
     20 	  -e 's/@DOT@/dot/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' > $@
     28 endif
     29 
     30 include $(LEVEL)/Makefile.common
     31 
     32 HTML       := $(wildcard $(PROJ_SRC_DIR)/*.html) \
     33               $(wildcard $(PROJ_SRC_DIR)/*.css)
     34 DOXYFILES  := doxygen.cfg.in doxygen.css doxygen.footer doxygen.header \
     35               doxygen.intro
     36 EXTRA_DIST := $(HTML) $(DOXYFILES) llvm.css CommandGuide
     37 
     38 .PHONY: install-html install-doxygen doxygen install-ocamldoc ocamldoc generated
     39 
     40 install_targets := install-html
     41 ifeq ($(ENABLE_DOXYGEN),1)
     42 install_targets += install-doxygen
     43 endif
     44 ifdef OCAMLDOC
     45 ifneq (,$(filter ocaml,$(BINDINGS_TO_BUILD)))
     46 install_targets += install-ocamldoc
     47 endif
     48 endif
     49 install-local:: $(install_targets)
     50 
     51 generated_targets := doxygen
     52 ifdef OCAMLDOC
     53 generated_targets += ocamldoc
     54 endif
     55 
     56 # Live documentation is generated for the web site using this target:
     57 # 'make generated BUILD_FOR_WEBSITE=1'
     58 generated:: $(generated_targets)
     59 
     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)
     65 
     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
     72 
     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 \;
     80 
     81 doxygen: regendoc $(PROJ_OBJ_DIR)/doxygen.tar.gz
     82 
     83 regendoc:
     84 	$(Echo) Building doxygen documentation
     85 	$(Verb) $(RM) -rf $(PROJ_OBJ_DIR)/doxygen
     86 	$(Verb) $(DOXYGEN) $(PROJ_OBJ_DIR)/doxygen.cfg
     87 
     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/
     94 
     95 userloc: $(LLVM_SRC_ROOT)/docs/userloc.html
     96 
     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
    101 
    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 \;
    109 
    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/
    116 
    117 regen-ocamldoc:
    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
    122 	$(Verb) \
    123 		$(OCAMLDOC) -d $(PROJ_OBJ_DIR)/ocamldoc/html -sort -colorize-code -html \
    124 		`$(FIND) $(LEVEL)/bindings/ocaml -name "*.odoc" -exec echo -load '{}' ';'`
    125 
    126 uninstall-local::
    127 	$(Echo) Uninstalling Documentation
    128 	$(Verb) $(RM) -rf $(DESTDIR)$(PROJ_docsdir)
    129