1 ##===- docs/tools/Makefile ---------------------------------*- Makefile -*-===##
3 # The LLVM Compiler Infrastructure
5 # This file is distributed under the University of Illinois Open Source
6 # License. See LICENSE.TXT for details.
8 ##===----------------------------------------------------------------------===##
10 ifdef BUILD_FOR_WEBSITE
12 # FIXME: This was copied from the CommandGuide makefile. Figure out
13 # how to get this stuff on the website.
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.
24 CLANG_VERSION
:= trunk
26 # If we are in BUILD_FOR_WEBSITE mode, default to the all target.
30 rm -f pod2htm
*.
*~~
$(HTML
) $(MAN
) $(PS
)
32 # To create other directories, as needed, and timestamp their creation
39 # Otherwise, if not in BUILD_FOR_WEBSITE mode, use the project info.
41 include $(CLANG_LEVEL
)/Makefile
43 CLANG_VERSION
:= $(word 3,$(shell grep
"CLANG_VERSION " \
44 $(PROJ_OBJ_DIR
)/$(CLANG_LEVEL
)/include/clang
/Basic
/Version.inc
))
46 SRC_DOC_DIR
=$(PROJ_SRC_DIR
)/
47 DST_HTML_DIR
=$(PROJ_OBJ_DIR
)/
48 DST_MAN_DIR
=$(PROJ_OBJ_DIR
)/
49 DST_PS_DIR
=$(PROJ_OBJ_DIR
)/
54 POD
:= $(wildcard $(SRC_DOC_DIR
)*.pod
)
55 HTML
:= $(patsubst $(SRC_DOC_DIR
)%.pod
, $(DST_HTML_DIR
)%.html
, $(POD
))
56 MAN
:= $(patsubst $(SRC_DOC_DIR
)%.pod
, $(DST_MAN_DIR
)%.1, $(POD
))
57 PS
:= $(patsubst $(SRC_DOC_DIR
)%.pod
, $(DST_PS_DIR
)%.ps
, $(POD
))
60 INSTALL_TARGETS
:= install-man
62 INSTALL_TARGETS
:= install-html install-man install-ps
66 .SUFFIXES
: .html .pod
.1 .ps
68 $(DST_HTML_DIR
)%.html
: %.pod
$(DST_HTML_DIR
)/.
dir
69 pod2html
--css
=manpage.css
--htmlroot
=. \
70 --podpath
=.
--infile
=$< --outfile
=$@
--title
=$*
72 $(DST_MAN_DIR
)%.1: %.pod
$(DST_MAN_DIR
)/.
dir
73 pod2man
--release
"clang $(CLANG_VERSION)" --center
="Clang Tools Documentation" $< $@
75 $(DST_PS_DIR
)%.ps
: $(DST_MAN_DIR
)%.1 $(DST_PS_DIR
)/.
dir
76 groff
-Tps
-man
$< > $@
86 $(Verb
) $(RM
) -f pod2htm
*.
*~~
$(HTML
) $(MAN
) $(PS
)
88 HTML_DIR
:= $(DESTDIR
)$(PROJ_docsdir
)/html
/clang
89 MAN_DIR
:= $(DESTDIR
)$(PROJ_mandir
)/man1
90 PS_DIR
:= $(DESTDIR
)$(PROJ_docsdir
)/ps
92 install-html
:: $(HTML
)
93 $(Echo
) Installing HTML Clang Tools Documentation
94 $(Verb
) $(MKDIR
) $(HTML_DIR
)
95 $(Verb
) $(DataInstall
) $(HTML
) $(HTML_DIR
)
96 $(Verb
) $(DataInstall
) $(PROJ_SRC_DIR
)/manpage.css
$(HTML_DIR
)
99 $(Echo
) Installing MAN Clang Tools Documentation
100 $(Verb
) $(MKDIR
) $(MAN_DIR
)
101 $(Verb
) $(DataInstall
) $(MAN
) $(MAN_DIR
)
104 $(Echo
) Installing PS Clang Tools Documentation
105 $(Verb
) $(MKDIR
) $(PS_DIR
)
106 $(Verb
) $(DataInstall
) $(PS
) $(PS_DIR
)
108 install-local
:: $(INSTALL_TARGETS
)
111 $(Echo
) Uninstalling Clang Tools Documentation
112 $(Verb
) $(RM
) -rf
$(HTML_DIR
) $(MAN_DIR
) $(PS_DIR
)
115 $(Echo
) "POD : " '$(POD)'
116 $(Echo
) "HTML : " '$(HTML)'