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 := .. |
Daniel Dunbar | a5d2435 | 2012-05-08 17:48:21 +0000 | [diff] [blame] | 11 | DIRS := |
mike-m | e2c3a49 | 2010-05-07 00:28:04 +0000 | [diff] [blame] | 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) |
mike-m | e2c3a49 | 2010-05-07 00:28:04 +0000 | [diff] [blame] | 29 | DOXYFILES := doxygen.cfg.in doxygen.css doxygen.footer doxygen.header \ |
| 30 | doxygen.intro |
Benjamin Kramer | 34c53f3 | 2012-04-20 17:14:26 +0000 | [diff] [blame] | 31 | EXTRA_DIST := $(HTML) $(DOXYFILES) llvm.css CommandGuide |
mike-m | e2c3a49 | 2010-05-07 00:28:04 +0000 | [diff] [blame] | 32 | |
| 33 | .PHONY: install-html install-doxygen doxygen install-ocamldoc ocamldoc generated |
| 34 | |
| 35 | install_targets := install-html |
| 36 | ifeq ($(ENABLE_DOXYGEN),1) |
| 37 | install_targets += install-doxygen |
| 38 | endif |
Erick Tryzelaar | ff3dbde | 2011-02-09 18:32:04 +0000 | [diff] [blame] | 39 | ifdef OCAMLDOC |
mike-m | e2c3a49 | 2010-05-07 00:28:04 +0000 | [diff] [blame] | 40 | ifneq (,$(filter ocaml,$(BINDINGS_TO_BUILD))) |
| 41 | install_targets += install-ocamldoc |
| 42 | endif |
Erick Tryzelaar | ff3dbde | 2011-02-09 18:32:04 +0000 | [diff] [blame] | 43 | endif |
mike-m | e2c3a49 | 2010-05-07 00:28:04 +0000 | [diff] [blame] | 44 | install-local:: $(install_targets) |
| 45 | |
Erick Tryzelaar | ff3dbde | 2011-02-09 18:32:04 +0000 | [diff] [blame] | 46 | generated_targets := doxygen |
| 47 | ifdef OCAMLDOC |
| 48 | generated_targets += ocamldoc |
| 49 | endif |
| 50 | |
mike-m | e2c3a49 | 2010-05-07 00:28:04 +0000 | [diff] [blame] | 51 | # Live documentation is generated for the web site using this target: |
| 52 | # 'make generated BUILD_FOR_WEBSITE=1' |
Erick Tryzelaar | ff3dbde | 2011-02-09 18:32:04 +0000 | [diff] [blame] | 53 | generated:: $(generated_targets) |
mike-m | e2c3a49 | 2010-05-07 00:28:04 +0000 | [diff] [blame] | 54 | |
| 55 | install-html: $(PROJ_OBJ_DIR)/html.tar.gz |
| 56 | $(Echo) Installing HTML documentation |
| 57 | $(Verb) $(MKDIR) $(DESTDIR)$(PROJ_docsdir)/html |
mike-m | e2c3a49 | 2010-05-07 00:28:04 +0000 | [diff] [blame] | 58 | $(Verb) $(DataInstall) $(HTML) $(DESTDIR)$(PROJ_docsdir)/html |
mike-m | e2c3a49 | 2010-05-07 00:28:04 +0000 | [diff] [blame] | 59 | $(Verb) $(DataInstall) $(PROJ_OBJ_DIR)/html.tar.gz $(DESTDIR)$(PROJ_docsdir) |
| 60 | |
| 61 | $(PROJ_OBJ_DIR)/html.tar.gz: $(HTML) |
| 62 | $(Echo) Packaging HTML documentation |
| 63 | $(Verb) $(RM) -rf $@ $(PROJ_OBJ_DIR)/html.tar |
| 64 | $(Verb) cd $(PROJ_SRC_DIR) && \ |
| 65 | $(TAR) cf $(PROJ_OBJ_DIR)/html.tar *.html |
Eric Christopher | 031d307 | 2010-12-10 01:31:51 +0000 | [diff] [blame] | 66 | $(Verb) $(GZIPBIN) $(PROJ_OBJ_DIR)/html.tar |
mike-m | e2c3a49 | 2010-05-07 00:28:04 +0000 | [diff] [blame] | 67 | |
| 68 | install-doxygen: doxygen |
| 69 | $(Echo) Installing doxygen documentation |
| 70 | $(Verb) $(MKDIR) $(DESTDIR)$(PROJ_docsdir)/html/doxygen |
| 71 | $(Verb) $(DataInstall) $(PROJ_OBJ_DIR)/doxygen.tar.gz $(DESTDIR)$(PROJ_docsdir) |
| 72 | $(Verb) cd $(PROJ_OBJ_DIR)/doxygen && \ |
| 73 | $(FIND) . -type f -exec \ |
| 74 | $(DataInstall) {} $(DESTDIR)$(PROJ_docsdir)/html/doxygen \; |
| 75 | |
| 76 | doxygen: regendoc $(PROJ_OBJ_DIR)/doxygen.tar.gz |
| 77 | |
| 78 | regendoc: |
| 79 | $(Echo) Building doxygen documentation |
| 80 | $(Verb) if test -e $(PROJ_OBJ_DIR)/doxygen ; then \ |
| 81 | $(RM) -rf $(PROJ_OBJ_DIR)/doxygen ; \ |
| 82 | fi |
| 83 | $(Verb) $(DOXYGEN) $(PROJ_OBJ_DIR)/doxygen.cfg |
| 84 | |
| 85 | $(PROJ_OBJ_DIR)/doxygen.tar.gz: $(DOXYFILES) $(PROJ_OBJ_DIR)/doxygen.cfg |
| 86 | $(Echo) Packaging doxygen documentation |
| 87 | $(Verb) $(RM) -rf $@ $(PROJ_OBJ_DIR)/doxygen.tar |
| 88 | $(Verb) $(TAR) cf $(PROJ_OBJ_DIR)/doxygen.tar doxygen |
Eric Christopher | 031d307 | 2010-12-10 01:31:51 +0000 | [diff] [blame] | 89 | $(Verb) $(GZIPBIN) $(PROJ_OBJ_DIR)/doxygen.tar |
mike-m | e2c3a49 | 2010-05-07 00:28:04 +0000 | [diff] [blame] | 90 | $(Verb) $(CP) $(PROJ_OBJ_DIR)/doxygen.tar.gz $(PROJ_OBJ_DIR)/doxygen/html/ |
| 91 | |
| 92 | userloc: $(LLVM_SRC_ROOT)/docs/userloc.html |
| 93 | |
| 94 | $(LLVM_SRC_ROOT)/docs/userloc.html: |
| 95 | $(Echo) Making User LOC Table |
| 96 | $(Verb) cd $(LLVM_SRC_ROOT) ; ./utils/userloc.pl -details -recurse \ |
| 97 | -html lib include tools runtime utils examples autoconf test > docs/userloc.html |
| 98 | |
| 99 | install-ocamldoc: ocamldoc |
| 100 | $(Echo) Installing ocamldoc documentation |
| 101 | $(Verb) $(MKDIR) $(DESTDIR)$(PROJ_docsdir)/ocamldoc/html |
| 102 | $(Verb) $(DataInstall) $(PROJ_OBJ_DIR)/ocamldoc.tar.gz $(DESTDIR)$(PROJ_docsdir) |
| 103 | $(Verb) cd $(PROJ_OBJ_DIR)/ocamldoc && \ |
| 104 | $(FIND) . -type f -exec \ |
| 105 | $(DataInstall) {} $(DESTDIR)$(PROJ_docsdir)/ocamldoc/html \; |
| 106 | |
| 107 | ocamldoc: regen-ocamldoc |
| 108 | $(Echo) Packaging ocamldoc documentation |
| 109 | $(Verb) $(RM) -rf $(PROJ_OBJ_DIR)/ocamldoc.tar* |
| 110 | $(Verb) $(TAR) cf $(PROJ_OBJ_DIR)/ocamldoc.tar ocamldoc |
Eric Christopher | 031d307 | 2010-12-10 01:31:51 +0000 | [diff] [blame] | 111 | $(Verb) $(GZIPBIN) $(PROJ_OBJ_DIR)/ocamldoc.tar |
mike-m | e2c3a49 | 2010-05-07 00:28:04 +0000 | [diff] [blame] | 112 | $(Verb) $(CP) $(PROJ_OBJ_DIR)/ocamldoc.tar.gz $(PROJ_OBJ_DIR)/ocamldoc/html/ |
| 113 | |
| 114 | regen-ocamldoc: |
| 115 | $(Echo) Building ocamldoc documentation |
| 116 | $(Verb) if test -e $(PROJ_OBJ_DIR)/ocamldoc ; then \ |
| 117 | $(RM) -rf $(PROJ_OBJ_DIR)/ocamldoc ; \ |
| 118 | fi |
| 119 | $(Verb) $(MAKE) -C $(LEVEL)/bindings/ocaml ocamldoc |
| 120 | $(Verb) $(MKDIR) $(PROJ_OBJ_DIR)/ocamldoc/html |
| 121 | $(Verb) \ |
| 122 | $(OCAMLDOC) -d $(PROJ_OBJ_DIR)/ocamldoc/html -sort -colorize-code -html \ |
| 123 | `$(FIND) $(LEVEL)/bindings/ocaml -name "*.odoc" -exec echo -load '{}' ';'` |
| 124 | |
| 125 | uninstall-local:: |
| 126 | $(Echo) Uninstalling Documentation |
| 127 | $(Verb) $(RM) -rf $(DESTDIR)$(PROJ_docsdir) |