blob: ffbbb97abc7be257305de1d17236798d7c1ae4c0 [file] [log] [blame]
Dan Gohmanf17a25c2007-07-18 16:29:46 +00001##===- docs/CommandGuide/Makefile --------------------------*- Makefile -*-===##
2#
3# The LLVM Compiler Infrastructure
4#
Chris Lattner3876aa72007-12-29 20:11:13 +00005# This file is distributed under the University of Illinois Open Source
6# License. See LICENSE.TXT for details.
Dan Gohmanf17a25c2007-07-18 16:29:46 +00007#
8##===----------------------------------------------------------------------===##
9
10ifdef BUILD_FOR_WEBSITE
Dan Gohmanf17a25c2007-07-18 16:29:46 +000011# This special case is for keeping the CommandGuide on the LLVM web site
12# up to date automatically as the documents are checked in. It must build
13# the POD files to HTML only and keep them in the src directories. It must also
14# build in an unconfigured tree, hence the ifdef. To use this, run
15# make -s BUILD_FOR_WEBSITE=1 inside the cvs commit script.
Chris Lattner10a39792008-02-12 06:07:47 +000016SRC_DOC_DIR=
17DST_HTML_DIR=html/
18DST_MAN_DIR=man/man1/
19DST_PS_DIR=ps/
Dan Gohmanf17a25c2007-07-18 16:29:46 +000020
Chris Lattner10a39792008-02-12 06:07:47 +000021# If we are in BUILD_FOR_WEBSITE mode, default to the all target.
22all:: html man ps
Dan Gohmanf17a25c2007-07-18 16:29:46 +000023
24clean:
25 rm -f pod2htm*.*~~ $(HTML) $(MAN) $(PS)
Chris Lattner10a39792008-02-12 06:07:47 +000026else
Dan Gohmanf17a25c2007-07-18 16:29:46 +000027
Chris Lattner10a39792008-02-12 06:07:47 +000028# Otherwise, if not in BUILD_FOR_WEBSITE mode, use the project info.
Dan Gohmanf17a25c2007-07-18 16:29:46 +000029LEVEL := ../..
Dan Gohmanf17a25c2007-07-18 16:29:46 +000030include $(LEVEL)/Makefile.common
31
Chris Lattner10a39792008-02-12 06:07:47 +000032SRC_DOC_DIR=$(PROJ_SRC_DIR)/
33DST_HTML_DIR=$(PROJ_OBJ_DIR)/
34DST_MAN_DIR=$(PROJ_OBJ_DIR)/
35DST_PS_DIR=$(PROJ_OBJ_DIR)/
Dan Gohmanf17a25c2007-07-18 16:29:46 +000036
Chris Lattner10a39792008-02-12 06:07:47 +000037endif
Dan Gohmanf17a25c2007-07-18 16:29:46 +000038
Chris Lattner10a39792008-02-12 06:07:47 +000039
40POD := $(wildcard $(SRC_DOC_DIR)*.pod)
41HTML := $(patsubst $(SRC_DOC_DIR)%.pod, $(DST_HTML_DIR)%.html, $(POD))
42MAN := $(patsubst $(SRC_DOC_DIR)%.pod, $(DST_MAN_DIR)%.1, $(POD))
43PS := $(patsubst $(SRC_DOC_DIR)%.pod, $(DST_PS_DIR)%.ps, $(POD))
Dan Gohmanf17a25c2007-07-18 16:29:46 +000044
45.SUFFIXES:
46.SUFFIXES: .html .pod .1 .ps
47
Chris Lattner10a39792008-02-12 06:07:47 +000048$(DST_HTML_DIR)%.html: %.pod $(DST_HTML_DIR)/.dir
49 pod2html --css=manpage.css --htmlroot=. \
50 --podpath=. --noindex --infile=$< --outfile=$@ --title=$*
51
52$(DST_MAN_DIR)%.1: %.pod $(DST_MAN_DIR)/.dir
53 pod2man --release=CVS --center="LLVM Command Guide" $< $@
54
55$(DST_PS_DIR)%.ps: $(DST_MAN_DIR)%.1 $(DST_PS_DIR)/.dir
56 groff -Tps -man $< > $@
57
Dan Gohmanf17a25c2007-07-18 16:29:46 +000058
59html: $(HTML)
Chris Lattner10a39792008-02-12 06:07:47 +000060man: $(MAN)
61ps: $(PS)
Dan Gohmanf17a25c2007-07-18 16:29:46 +000062
Chris Lattner10a39792008-02-12 06:07:47 +000063EXTRA_DIST := $(POD) index.html
Dan Gohmanf17a25c2007-07-18 16:29:46 +000064
65clean-local::
66 $(Verb) $(RM) -f pod2htm*.*~~ $(HTML) $(MAN) $(PS)
67
68HTML_DIR := $(PROJ_docsdir)/html/CommandGuide
69MAN_DIR := $(PROJ_mandir)/man1
70PS_DIR := $(PROJ_docsdir)/ps
71
72install-local:: $(HTML) $(MAN) $(PS)
73 $(Echo) Installing HTML CommandGuide Documentation
74 $(Verb) $(MKDIR) $(HTML_DIR)
75 $(Verb) $(DataInstall) $(HTML) $(HTML_DIR)
76 $(Verb) $(DataInstall) $(PROJ_SRC_DIR)/index.html $(HTML_DIR)
77 $(Verb) $(DataInstall) $(PROJ_SRC_DIR)/manpage.css $(HTML_DIR)
78 $(Echo) Installing MAN CommandGuide Documentation
79 $(Verb) $(MKDIR) $(MAN_DIR)
80 $(Verb) $(DataInstall) $(MAN) $(MAN_DIR)
81 $(Echo) Installing PS CommandGuide Documentation
82 $(Verb) $(MKDIR) $(PS_DIR)
83 $(Verb) $(DataInstall) $(PS) $(PS_DIR)
84
85uninstall-local::
86 $(Echo) Uninstalling Documentation
87 $(Verb) $(RM) -rf $(LLVM_DOCSDIR)
88
89printvars::
90 $(Echo) "POD : " '$(POD)'
91 $(Echo) "HTML : " '$(HTML)'