blob: 2608046f1f85a1b2e0e3a2a62b71e862e54299b8 [file] [log] [blame]
Daniel Dunbar1ede17a2008-07-26 21:32:24 +00001##===- 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
Daniel Dunbarafed0992010-06-08 20:34:18 +000010CLANG_LEVEL := ..
mike-m3e5d00c2010-05-07 00:42:33 +000011DIRS := tools
12
13ifdef BUILD_FOR_WEBSITE
14PROJ_OBJ_DIR = .
15DOXYGEN = doxygen
16
17$(PROJ_OBJ_DIR)/doxygen.cfg: doxygen.cfg.in
18 cat $< | sed \
Peter Collingbourne04bb6572011-05-13 03:29:06 +000019 -e 's/@abs_srcdir@/./g' \
mike-m3e5d00c2010-05-07 00:42:33 +000020 -e 's/@DOT@/dot/g' \
21 -e 's/@PACKAGE_VERSION@/mainline/' \
Peter Collingbourne04bb6572011-05-13 03:29:06 +000022 -e 's/@abs_builddir@/./g' > $@
mike-m3e5d00c2010-05-07 00:42:33 +000023endif
Daniel Dunbar1ede17a2008-07-26 21:32:24 +000024
Daniel Dunbarafed0992010-06-08 20:34:18 +000025include $(CLANG_LEVEL)/Makefile
mike-m3e5d00c2010-05-07 00:42:33 +000026
27HTML := $(wildcard $(PROJ_SRC_DIR)/*.html) \
28 $(wildcard $(PROJ_SRC_DIR)/*.css)
29#IMAGES := $(wildcard $(PROJ_SRC_DIR)/img/*.*)
30DOXYFILES := doxygen.cfg.in doxygen.css doxygen.footer doxygen.header \
31 doxygen.intro
32EXTRA_DIST := $(HTML) $(DOXYFILES) llvm.css CommandGuide img
33
34.PHONY: install-html install-doxygen doxygen generated
35
36install_targets :=
37ifndef ONLY_MAN_DOCS
38install_targets += install-html
39endif
40ifeq ($(ENABLE_DOXYGEN),1)
41install_targets += install-doxygen
42endif
43install-local:: $(install_targets)
44
45# Live documentation is generated for the web site using this target:
46# 'make generated BUILD_FOR_WEBSITE=1'
47generated:: doxygen
48
49install-html: $(PROJ_OBJ_DIR)/html.tar.gz
50 $(Echo) Installing HTML documentation
51 $(Verb) $(MKDIR) $(DESTDIR)$(PROJ_docsdir)/html
52 $(Verb) $(MKDIR) $(DESTDIR)$(PROJ_docsdir)/html/img
53 $(Verb) $(DataInstall) $(HTML) $(DESTDIR)$(PROJ_docsdir)/html
54# $(Verb) $(DataInstall) $(IMAGES) $(DESTDIR)$(PROJ_docsdir)/html/img
55 $(Verb) $(DataInstall) $(PROJ_OBJ_DIR)/html.tar.gz $(DESTDIR)$(PROJ_docsdir)
56
57$(PROJ_OBJ_DIR)/html.tar.gz: $(HTML)
58 $(Echo) Packaging HTML documentation
59 $(Verb) $(RM) -rf $@ $(PROJ_OBJ_DIR)/html.tar
60 $(Verb) cd $(PROJ_SRC_DIR) && \
61 $(TAR) cf $(PROJ_OBJ_DIR)/html.tar *.html
Eric Christopher3bc3c6d2010-12-10 01:59:28 +000062 $(Verb) $(GZIPBIN) $(PROJ_OBJ_DIR)/html.tar
mike-m3e5d00c2010-05-07 00:42:33 +000063
64install-doxygen: doxygen
65 $(Echo) Installing doxygen documentation
66 $(Verb) $(MKDIR) $(DESTDIR)$(PROJ_docsdir)/html/doxygen
67 $(Verb) $(DataInstall) $(PROJ_OBJ_DIR)/doxygen.tar.gz $(DESTDIR)$(PROJ_docsdir)
68 $(Verb) cd $(PROJ_OBJ_DIR)/doxygen && \
69 $(FIND) . -type f -exec \
70 $(DataInstall) {} $(DESTDIR)$(PROJ_docsdir)/html/doxygen \;
71
72doxygen: regendoc $(PROJ_OBJ_DIR)/doxygen.tar.gz
73
74regendoc:
75 $(Echo) Building doxygen documentation
76 $(Verb) if test -e $(PROJ_OBJ_DIR)/doxygen ; then \
77 $(RM) -rf $(PROJ_OBJ_DIR)/doxygen ; \
78 fi
79 $(Verb) $(DOXYGEN) $(PROJ_OBJ_DIR)/doxygen.cfg
80
81$(PROJ_OBJ_DIR)/doxygen.tar.gz: $(DOXYFILES) $(PROJ_OBJ_DIR)/doxygen.cfg
82 $(Echo) Packaging doxygen documentation
83 $(Verb) $(RM) -rf $@ $(PROJ_OBJ_DIR)/doxygen.tar
84 $(Verb) $(TAR) cf $(PROJ_OBJ_DIR)/doxygen.tar doxygen
Eric Christopher3bc3c6d2010-12-10 01:59:28 +000085 $(Verb) $(GZIPBIN) $(PROJ_OBJ_DIR)/doxygen.tar
mike-m3e5d00c2010-05-07 00:42:33 +000086 $(Verb) $(CP) $(PROJ_OBJ_DIR)/doxygen.tar.gz $(PROJ_OBJ_DIR)/doxygen/html/
87
88userloc: $(LLVM_SRC_ROOT)/docs/userloc.html
89
90$(LLVM_SRC_ROOT)/docs/userloc.html:
91 $(Echo) Making User LOC Table
92 $(Verb) cd $(LLVM_SRC_ROOT) ; ./utils/userloc.pl -details -recurse \
93 -html lib include tools runtime utils examples autoconf test > docs/userloc.html
94
95uninstall-local::
96 $(Echo) Uninstalling Documentation
97 $(Verb) $(RM) -rf $(DESTDIR)$(PROJ_docsdir)