explain that NumElements in alloca and malloc defaults to one
[oota-llvm.git] / docs / CommandGuide / Makefile
1 ##===- docs/CommandGuide/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
10 ifdef 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
18 POD  := $(wildcard *.pod)
19 HTML := $(patsubst %.pod, html/%.html, $(POD))
20 MAN  := $(patsubst %.pod, man/man1/%.1, $(POD))
21 PS   := $(patsubst %.pod, ps/%.ps, $(POD))
22
23 all: $(HTML) $(MAN) $(PS)
24
25 .SUFFIXES:
26 .SUFFIXES: .html .pod .1 .ps
27
28 html/%.html: %.pod
29         pod2html --css=manpage.css --htmlroot=. \
30           --podpath=. --noindex --infile=$< --outfile=$@ --title=$*
31
32 man/man1/%.1: %.pod
33         pod2man --release=CVS --center="LLVM Command Guide" $< $@
34
35 ps/%.ps: man/man1/%.1
36         groff -Tps -man $< > $@
37
38 clean:
39         rm -f pod2htm*.*~~ $(HTML) $(MAN) $(PS)
40
41 else 
42
43 LEVEL := ../..
44
45 include $(LEVEL)/Makefile.common
46
47 POD := $(wildcard $(PROJ_SRC_DIR)/*.pod)
48
49 EXTRA_DIST := $(POD) index.html
50
51 HTML = $(patsubst $(PROJ_SRC_DIR)/%.pod, $(PROJ_OBJ_DIR)/%.html, $(POD))
52 MAN = $(patsubst $(PROJ_SRC_DIR)/%.pod, $(PROJ_OBJ_DIR)/%.1, $(POD))
53 PS = $(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
60 html: $(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
73 clean-local::
74         $(Verb) $(RM) -f pod2htm*.*~~ $(HTML) $(MAN) $(PS)
75
76 HTML_DIR := $(PROJ_docsdir)/html/CommandGuide
77 MAN_DIR  := $(PROJ_mandir)/man1
78 PS_DIR   := $(PROJ_docsdir)/ps
79
80 install-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
93 uninstall-local::
94         $(Echo) Uninstalling Documentation
95         $(Verb) $(RM) -rf $(LLVM_DOCSDIR)
96
97 printvars::
98         $(Echo) "POD            : " '$(POD)'
99         $(Echo) "HTML           : " '$(HTML)'
100
101 endif