blob: f4a0df7a0c95a764b336bbf92aa88b024cd119e8 [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
10LEVEL := ../../..
11DIRS :=
12
13ifdef BUILD_FOR_WEBSITE
14PROJ_OBJ_DIR = .
15DOXYGEN = 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' > $@
23endif
24
25include $(LEVEL)/Makefile.common
26
27HTML := $(wildcard $(PROJ_SRC_DIR)/*.html) \
28 $(wildcard $(PROJ_SRC_DIR)/*.css)
Mike Stumpc7856762008-08-12 00:32:59 +000029#IMAGES := $(wildcard $(PROJ_SRC_DIR)/img/*.*)
Daniel Dunbar1ede17a2008-07-26 21:32:24 +000030DOXYFILES := 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 := install-html
37ifeq ($(ENABLE_DOXYGEN),1)
38install_targets += install-doxygen
39endif
40install-local:: $(install_targets)
41
42# Live documentation is generated for the web site using this target:
43# 'make generated BUILD_FOR_WEBSITE=1'
44generated:: doxygen
45
46install-html: $(PROJ_OBJ_DIR)/html.tar.gz
47 $(Echo) Installing HTML documentation
48 $(Verb) $(MKDIR) $(PROJ_docsdir)/html
49 $(Verb) $(MKDIR) $(PROJ_docsdir)/html/img
50 $(Verb) $(DataInstall) $(HTML) $(PROJ_docsdir)/html
Mike Stumpc7856762008-08-12 00:32:59 +000051# $(Verb) $(DataInstall) $(IMAGES) $(PROJ_docsdir)/html/img
Daniel Dunbar1ede17a2008-07-26 21:32:24 +000052 $(Verb) $(DataInstall) $(PROJ_OBJ_DIR)/html.tar.gz $(PROJ_docsdir)
53
54$(PROJ_OBJ_DIR)/html.tar.gz: $(HTML)
55 $(Echo) Packaging HTML documentation
56 $(Verb) $(RM) -rf $@ $(PROJ_OBJ_DIR)/html.tar
57 $(Verb) cd $(PROJ_SRC_DIR) && \
58 $(TAR) cf $(PROJ_OBJ_DIR)/html.tar *.html
59 $(Verb) $(GZIP) $(PROJ_OBJ_DIR)/html.tar
60
61install-doxygen: doxygen
62 $(Echo) Installing doxygen documentation
63 $(Verb) $(MKDIR) $(PROJ_docsdir)/html/doxygen
64 $(Verb) $(DataInstall) $(PROJ_OBJ_DIR)/doxygen.tar.gz $(PROJ_docsdir)
65 $(Verb) cd $(PROJ_OBJ_DIR)/doxygen && \
66 $(FIND) . -type f -exec \
67 $(DataInstall) {} $(PROJ_docsdir)/html/doxygen \;
68
69doxygen: regendoc $(PROJ_OBJ_DIR)/doxygen.tar.gz
70
71regendoc:
72 $(Echo) Building doxygen documentation
73 $(Verb) if test -e $(PROJ_OBJ_DIR)/doxygen ; then \
74 $(RM) -rf $(PROJ_OBJ_DIR)/doxygen ; \
75 fi
76 $(Verb) $(DOXYGEN) $(PROJ_OBJ_DIR)/doxygen.cfg
77
78$(PROJ_OBJ_DIR)/doxygen.tar.gz: $(DOXYFILES) $(PROJ_OBJ_DIR)/doxygen.cfg
79 $(Echo) Packaging doxygen documentation
80 $(Verb) $(RM) -rf $@ $(PROJ_OBJ_DIR)/doxygen.tar
81 $(Verb) $(TAR) cf $(PROJ_OBJ_DIR)/doxygen.tar doxygen
82 $(Verb) $(GZIP) $(PROJ_OBJ_DIR)/doxygen.tar
83 $(Verb) $(CP) $(PROJ_OBJ_DIR)/doxygen.tar.gz $(PROJ_OBJ_DIR)/doxygen/html/
84
85userloc: $(LLVM_SRC_ROOT)/docs/userloc.html
86
87$(LLVM_SRC_ROOT)/docs/userloc.html:
88 $(Echo) Making User LOC Table
89 $(Verb) cd $(LLVM_SRC_ROOT) ; ./utils/userloc.pl -details -recurse \
90 -html lib include tools runtime utils examples autoconf test > docs/userloc.html
91
92uninstall-local::
93 $(Echo) Uninstalling Documentation
94 $(Verb) $(RM) -rf $(PROJ_docsdir)