blob: ee5834cda7d60c8c128ab17087decd8d0bba6e88 [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
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.
16
17POD := $(wildcard *.pod)
18HTML := $(patsubst %.pod,html/%.html, $(POD))
19
20all: $(HTML)
21
22html/%.html : %.pod
23 pod2html --css=manpage.css --htmlroot=. --podpath=. \
24 --noindex --infile=$< --outfile=$@ --title=$*
25
26else
27
Reid Spencer52d7a752004-11-29 03:45:02 +000028LEVEL := ../..
29
30include $(LEVEL)/Makefile.common
31
32POD := $(wildcard $(BUILD_SRC_DIR)/*.pod)
33
34EXTRA_DIST := $(POD) index.html
35
Reid Spencer3c54b6c2004-11-29 04:34:05 +000036HTML = $(patsubst $(BUILD_SRC_DIR)/%.pod, $(BUILD_OBJ_DIR)/%.html, $(POD))
37MAN = $(patsubst $(BUILD_SRC_DIR)/%.pod, $(BUILD_OBJ_DIR)/%.1, $(POD))
38PS = $(patsubst $(BUILD_SRC_DIR)/%.pod, $(BUILD_OBJ_DIR)/%.ps, $(POD))
Reid Spencer52d7a752004-11-29 03:45:02 +000039
Brian Gaekee993d202004-05-14 19:50:33 +000040.SUFFIXES:
41.SUFFIXES: .html .pod .1 .ps
42
Reid Spencer52d7a752004-11-29 03:45:02 +000043$(HTML) : html/.dir man/.dir man/man1/.dir ps/.dir
44
Reid Spencer3c54b6c2004-11-29 04:34:05 +000045$(BUILD_OBJ_DIR)/%.html: %.pod
Reid Spencer52d7a752004-11-29 03:45:02 +000046 $(POD2HTML) --css=manpage.css --htmlroot=. --podpath=. \
47 --noindex --infile=$< --outfile=$@ --title=$*
Brian Gaekee993d202004-05-14 19:50:33 +000048
Reid Spencer3c54b6c2004-11-29 04:34:05 +000049$(BUILD_OBJ_DIR)/%.1: %.pod
Reid Spencer52d7a752004-11-29 03:45:02 +000050 $(POD2MAN) --release=$(PACKAGE_VERSION) \
51 --center="LLVM Command Guide" $< $@
Brian Gaekee993d202004-05-14 19:50:33 +000052
Reid Spencer5507eab2004-11-29 14:46:29 +000053$(BUILD_OBJ_DIR)/%.ps: $(BUILD_OBJ_DIR)/%.1
Reid Spencer52d7a752004-11-29 03:45:02 +000054 $(GROFF) -Tps -man $< > $@
Brian Gaekee993d202004-05-14 19:50:33 +000055
Reid Spencer52d7a752004-11-29 03:45:02 +000056clean-local::
57 $(Verb) $(RM) -f pod2htm*.*~~ $(HTML) $(MAN) $(PS)
Brian Gaekee993d202004-05-14 19:50:33 +000058
Reid Spencer3c54b6c2004-11-29 04:34:05 +000059HTML_DIR := $(LLVM_DOCSDIR)/html/CommandGuide
60MAN_DIR := $(LLVM_MANDIR)/man1
61PS_DIR := $(LLVM_DOCSDIR)/ps
62
Reid Spencer52d7a752004-11-29 03:45:02 +000063install-local:: $(HTML) $(MAN) $(PS)
64 $(Echo) Installing HTML CommandGuide Documentation
Reid Spencer3c54b6c2004-11-29 04:34:05 +000065 $(Verb) $(INSTALL) -d $(HTML_DIR)
66 $(Verb) $(INSTALL) -C $(HTML) $(HTML_DIR)
67 $(Verb) $(INSTALL) -C $(BUILD_SRC_DIR)/index.html $(HTML_DIR)
68 $(Verb) $(INSTALL) -C $(BUILD_SRC_DIR)/manpage.css $(HTML_DIR)
Reid Spencer52d7a752004-11-29 03:45:02 +000069 $(Echo) Installing MAN CommandGuide Documentation
Reid Spencer3c54b6c2004-11-29 04:34:05 +000070 $(Verb) $(INSTALL) -d $(MAN_DIR)
71 $(Verb) $(INSTALL) -C $(MAN) $(MAN_DIR)
Reid Spencer52d7a752004-11-29 03:45:02 +000072 $(Echo) Installing PS CommandGuide Documentation
Reid Spencer3c54b6c2004-11-29 04:34:05 +000073 $(Verb) $(INSTALL) -d $(PS_DIR)
74 $(Verb) $(INSTALL) -C $(PS) $(PS_DIR)
Reid Spencer52d7a752004-11-29 03:45:02 +000075
76uninstall-local::
77 $(Echo) Uninstalling Documentation
78 $(Verb) $(RM) -rf $(LLVM_DOCSDIR)
79
80printvars::
81 $(Echo) "POD : " '$(POD)'
82 $(Echo) "HTML : " '$(HTML)'
Reid Spencer63184562004-12-08 04:43:40 +000083
84endif