blob: cf77e6a33db06428b4512e67be657da7b13cff8b [file] [log] [blame]
Reid Spencer52d7a752004-11-29 03:45:02 +00001##===- docs/CommandGuide/Makefile --------------------------*- Makefile -*-===##
2#
3# The LLVM Compiler Infrastructure
4#
Chris Lattner57360d12007-12-29 20:11:13 +00005# This file is distributed under the University of Illinois Open Source
6# License. See LICENSE.TXT for details.
Reid Spencer52d7a752004-11-29 03:45:02 +00007#
8##===----------------------------------------------------------------------===##
Brian Gaekee993d202004-05-14 19:50:33 +00009
Reid Spencer63184562004-12-08 04:43:40 +000010ifdef BUILD_FOR_WEBSITE
11# 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 Lattner18232a52008-02-12 06:07:47 +000016SRC_DOC_DIR=
17DST_HTML_DIR=html/
18DST_MAN_DIR=man/man1/
19DST_PS_DIR=ps/
Reid Spencer63184562004-12-08 04:43:40 +000020
Chris Lattner18232a52008-02-12 06:07:47 +000021# If we are in BUILD_FOR_WEBSITE mode, default to the all target.
22all:: html man ps
Reid Spencere47fd7d2004-12-08 19:01:01 +000023
24clean:
25 rm -f pod2htm*.*~~ $(HTML) $(MAN) $(PS)
Tanya Lattner301d5b42008-06-09 07:14:31 +000026
27# To create other directories, as needed, and timestamp their creation
28%/.dir:
29 -mkdir $* > /dev/null
30 date > $@
31
Chris Lattner18232a52008-02-12 06:07:47 +000032else
Reid Spencer63184562004-12-08 04:43:40 +000033
Chris Lattner18232a52008-02-12 06:07:47 +000034# Otherwise, if not in BUILD_FOR_WEBSITE mode, use the project info.
Reid Spencer52d7a752004-11-29 03:45:02 +000035LEVEL := ../..
Reid Spencer52d7a752004-11-29 03:45:02 +000036include $(LEVEL)/Makefile.common
37
Chris Lattner18232a52008-02-12 06:07:47 +000038SRC_DOC_DIR=$(PROJ_SRC_DIR)/
39DST_HTML_DIR=$(PROJ_OBJ_DIR)/
40DST_MAN_DIR=$(PROJ_OBJ_DIR)/
41DST_PS_DIR=$(PROJ_OBJ_DIR)/
Reid Spencer52d7a752004-11-29 03:45:02 +000042
Chris Lattner18232a52008-02-12 06:07:47 +000043endif
Reid Spencer52d7a752004-11-29 03:45:02 +000044
Chris Lattner18232a52008-02-12 06:07:47 +000045
46POD := $(wildcard $(SRC_DOC_DIR)*.pod)
47HTML := $(patsubst $(SRC_DOC_DIR)%.pod, $(DST_HTML_DIR)%.html, $(POD))
48MAN := $(patsubst $(SRC_DOC_DIR)%.pod, $(DST_MAN_DIR)%.1, $(POD))
49PS := $(patsubst $(SRC_DOC_DIR)%.pod, $(DST_PS_DIR)%.ps, $(POD))
Reid Spencer52d7a752004-11-29 03:45:02 +000050
Brian Gaekee993d202004-05-14 19:50:33 +000051.SUFFIXES:
52.SUFFIXES: .html .pod .1 .ps
53
Chris Lattner18232a52008-02-12 06:07:47 +000054$(DST_HTML_DIR)%.html: %.pod $(DST_HTML_DIR)/.dir
55 pod2html --css=manpage.css --htmlroot=. \
56 --podpath=. --noindex --infile=$< --outfile=$@ --title=$*
57
58$(DST_MAN_DIR)%.1: %.pod $(DST_MAN_DIR)/.dir
59 pod2man --release=CVS --center="LLVM Command Guide" $< $@
60
61$(DST_PS_DIR)%.ps: $(DST_MAN_DIR)%.1 $(DST_PS_DIR)/.dir
62 groff -Tps -man $< > $@
63
Reid Spencer52d7a752004-11-29 03:45:02 +000064
Chris Lattnerdbcd4f52004-12-09 21:06:32 +000065html: $(HTML)
Chris Lattner18232a52008-02-12 06:07:47 +000066man: $(MAN)
67ps: $(PS)
Chris Lattnerdbcd4f52004-12-09 21:06:32 +000068
Chris Lattner18232a52008-02-12 06:07:47 +000069EXTRA_DIST := $(POD) index.html
Brian Gaekee993d202004-05-14 19:50:33 +000070
Reid Spencer52d7a752004-11-29 03:45:02 +000071clean-local::
72 $(Verb) $(RM) -f pod2htm*.*~~ $(HTML) $(MAN) $(PS)
Brian Gaekee993d202004-05-14 19:50:33 +000073
Reid Spencerbdf6a392005-01-16 02:21:29 +000074HTML_DIR := $(PROJ_docsdir)/html/CommandGuide
75MAN_DIR := $(PROJ_mandir)/man1
76PS_DIR := $(PROJ_docsdir)/ps
Reid Spencer3c54b6c2004-11-29 04:34:05 +000077
Reid Spencer52d7a752004-11-29 03:45:02 +000078install-local:: $(HTML) $(MAN) $(PS)
79 $(Echo) Installing HTML CommandGuide Documentation
Reid Spencer29fbdd72005-02-24 21:28:08 +000080 $(Verb) $(MKDIR) $(HTML_DIR)
81 $(Verb) $(DataInstall) $(HTML) $(HTML_DIR)
82 $(Verb) $(DataInstall) $(PROJ_SRC_DIR)/index.html $(HTML_DIR)
Reid Spencer837300a2005-02-24 21:41:26 +000083 $(Verb) $(DataInstall) $(PROJ_SRC_DIR)/manpage.css $(HTML_DIR)
Reid Spencer52d7a752004-11-29 03:45:02 +000084 $(Echo) Installing MAN CommandGuide Documentation
Reid Spencer29fbdd72005-02-24 21:28:08 +000085 $(Verb) $(MKDIR) $(MAN_DIR)
86 $(Verb) $(DataInstall) $(MAN) $(MAN_DIR)
Reid Spencer52d7a752004-11-29 03:45:02 +000087 $(Echo) Installing PS CommandGuide Documentation
Reid Spencer29fbdd72005-02-24 21:28:08 +000088 $(Verb) $(MKDIR) $(PS_DIR)
89 $(Verb) $(DataInstall) $(PS) $(PS_DIR)
Reid Spencer52d7a752004-11-29 03:45:02 +000090
91uninstall-local::
Erick Tryzelaar4f678c32008-03-30 20:32:18 +000092 $(Echo) Uninstalling CommandGuide Documentation
93 $(Verb) $(RM) -rf $(HTML_DIR) $(MAN_DIR) $(PS_DIR)
Reid Spencer52d7a752004-11-29 03:45:02 +000094
95printvars::
96 $(Echo) "POD : " '$(POD)'
97 $(Echo) "HTML : " '$(HTML)'