blob: 836c461801c4ab145b44dd069ef6aa9e7ea98171 [file] [log] [blame]
Reid Spencer52d7a752004-11-29 03:45:02 +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##===----------------------------------------------------------------------===##
Brian Gaekee993d202004-05-14 19:50:33 +00009
Reid Spencer63184562004-12-08 04:43:40 +000010ifdef BUILD_FOR_WEBSITE
Reid Spencere47fd7d2004-12-08 19:01:01 +000011
Reid Spencer63184562004-12-08 04:43:40 +000012# 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)
Reid Spencere47fd7d2004-12-08 19:01:01 +000019HTML := $(patsubst %.pod, html/%.html, $(POD))
20MAN := $(patsubst %.pod, man/man1/%.1, $(POD))
21PS := $(patsubst %.pod, ps/%.ps, $(POD))
Reid Spencer63184562004-12-08 04:43:40 +000022
Reid Spencere47fd7d2004-12-08 19:01:01 +000023all: $(HTML) $(MAN) $(PS)
Reid Spencer63184562004-12-08 04:43:40 +000024
Reid Spencere47fd7d2004-12-08 19:01:01 +000025.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=1.4 --center="LLVM Command Guide" $< $@
34
35ps/%.ps: man/man1/%.1
36 groff -Tps -man $< > $@
37
38clean:
39 rm -f pod2htm*.*~~ $(HTML) $(MAN) $(PS)
Reid Spencer63184562004-12-08 04:43:40 +000040
41else
42
Reid Spencer52d7a752004-11-29 03:45:02 +000043LEVEL := ../..
44
45include $(LEVEL)/Makefile.common
46
47POD := $(wildcard $(BUILD_SRC_DIR)/*.pod)
48
49EXTRA_DIST := $(POD) index.html
50
Reid Spencer3c54b6c2004-11-29 04:34:05 +000051HTML = $(patsubst $(BUILD_SRC_DIR)/%.pod, $(BUILD_OBJ_DIR)/%.html, $(POD))
52MAN = $(patsubst $(BUILD_SRC_DIR)/%.pod, $(BUILD_OBJ_DIR)/%.1, $(POD))
53PS = $(patsubst $(BUILD_SRC_DIR)/%.pod, $(BUILD_OBJ_DIR)/%.ps, $(POD))
Reid Spencer52d7a752004-11-29 03:45:02 +000054
Brian Gaekee993d202004-05-14 19:50:33 +000055.SUFFIXES:
56.SUFFIXES: .html .pod .1 .ps
57
Reid Spencer52d7a752004-11-29 03:45:02 +000058$(HTML) : html/.dir man/.dir man/man1/.dir ps/.dir
59
Chris Lattnerdbcd4f52004-12-09 21:06:32 +000060html: $(HTML)
61
Reid Spencer3c54b6c2004-11-29 04:34:05 +000062$(BUILD_OBJ_DIR)/%.html: %.pod
Reid Spencer52d7a752004-11-29 03:45:02 +000063 $(POD2HTML) --css=manpage.css --htmlroot=. --podpath=. \
64 --noindex --infile=$< --outfile=$@ --title=$*
Brian Gaekee993d202004-05-14 19:50:33 +000065
Reid Spencer3c54b6c2004-11-29 04:34:05 +000066$(BUILD_OBJ_DIR)/%.1: %.pod
Reid Spencer52d7a752004-11-29 03:45:02 +000067 $(POD2MAN) --release=$(PACKAGE_VERSION) \
68 --center="LLVM Command Guide" $< $@
Brian Gaekee993d202004-05-14 19:50:33 +000069
Reid Spencer5507eab2004-11-29 14:46:29 +000070$(BUILD_OBJ_DIR)/%.ps: $(BUILD_OBJ_DIR)/%.1
Reid Spencer52d7a752004-11-29 03:45:02 +000071 $(GROFF) -Tps -man $< > $@
Brian Gaekee993d202004-05-14 19:50:33 +000072
Reid Spencer52d7a752004-11-29 03:45:02 +000073clean-local::
74 $(Verb) $(RM) -f pod2htm*.*~~ $(HTML) $(MAN) $(PS)
Brian Gaekee993d202004-05-14 19:50:33 +000075
Reid Spencer3c54b6c2004-11-29 04:34:05 +000076HTML_DIR := $(LLVM_DOCSDIR)/html/CommandGuide
77MAN_DIR := $(LLVM_MANDIR)/man1
78PS_DIR := $(LLVM_DOCSDIR)/ps
79
Reid Spencer52d7a752004-11-29 03:45:02 +000080install-local:: $(HTML) $(MAN) $(PS)
81 $(Echo) Installing HTML CommandGuide Documentation
Reid Spencer3c54b6c2004-11-29 04:34:05 +000082 $(Verb) $(INSTALL) -d $(HTML_DIR)
83 $(Verb) $(INSTALL) -C $(HTML) $(HTML_DIR)
84 $(Verb) $(INSTALL) -C $(BUILD_SRC_DIR)/index.html $(HTML_DIR)
85 $(Verb) $(INSTALL) -C $(BUILD_SRC_DIR)/manpage.css $(HTML_DIR)
Reid Spencer52d7a752004-11-29 03:45:02 +000086 $(Echo) Installing MAN CommandGuide Documentation
Reid Spencer3c54b6c2004-11-29 04:34:05 +000087 $(Verb) $(INSTALL) -d $(MAN_DIR)
88 $(Verb) $(INSTALL) -C $(MAN) $(MAN_DIR)
Reid Spencer52d7a752004-11-29 03:45:02 +000089 $(Echo) Installing PS CommandGuide Documentation
Reid Spencer3c54b6c2004-11-29 04:34:05 +000090 $(Verb) $(INSTALL) -d $(PS_DIR)
91 $(Verb) $(INSTALL) -C $(PS) $(PS_DIR)
Reid Spencer52d7a752004-11-29 03:45:02 +000092
93uninstall-local::
94 $(Echo) Uninstalling Documentation
95 $(Verb) $(RM) -rf $(LLVM_DOCSDIR)
96
97printvars::
98 $(Echo) "POD : " '$(POD)'
99 $(Echo) "HTML : " '$(HTML)'
Reid Spencer63184562004-12-08 04:43:40 +0000100
101endif