Reid Spencer | 52d7a75 | 2004-11-29 03:45:02 +0000 | [diff] [blame] | 1 | ##===- 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 Gaeke | e993d20 | 2004-05-14 19:50:33 +0000 | [diff] [blame] | 9 | |
Reid Spencer | 6318456 | 2004-12-08 04:43:40 +0000 | [diff] [blame] | 10 | ifdef BUILD_FOR_WEBSITE |
Reid Spencer | e47fd7d | 2004-12-08 19:01:01 +0000 | [diff] [blame^] | 11 | |
Reid Spencer | 6318456 | 2004-12-08 04:43:40 +0000 | [diff] [blame] | 12 | # 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 | |
| 18 | POD := $(wildcard *.pod) |
Reid Spencer | e47fd7d | 2004-12-08 19:01:01 +0000 | [diff] [blame^] | 19 | HTML := $(patsubst %.pod, html/%.html, $(POD)) |
| 20 | MAN := $(patsubst %.pod, man/man1/%.1, $(POD)) |
| 21 | PS := $(patsubst %.pod, ps/%.ps, $(POD)) |
Reid Spencer | 6318456 | 2004-12-08 04:43:40 +0000 | [diff] [blame] | 22 | |
Reid Spencer | e47fd7d | 2004-12-08 19:01:01 +0000 | [diff] [blame^] | 23 | all: $(HTML) $(MAN) $(PS) |
Reid Spencer | 6318456 | 2004-12-08 04:43:40 +0000 | [diff] [blame] | 24 | |
Reid Spencer | e47fd7d | 2004-12-08 19:01:01 +0000 | [diff] [blame^] | 25 | .SUFFIXES: |
| 26 | .SUFFIXES: .html .pod .1 .ps |
| 27 | |
| 28 | html/%.html: %.pod |
| 29 | pod2html --css=manpage.css --htmlroot=. \ |
| 30 | --podpath=. --noindex --infile=$< --outfile=$@ --title=$* |
| 31 | |
| 32 | man/man1/%.1: %.pod |
| 33 | pod2man --release=1.4 --center="LLVM Command Guide" $< $@ |
| 34 | |
| 35 | ps/%.ps: man/man1/%.1 |
| 36 | groff -Tps -man $< > $@ |
| 37 | |
| 38 | clean: |
| 39 | rm -f pod2htm*.*~~ $(HTML) $(MAN) $(PS) |
Reid Spencer | 6318456 | 2004-12-08 04:43:40 +0000 | [diff] [blame] | 40 | |
| 41 | else |
| 42 | |
Reid Spencer | 52d7a75 | 2004-11-29 03:45:02 +0000 | [diff] [blame] | 43 | LEVEL := ../.. |
| 44 | |
| 45 | include $(LEVEL)/Makefile.common |
| 46 | |
| 47 | POD := $(wildcard $(BUILD_SRC_DIR)/*.pod) |
| 48 | |
| 49 | EXTRA_DIST := $(POD) index.html |
| 50 | |
Reid Spencer | 3c54b6c | 2004-11-29 04:34:05 +0000 | [diff] [blame] | 51 | HTML = $(patsubst $(BUILD_SRC_DIR)/%.pod, $(BUILD_OBJ_DIR)/%.html, $(POD)) |
| 52 | MAN = $(patsubst $(BUILD_SRC_DIR)/%.pod, $(BUILD_OBJ_DIR)/%.1, $(POD)) |
| 53 | PS = $(patsubst $(BUILD_SRC_DIR)/%.pod, $(BUILD_OBJ_DIR)/%.ps, $(POD)) |
Reid Spencer | 52d7a75 | 2004-11-29 03:45:02 +0000 | [diff] [blame] | 54 | |
Brian Gaeke | e993d20 | 2004-05-14 19:50:33 +0000 | [diff] [blame] | 55 | .SUFFIXES: |
| 56 | .SUFFIXES: .html .pod .1 .ps |
| 57 | |
Reid Spencer | 52d7a75 | 2004-11-29 03:45:02 +0000 | [diff] [blame] | 58 | $(HTML) : html/.dir man/.dir man/man1/.dir ps/.dir |
| 59 | |
Reid Spencer | 3c54b6c | 2004-11-29 04:34:05 +0000 | [diff] [blame] | 60 | $(BUILD_OBJ_DIR)/%.html: %.pod |
Reid Spencer | 52d7a75 | 2004-11-29 03:45:02 +0000 | [diff] [blame] | 61 | $(POD2HTML) --css=manpage.css --htmlroot=. --podpath=. \ |
| 62 | --noindex --infile=$< --outfile=$@ --title=$* |
Brian Gaeke | e993d20 | 2004-05-14 19:50:33 +0000 | [diff] [blame] | 63 | |
Reid Spencer | 3c54b6c | 2004-11-29 04:34:05 +0000 | [diff] [blame] | 64 | $(BUILD_OBJ_DIR)/%.1: %.pod |
Reid Spencer | 52d7a75 | 2004-11-29 03:45:02 +0000 | [diff] [blame] | 65 | $(POD2MAN) --release=$(PACKAGE_VERSION) \ |
| 66 | --center="LLVM Command Guide" $< $@ |
Brian Gaeke | e993d20 | 2004-05-14 19:50:33 +0000 | [diff] [blame] | 67 | |
Reid Spencer | 5507eab | 2004-11-29 14:46:29 +0000 | [diff] [blame] | 68 | $(BUILD_OBJ_DIR)/%.ps: $(BUILD_OBJ_DIR)/%.1 |
Reid Spencer | 52d7a75 | 2004-11-29 03:45:02 +0000 | [diff] [blame] | 69 | $(GROFF) -Tps -man $< > $@ |
Brian Gaeke | e993d20 | 2004-05-14 19:50:33 +0000 | [diff] [blame] | 70 | |
Reid Spencer | 52d7a75 | 2004-11-29 03:45:02 +0000 | [diff] [blame] | 71 | clean-local:: |
| 72 | $(Verb) $(RM) -f pod2htm*.*~~ $(HTML) $(MAN) $(PS) |
Brian Gaeke | e993d20 | 2004-05-14 19:50:33 +0000 | [diff] [blame] | 73 | |
Reid Spencer | 3c54b6c | 2004-11-29 04:34:05 +0000 | [diff] [blame] | 74 | HTML_DIR := $(LLVM_DOCSDIR)/html/CommandGuide |
| 75 | MAN_DIR := $(LLVM_MANDIR)/man1 |
| 76 | PS_DIR := $(LLVM_DOCSDIR)/ps |
| 77 | |
Reid Spencer | 52d7a75 | 2004-11-29 03:45:02 +0000 | [diff] [blame] | 78 | install-local:: $(HTML) $(MAN) $(PS) |
| 79 | $(Echo) Installing HTML CommandGuide Documentation |
Reid Spencer | 3c54b6c | 2004-11-29 04:34:05 +0000 | [diff] [blame] | 80 | $(Verb) $(INSTALL) -d $(HTML_DIR) |
| 81 | $(Verb) $(INSTALL) -C $(HTML) $(HTML_DIR) |
| 82 | $(Verb) $(INSTALL) -C $(BUILD_SRC_DIR)/index.html $(HTML_DIR) |
| 83 | $(Verb) $(INSTALL) -C $(BUILD_SRC_DIR)/manpage.css $(HTML_DIR) |
Reid Spencer | 52d7a75 | 2004-11-29 03:45:02 +0000 | [diff] [blame] | 84 | $(Echo) Installing MAN CommandGuide Documentation |
Reid Spencer | 3c54b6c | 2004-11-29 04:34:05 +0000 | [diff] [blame] | 85 | $(Verb) $(INSTALL) -d $(MAN_DIR) |
| 86 | $(Verb) $(INSTALL) -C $(MAN) $(MAN_DIR) |
Reid Spencer | 52d7a75 | 2004-11-29 03:45:02 +0000 | [diff] [blame] | 87 | $(Echo) Installing PS CommandGuide Documentation |
Reid Spencer | 3c54b6c | 2004-11-29 04:34:05 +0000 | [diff] [blame] | 88 | $(Verb) $(INSTALL) -d $(PS_DIR) |
| 89 | $(Verb) $(INSTALL) -C $(PS) $(PS_DIR) |
Reid Spencer | 52d7a75 | 2004-11-29 03:45:02 +0000 | [diff] [blame] | 90 | |
| 91 | uninstall-local:: |
| 92 | $(Echo) Uninstalling Documentation |
| 93 | $(Verb) $(RM) -rf $(LLVM_DOCSDIR) |
| 94 | |
| 95 | printvars:: |
| 96 | $(Echo) "POD : " '$(POD)' |
| 97 | $(Echo) "HTML : " '$(HTML)' |
Reid Spencer | 6318456 | 2004-12-08 04:43:40 +0000 | [diff] [blame] | 98 | |
| 99 | endif |