blob: f00af25f6ecd2b8593f6afe00cc7f35c3541bdd1 [file] [log] [blame]
Daniel Dunbardbec0332009-04-29 01:00:32 +00001##===- docs/tools/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
10ifdef BUILD_FOR_WEBSITE
11
12# FIXME: This was copied from the CommandGuide makefile. Figure out
13# how to get this stuff on the website.
14
15# This special case is for keeping the CommandGuide on the LLVM web site
16# up to date automatically as the documents are checked in. It must build
17# the POD files to HTML only and keep them in the src directories. It must also
18# build in an unconfigured tree, hence the ifdef. To use this, run
19# make -s BUILD_FOR_WEBSITE=1 inside the cvs commit script.
20SRC_DOC_DIR=
21DST_HTML_DIR=html/
22DST_MAN_DIR=man/man1/
23DST_PS_DIR=ps/
24
25# If we are in BUILD_FOR_WEBSITE mode, default to the all target.
26all:: html man ps
27
28clean:
29 rm -f pod2htm*.*~~ $(HTML) $(MAN) $(PS)
30
31# To create other directories, as needed, and timestamp their creation
32%/.dir:
33 -mkdir $* > /dev/null
34 date > $@
35
36else
37
38# Otherwise, if not in BUILD_FOR_WEBSITE mode, use the project info.
39LEVEL := ../../../..
40include $(LEVEL)/Makefile.common
41
42SRC_DOC_DIR=$(PROJ_SRC_DIR)/
43DST_HTML_DIR=$(PROJ_OBJ_DIR)/
44DST_MAN_DIR=$(PROJ_OBJ_DIR)/
45DST_PS_DIR=$(PROJ_OBJ_DIR)/
46
47endif
48
49
50POD := $(wildcard $(SRC_DOC_DIR)*.pod)
51HTML := $(patsubst $(SRC_DOC_DIR)%.pod, $(DST_HTML_DIR)%.html, $(POD))
52MAN := $(patsubst $(SRC_DOC_DIR)%.pod, $(DST_MAN_DIR)%.1, $(POD))
53PS := $(patsubst $(SRC_DOC_DIR)%.pod, $(DST_PS_DIR)%.ps, $(POD))
54
55.SUFFIXES:
56.SUFFIXES: .html .pod .1 .ps
57
58$(DST_HTML_DIR)%.html: %.pod $(DST_HTML_DIR)/.dir
59 pod2html --css=manpage.css --htmlroot=. \
60 --podpath=. --noindex --infile=$< --outfile=$@ --title=$*
61
62$(DST_MAN_DIR)%.1: %.pod $(DST_MAN_DIR)/.dir
63 pod2man $< $@
64
65$(DST_PS_DIR)%.ps: $(DST_MAN_DIR)%.1 $(DST_PS_DIR)/.dir
66 groff -Tps -man $< > $@
67
68
69html: $(HTML)
70man: $(MAN)
71ps: $(PS)
72
73EXTRA_DIST := $(POD)
74
75clean-local::
76 $(Verb) $(RM) -f pod2htm*.*~~ $(HTML) $(MAN) $(PS)
77
78HTML_DIR := $(PROJ_docsdir)/html/clang
79MAN_DIR := $(PROJ_mandir)/man1
80PS_DIR := $(PROJ_docsdir)/ps
81
82install-local:: $(HTML) $(MAN) $(PS)
83 $(Echo) Installing HTML Clang Tools Documentation
84 $(Verb) $(MKDIR) $(HTML_DIR)
85 $(Verb) $(DataInstall) $(HTML) $(HTML_DIR)
86 $(Verb) $(DataInstall) $(PROJ_SRC_DIR)/manpage.css $(HTML_DIR)
87 $(Echo) Installing MAN Clang Tools Documentation
88 $(Verb) $(MKDIR) $(MAN_DIR)
89 $(Verb) $(DataInstall) $(MAN) $(MAN_DIR)
90 $(Echo) Installing PS Clang Tools Documentation
91 $(Verb) $(MKDIR) $(PS_DIR)
92 $(Verb) $(DataInstall) $(PS) $(PS_DIR)
93
94uninstall-local::
95 $(Echo) Uninstalling Clang Tools Documentation
96 $(Verb) $(RM) -rf $(HTML_DIR) $(MAN_DIR) $(PS_DIR)
97
98printvars::
99 $(Echo) "POD : " '$(POD)'
100 $(Echo) "HTML : " '$(HTML)'