xref: /minix3/external/bsd/llvm/dist/clang/docs/Makefile (revision f4a2713ac843a11c696ec80c0a5e3e5d80b4d338)
1*f4a2713aSLionel Sambuc##===- docs/Makefile ---------------------------------------*- Makefile -*-===##
2*f4a2713aSLionel Sambuc#
3*f4a2713aSLionel Sambuc#                     The LLVM Compiler Infrastructure
4*f4a2713aSLionel Sambuc#
5*f4a2713aSLionel Sambuc# This file is distributed under the University of Illinois Open Source
6*f4a2713aSLionel Sambuc# License. See LICENSE.TXT for details.
7*f4a2713aSLionel Sambuc#
8*f4a2713aSLionel Sambuc##===----------------------------------------------------------------------===##
9*f4a2713aSLionel Sambuc
10*f4a2713aSLionel SambucCLANG_LEVEL := ..
11*f4a2713aSLionel SambucDIRS       := tools
12*f4a2713aSLionel Sambuc
13*f4a2713aSLionel Sambucifdef BUILD_FOR_WEBSITE
14*f4a2713aSLionel SambucPROJ_OBJ_DIR = .
15*f4a2713aSLionel SambucDOXYGEN = doxygen
16*f4a2713aSLionel Sambuc
17*f4a2713aSLionel Sambuc$(PROJ_OBJ_DIR)/doxygen.cfg: doxygen.cfg.in
18*f4a2713aSLionel Sambuc	cat $< | sed \
19*f4a2713aSLionel Sambuc	  -e 's/@abs_srcdir@/./g' \
20*f4a2713aSLionel Sambuc	  -e 's/@DOT@/dot/g' \
21*f4a2713aSLionel Sambuc	  -e 's/@PACKAGE_VERSION@/mainline/' \
22*f4a2713aSLionel Sambuc	  -e 's/@abs_builddir@/./g' \
23*f4a2713aSLionel Sambuc	  -e 's/@enable_searchengine@/NO/g' \
24*f4a2713aSLionel Sambuc	  -e 's/@searchengine_url@//g' \
25*f4a2713aSLionel Sambuc	  -e 's/@enable_server_based_search@/NO/g' \
26*f4a2713aSLionel Sambuc	  -e 's/@enable_external_search@/NO/g' \
27*f4a2713aSLionel Sambuc	  -e 's/@extra_search_mappings@//g' > $@
28*f4a2713aSLionel Sambucendif
29*f4a2713aSLionel Sambuc
30*f4a2713aSLionel Sambucinclude $(CLANG_LEVEL)/Makefile
31*f4a2713aSLionel Sambuc
32*f4a2713aSLionel SambucHTML       := $(wildcard $(PROJ_SRC_DIR)/*.html) \
33*f4a2713aSLionel Sambuc              $(wildcard $(PROJ_SRC_DIR)/*.css)
34*f4a2713aSLionel Sambuc#IMAGES     := $(wildcard $(PROJ_SRC_DIR)/img/*.*)
35*f4a2713aSLionel SambucDOXYFILES  := doxygen.cfg.in doxygen.css doxygen.footer doxygen.header \
36*f4a2713aSLionel Sambuc              doxygen.intro
37*f4a2713aSLionel SambucEXTRA_DIST := $(HTML) $(DOXYFILES) llvm.css CommandGuide img
38*f4a2713aSLionel Sambuc
39*f4a2713aSLionel Sambuc.PHONY: install-html install-doxygen doxygen generated
40*f4a2713aSLionel Sambuc
41*f4a2713aSLionel Sambucinstall_targets :=
42*f4a2713aSLionel Sambucifndef ONLY_MAN_DOCS
43*f4a2713aSLionel Sambucinstall_targets += install-html
44*f4a2713aSLionel Sambucendif
45*f4a2713aSLionel Sambucifeq ($(ENABLE_DOXYGEN),1)
46*f4a2713aSLionel Sambucinstall_targets += install-doxygen
47*f4a2713aSLionel Sambucendif
48*f4a2713aSLionel Sambucinstall-local:: $(install_targets)
49*f4a2713aSLionel Sambuc
50*f4a2713aSLionel Sambuc# Live documentation is generated for the web site using this target:
51*f4a2713aSLionel Sambuc# 'make generated BUILD_FOR_WEBSITE=1'
52*f4a2713aSLionel Sambucgenerated:: doxygen
53*f4a2713aSLionel Sambuc
54*f4a2713aSLionel Sambucinstall-html: $(PROJ_OBJ_DIR)/html.tar.gz
55*f4a2713aSLionel Sambuc	$(Echo) Installing HTML documentation
56*f4a2713aSLionel Sambuc	$(Verb) $(MKDIR) $(DESTDIR)$(PROJ_docsdir)/html
57*f4a2713aSLionel Sambuc	$(Verb) $(MKDIR) $(DESTDIR)$(PROJ_docsdir)/html/img
58*f4a2713aSLionel Sambuc	$(Verb) $(DataInstall) $(HTML) $(DESTDIR)$(PROJ_docsdir)/html
59*f4a2713aSLionel Sambuc#	$(Verb) $(DataInstall) $(IMAGES) $(DESTDIR)$(PROJ_docsdir)/html/img
60*f4a2713aSLionel Sambuc	$(Verb) $(DataInstall) $(PROJ_OBJ_DIR)/html.tar.gz $(DESTDIR)$(PROJ_docsdir)
61*f4a2713aSLionel Sambuc
62*f4a2713aSLionel Sambuc$(PROJ_OBJ_DIR)/html.tar.gz: $(HTML)
63*f4a2713aSLionel Sambuc	$(Echo) Packaging HTML documentation
64*f4a2713aSLionel Sambuc	$(Verb) $(RM) -rf $@ $(PROJ_OBJ_DIR)/html.tar
65*f4a2713aSLionel Sambuc	$(Verb) cd $(PROJ_SRC_DIR) && \
66*f4a2713aSLionel Sambuc	  $(TAR) cf $(PROJ_OBJ_DIR)/html.tar *.html
67*f4a2713aSLionel Sambuc	$(Verb) $(GZIPBIN) $(PROJ_OBJ_DIR)/html.tar
68*f4a2713aSLionel Sambuc
69*f4a2713aSLionel Sambucinstall-doxygen: doxygen
70*f4a2713aSLionel Sambuc	$(Echo) Installing doxygen documentation
71*f4a2713aSLionel Sambuc	$(Verb) $(MKDIR) $(DESTDIR)$(PROJ_docsdir)/html/doxygen
72*f4a2713aSLionel Sambuc	$(Verb) $(DataInstall) $(PROJ_OBJ_DIR)/doxygen.tar.gz $(DESTDIR)$(PROJ_docsdir)
73*f4a2713aSLionel Sambuc	$(Verb) cd $(PROJ_OBJ_DIR)/doxygen && \
74*f4a2713aSLionel Sambuc	  $(FIND) . -type f -exec \
75*f4a2713aSLionel Sambuc	    $(DataInstall) {} $(DESTDIR)$(PROJ_docsdir)/html/doxygen \;
76*f4a2713aSLionel Sambuc
77*f4a2713aSLionel Sambucdoxygen: regendoc $(PROJ_OBJ_DIR)/doxygen.tar.gz
78*f4a2713aSLionel Sambuc
79*f4a2713aSLionel Sambucregendoc:
80*f4a2713aSLionel Sambuc	$(Echo) Building doxygen documentation
81*f4a2713aSLionel Sambuc	$(Verb) $(RM) -rf $(PROJ_OBJ_DIR)/doxygen
82*f4a2713aSLionel Sambuc	$(Verb) $(DOXYGEN) $(PROJ_OBJ_DIR)/doxygen.cfg
83*f4a2713aSLionel Sambuc	$(Verb) sed -i "s/[$$]LatestRev[$$]/`svnversion $(PROJ_SRC_DIR)`/g" \
84*f4a2713aSLionel Sambuc	 $(PROJ_OBJ_DIR)/doxygen/html/*.html
85*f4a2713aSLionel Sambuc
86*f4a2713aSLionel Sambuc$(PROJ_OBJ_DIR)/doxygen.tar.gz: $(DOXYFILES) $(PROJ_OBJ_DIR)/doxygen.cfg
87*f4a2713aSLionel Sambuc	$(Echo) Packaging doxygen documentation
88*f4a2713aSLionel Sambuc	$(Verb) $(RM) -rf $@ $(PROJ_OBJ_DIR)/doxygen.tar
89*f4a2713aSLionel Sambuc	$(Verb) $(TAR) cf $(PROJ_OBJ_DIR)/doxygen.tar doxygen
90*f4a2713aSLionel Sambuc	$(Verb) $(GZIPBIN) $(PROJ_OBJ_DIR)/doxygen.tar
91*f4a2713aSLionel Sambuc	$(Verb) $(CP) $(PROJ_OBJ_DIR)/doxygen.tar.gz $(PROJ_OBJ_DIR)/doxygen/html/
92*f4a2713aSLionel Sambuc
93*f4a2713aSLionel Sambucuserloc: $(LLVM_SRC_ROOT)/docs/userloc.html
94*f4a2713aSLionel Sambuc
95*f4a2713aSLionel Sambuc$(LLVM_SRC_ROOT)/docs/userloc.html:
96*f4a2713aSLionel Sambuc	$(Echo) Making User LOC Table
97*f4a2713aSLionel Sambuc	$(Verb) cd $(LLVM_SRC_ROOT) ; ./utils/userloc.pl -details -recurse \
98*f4a2713aSLionel Sambuc	  -html lib include tools runtime utils examples autoconf test > docs/userloc.html
99*f4a2713aSLionel Sambuc
100*f4a2713aSLionel Sambucuninstall-local::
101*f4a2713aSLionel Sambuc	$(Echo) Uninstalling Documentation
102*f4a2713aSLionel Sambuc	$(Verb) $(RM) -rf $(DESTDIR)$(PROJ_docsdir)
103