| 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 |  | 
| Reid Spencer | bdf6a39 | 2005-01-16 02:21:29 +0000 | [diff] [blame] | 47 | POD := $(wildcard $(PROJ_SRC_DIR)/*.pod) | 
| Reid Spencer | 52d7a75 | 2004-11-29 03:45:02 +0000 | [diff] [blame] | 48 |  | 
|  | 49 | EXTRA_DIST := $(POD) index.html | 
|  | 50 |  | 
| Reid Spencer | bdf6a39 | 2005-01-16 02:21:29 +0000 | [diff] [blame] | 51 | HTML = $(patsubst $(PROJ_SRC_DIR)/%.pod, $(PROJ_OBJ_DIR)/%.html, $(POD)) | 
|  | 52 | MAN = $(patsubst $(PROJ_SRC_DIR)/%.pod, $(PROJ_OBJ_DIR)/%.1, $(POD)) | 
|  | 53 | PS = $(patsubst $(PROJ_SRC_DIR)/%.pod, $(PROJ_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 |  | 
| Chris Lattner | dbcd4f5 | 2004-12-09 21:06:32 +0000 | [diff] [blame] | 60 | html: $(HTML) | 
|  | 61 |  | 
| Reid Spencer | bdf6a39 | 2005-01-16 02:21:29 +0000 | [diff] [blame] | 62 | $(PROJ_OBJ_DIR)/%.html: %.pod | 
| Reid Spencer | 52d7a75 | 2004-11-29 03:45:02 +0000 | [diff] [blame] | 63 | $(POD2HTML) --css=manpage.css --htmlroot=. --podpath=. \ | 
|  | 64 | --noindex --infile=$< --outfile=$@ --title=$* | 
| Brian Gaeke | e993d20 | 2004-05-14 19:50:33 +0000 | [diff] [blame] | 65 |  | 
| Reid Spencer | bdf6a39 | 2005-01-16 02:21:29 +0000 | [diff] [blame] | 66 | $(PROJ_OBJ_DIR)/%.1: %.pod | 
|  | 67 | $(POD2MAN) --release=$(LLVMVersion) \ | 
| Reid Spencer | 52d7a75 | 2004-11-29 03:45:02 +0000 | [diff] [blame] | 68 | --center="LLVM Command Guide" $< $@ | 
| Brian Gaeke | e993d20 | 2004-05-14 19:50:33 +0000 | [diff] [blame] | 69 |  | 
| Reid Spencer | bdf6a39 | 2005-01-16 02:21:29 +0000 | [diff] [blame] | 70 | $(PROJ_OBJ_DIR)/%.ps: $(PROJ_OBJ_DIR)/%.1 | 
| Reid Spencer | 52d7a75 | 2004-11-29 03:45:02 +0000 | [diff] [blame] | 71 | $(GROFF) -Tps -man $< > $@ | 
| Brian Gaeke | e993d20 | 2004-05-14 19:50:33 +0000 | [diff] [blame] | 72 |  | 
| Reid Spencer | 52d7a75 | 2004-11-29 03:45:02 +0000 | [diff] [blame] | 73 | clean-local:: | 
|  | 74 | $(Verb) $(RM) -f pod2htm*.*~~ $(HTML) $(MAN) $(PS) | 
| Brian Gaeke | e993d20 | 2004-05-14 19:50:33 +0000 | [diff] [blame] | 75 |  | 
| Reid Spencer | bdf6a39 | 2005-01-16 02:21:29 +0000 | [diff] [blame] | 76 | HTML_DIR := $(PROJ_docsdir)/html/CommandGuide | 
|  | 77 | MAN_DIR  := $(PROJ_mandir)/man1 | 
|  | 78 | PS_DIR   := $(PROJ_docsdir)/ps | 
| Reid Spencer | 3c54b6c | 2004-11-29 04:34:05 +0000 | [diff] [blame] | 79 |  | 
| Reid Spencer | 52d7a75 | 2004-11-29 03:45:02 +0000 | [diff] [blame] | 80 | install-local:: $(HTML) $(MAN) $(PS) | 
|  | 81 | $(Echo) Installing HTML CommandGuide Documentation | 
| Reid Spencer | 29fbdd7 | 2005-02-24 21:28:08 +0000 | [diff] [blame^] | 82 | $(Verb) $(MKDIR) $(HTML_DIR) | 
|  | 83 | $(Verb) $(DataInstall) $(HTML) $(HTML_DIR) | 
|  | 84 | $(Verb) $(DataInstall) $(PROJ_SRC_DIR)/index.html $(HTML_DIR) | 
|  | 85 | $(Verb) $(DataInstall) -C $(PROJ_SRC_DIR)/manpage.css $(HTML_DIR) | 
| Reid Spencer | 52d7a75 | 2004-11-29 03:45:02 +0000 | [diff] [blame] | 86 | $(Echo) Installing MAN CommandGuide Documentation | 
| Reid Spencer | 29fbdd7 | 2005-02-24 21:28:08 +0000 | [diff] [blame^] | 87 | $(Verb) $(MKDIR) $(MAN_DIR) | 
|  | 88 | $(Verb) $(DataInstall) $(MAN) $(MAN_DIR) | 
| Reid Spencer | 52d7a75 | 2004-11-29 03:45:02 +0000 | [diff] [blame] | 89 | $(Echo) Installing PS CommandGuide Documentation | 
| Reid Spencer | 29fbdd7 | 2005-02-24 21:28:08 +0000 | [diff] [blame^] | 90 | $(Verb) $(MKDIR) $(PS_DIR) | 
|  | 91 | $(Verb) $(DataInstall) $(PS) $(PS_DIR) | 
| Reid Spencer | 52d7a75 | 2004-11-29 03:45:02 +0000 | [diff] [blame] | 92 |  | 
|  | 93 | uninstall-local:: | 
|  | 94 | $(Echo) Uninstalling Documentation | 
|  | 95 | $(Verb) $(RM) -rf $(LLVM_DOCSDIR) | 
|  | 96 |  | 
|  | 97 | printvars:: | 
|  | 98 | $(Echo) "POD            : " '$(POD)' | 
|  | 99 | $(Echo) "HTML           : " '$(HTML)' | 
| Reid Spencer | 6318456 | 2004-12-08 04:43:40 +0000 | [diff] [blame] | 100 |  | 
|  | 101 | endif |