John Criswell | d8846c1 | 2003-10-21 14:33:46 +0000 | [diff] [blame] | 1 | ##===- docs/Makefile ---------------------------------------*- Makefile -*-===## |
| 2 | # |
| 3 | # The LLVM Compiler Infrastructure |
| 4 | # |
Chris Lattner | 57360d1 | 2007-12-29 20:11:13 +0000 | [diff] [blame] | 5 | # This file is distributed under the University of Illinois Open Source |
| 6 | # License. See LICENSE.TXT for details. |
John Criswell | d8846c1 | 2003-10-21 14:33:46 +0000 | [diff] [blame] | 7 | # |
| 8 | ##===----------------------------------------------------------------------===## |
Chris Lattner | b9a827c | 2002-01-30 21:20:23 +0000 | [diff] [blame] | 9 | |
mike-m | e2c3a49 | 2010-05-07 00:28:04 +0000 | [diff] [blame] | 10 | LEVEL := .. |
| 11 | DIRS := CommandGuide tutorial |
| 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 | endif |
Chris Lattner | 9e4692c | 2006-07-06 00:36:52 +0000 | [diff] [blame] | 24 | |
Reid Spencer | ca5fc7b | 2004-11-29 04:47:35 +0000 | [diff] [blame] | 25 | include $(LEVEL)/Makefile.common |
mike-m | e2c3a49 | 2010-05-07 00:28:04 +0000 | [diff] [blame] | 26 | |
| 27 | HTML := $(wildcard $(PROJ_SRC_DIR)/*.html) \ |
| 28 | $(wildcard $(PROJ_SRC_DIR)/*.css) |
| 29 | IMAGES := $(wildcard $(PROJ_SRC_DIR)/img/*.*) |
| 30 | DOXYFILES := doxygen.cfg.in doxygen.css doxygen.footer doxygen.header \ |
| 31 | doxygen.intro |
| 32 | EXTRA_DIST := $(HTML) $(DOXYFILES) llvm.css CommandGuide img |
| 33 | |
| 34 | .PHONY: install-html install-doxygen doxygen install-ocamldoc ocamldoc generated |
| 35 | |
| 36 | install_targets := install-html |
| 37 | ifeq ($(ENABLE_DOXYGEN),1) |
| 38 | install_targets += install-doxygen |
| 39 | endif |
Erick Tryzelaar | ff3dbde | 2011-02-09 18:32:04 +0000 | [diff] [blame] | 40 | ifdef OCAMLDOC |
mike-m | e2c3a49 | 2010-05-07 00:28:04 +0000 | [diff] [blame] | 41 | ifneq (,$(filter ocaml,$(BINDINGS_TO_BUILD))) |
| 42 | install_targets += install-ocamldoc |
| 43 | endif |
Erick Tryzelaar | ff3dbde | 2011-02-09 18:32:04 +0000 | [diff] [blame] | 44 | endif |
mike-m | e2c3a49 | 2010-05-07 00:28:04 +0000 | [diff] [blame] | 45 | install-local:: $(install_targets) |
| 46 | |
Erick Tryzelaar | ff3dbde | 2011-02-09 18:32:04 +0000 | [diff] [blame] | 47 | generated_targets := doxygen |
| 48 | ifdef OCAMLDOC |
| 49 | generated_targets += ocamldoc |
| 50 | endif |
| 51 | |
mike-m | e2c3a49 | 2010-05-07 00:28:04 +0000 | [diff] [blame] | 52 | # Live documentation is generated for the web site using this target: |
| 53 | # 'make generated BUILD_FOR_WEBSITE=1' |
Erick Tryzelaar | ff3dbde | 2011-02-09 18:32:04 +0000 | [diff] [blame] | 54 | generated:: $(generated_targets) |
mike-m | e2c3a49 | 2010-05-07 00:28:04 +0000 | [diff] [blame] | 55 | |
| 56 | install-html: $(PROJ_OBJ_DIR)/html.tar.gz |
| 57 | $(Echo) Installing HTML documentation |
| 58 | $(Verb) $(MKDIR) $(DESTDIR)$(PROJ_docsdir)/html |
| 59 | $(Verb) $(MKDIR) $(DESTDIR)$(PROJ_docsdir)/html/img |
| 60 | $(Verb) $(DataInstall) $(HTML) $(DESTDIR)$(PROJ_docsdir)/html |
| 61 | $(Verb) $(DataInstall) $(IMAGES) $(DESTDIR)$(PROJ_docsdir)/html/img |
| 62 | $(Verb) $(DataInstall) $(PROJ_OBJ_DIR)/html.tar.gz $(DESTDIR)$(PROJ_docsdir) |
| 63 | |
| 64 | $(PROJ_OBJ_DIR)/html.tar.gz: $(HTML) |
| 65 | $(Echo) Packaging HTML documentation |
| 66 | $(Verb) $(RM) -rf $@ $(PROJ_OBJ_DIR)/html.tar |
| 67 | $(Verb) cd $(PROJ_SRC_DIR) && \ |
| 68 | $(TAR) cf $(PROJ_OBJ_DIR)/html.tar *.html |
Eric Christopher | 031d307 | 2010-12-10 01:31:51 +0000 | [diff] [blame] | 69 | $(Verb) $(GZIPBIN) $(PROJ_OBJ_DIR)/html.tar |
mike-m | e2c3a49 | 2010-05-07 00:28:04 +0000 | [diff] [blame] | 70 | |
| 71 | install-doxygen: doxygen |
| 72 | $(Echo) Installing doxygen documentation |
| 73 | $(Verb) $(MKDIR) $(DESTDIR)$(PROJ_docsdir)/html/doxygen |
| 74 | $(Verb) $(DataInstall) $(PROJ_OBJ_DIR)/doxygen.tar.gz $(DESTDIR)$(PROJ_docsdir) |
| 75 | $(Verb) cd $(PROJ_OBJ_DIR)/doxygen && \ |
| 76 | $(FIND) . -type f -exec \ |
| 77 | $(DataInstall) {} $(DESTDIR)$(PROJ_docsdir)/html/doxygen \; |
| 78 | |
| 79 | doxygen: regendoc $(PROJ_OBJ_DIR)/doxygen.tar.gz |
| 80 | |
| 81 | regendoc: |
| 82 | $(Echo) Building doxygen documentation |
| 83 | $(Verb) if test -e $(PROJ_OBJ_DIR)/doxygen ; then \ |
| 84 | $(RM) -rf $(PROJ_OBJ_DIR)/doxygen ; \ |
| 85 | fi |
| 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 |
Eric Christopher | 031d307 | 2010-12-10 01:31:51 +0000 | [diff] [blame] | 92 | $(Verb) $(GZIPBIN) $(PROJ_OBJ_DIR)/doxygen.tar |
mike-m | e2c3a49 | 2010-05-07 00:28:04 +0000 | [diff] [blame] | 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 |
Eric Christopher | 031d307 | 2010-12-10 01:31:51 +0000 | [diff] [blame] | 114 | $(Verb) $(GZIPBIN) $(PROJ_OBJ_DIR)/ocamldoc.tar |
mike-m | e2c3a49 | 2010-05-07 00:28:04 +0000 | [diff] [blame] | 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) if test -e $(PROJ_OBJ_DIR)/ocamldoc ; then \ |
| 120 | $(RM) -rf $(PROJ_OBJ_DIR)/ocamldoc ; \ |
| 121 | fi |
| 122 | $(Verb) $(MAKE) -C $(LEVEL)/bindings/ocaml ocamldoc |
| 123 | $(Verb) $(MKDIR) $(PROJ_OBJ_DIR)/ocamldoc/html |
| 124 | $(Verb) \ |
| 125 | $(OCAMLDOC) -d $(PROJ_OBJ_DIR)/ocamldoc/html -sort -colorize-code -html \ |
| 126 | `$(FIND) $(LEVEL)/bindings/ocaml -name "*.odoc" -exec echo -load '{}' ';'` |
| 127 | |
| 128 | uninstall-local:: |
| 129 | $(Echo) Uninstalling Documentation |
| 130 | $(Verb) $(RM) -rf $(DESTDIR)$(PROJ_docsdir) |