blob: 440d538af559a1017153c958435978b9c31fa7c1 [file] [log] [blame]
Dan Gohmanf17a25c2007-07-18 16:29:46 +00001##===- docs/CommandGuide/Makefile --------------------------*- Makefile -*-===##
2#
3# The LLVM Compiler Infrastructure
4#
5# This file was developed by the LLVM research group and is distributed under
6# the University of Illinois Open Source License. See LICENSE.TXT for details.
7#
8##===----------------------------------------------------------------------===##
9
10ifdef BUILD_FOR_WEBSITE
11
12# This special case is for keeping the CommandGuide on the LLVM web site
13# up to date automatically as the documents are checked in. It must build
14# the POD files to HTML only and keep them in the src directories. It must also
15# build in an unconfigured tree, hence the ifdef. To use this, run
16# make -s BUILD_FOR_WEBSITE=1 inside the cvs commit script.
17
18POD := $(wildcard *.pod)
19HTML := $(patsubst %.pod, html/%.html, $(POD))
20MAN := $(patsubst %.pod, man/man1/%.1, $(POD))
21PS := $(patsubst %.pod, ps/%.ps, $(POD))
22
23all: $(HTML) $(MAN) $(PS)
24
25.SUFFIXES:
26.SUFFIXES: .html .pod .1 .ps
27
28html/%.html: %.pod
29 pod2html --css=manpage.css --htmlroot=. \
30 --podpath=. --noindex --infile=$< --outfile=$@ --title=$*
31
32man/man1/%.1: %.pod
33 pod2man --release=CVS --center="LLVM Command Guide" $< $@
34
35ps/%.ps: man/man1/%.1
36 groff -Tps -man $< > $@
37
38clean:
39 rm -f pod2htm*.*~~ $(HTML) $(MAN) $(PS)
40
41else
42
43LEVEL := ../..
44
45include $(LEVEL)/Makefile.common
46
47POD := $(wildcard $(PROJ_SRC_DIR)/*.pod)
48
49EXTRA_DIST := $(POD) index.html
50
51HTML = $(patsubst $(PROJ_SRC_DIR)/%.pod, $(PROJ_OBJ_DIR)/%.html, $(POD))
52MAN = $(patsubst $(PROJ_SRC_DIR)/%.pod, $(PROJ_OBJ_DIR)/%.1, $(POD))
53PS = $(patsubst $(PROJ_SRC_DIR)/%.pod, $(PROJ_OBJ_DIR)/%.ps, $(POD))
54
55.SUFFIXES:
56.SUFFIXES: .html .pod .1 .ps
57
58$(HTML) : html/.dir man/.dir man/man1/.dir ps/.dir
59
60html: $(HTML)
61
62$(PROJ_OBJ_DIR)/%.html: %.pod
63 $(POD2HTML) --css=manpage.css --htmlroot=. --podpath=. \
64 --noindex --infile=$< --outfile=$@ --title=$*
65
66$(PROJ_OBJ_DIR)/%.1: %.pod
67 $(POD2MAN) --release=$(LLVMVersion) \
68 --center="LLVM Command Guide" $< $@
69
70$(PROJ_OBJ_DIR)/%.ps: $(PROJ_OBJ_DIR)/%.1
71 $(GROFF) -Tps -man $< > $@
72
73clean-local::
74 $(Verb) $(RM) -f pod2htm*.*~~ $(HTML) $(MAN) $(PS)
75
76HTML_DIR := $(PROJ_docsdir)/html/CommandGuide
77MAN_DIR := $(PROJ_mandir)/man1
78PS_DIR := $(PROJ_docsdir)/ps
79
80install-local:: $(HTML) $(MAN) $(PS)
81 $(Echo) Installing HTML CommandGuide Documentation
82 $(Verb) $(MKDIR) $(HTML_DIR)
83 $(Verb) $(DataInstall) $(HTML) $(HTML_DIR)
84 $(Verb) $(DataInstall) $(PROJ_SRC_DIR)/index.html $(HTML_DIR)
85 $(Verb) $(DataInstall) $(PROJ_SRC_DIR)/manpage.css $(HTML_DIR)
86 $(Echo) Installing MAN CommandGuide Documentation
87 $(Verb) $(MKDIR) $(MAN_DIR)
88 $(Verb) $(DataInstall) $(MAN) $(MAN_DIR)
89 $(Echo) Installing PS CommandGuide Documentation
90 $(Verb) $(MKDIR) $(PS_DIR)
91 $(Verb) $(DataInstall) $(PS) $(PS_DIR)
92
93uninstall-local::
94 $(Echo) Uninstalling Documentation
95 $(Verb) $(RM) -rf $(LLVM_DOCSDIR)
96
97printvars::
98 $(Echo) "POD : " '$(POD)'
99 $(Echo) "HTML : " '$(HTML)'
100
101endif