Reid Spencer | 52d7a75 | 2004-11-29 03:45:02 +0000 | [diff] [blame] | 1 | ##===- docs/CommandGuide/Makefile --------------------------*- Makefile -*-===## |
| 2 | # |
| 3 | # The LLVM Compiler Infrastructure |
| 4 | # |
Chris Lattner | 57360d1 | 2007-12-29 20:11:13 +0000 | [diff] [blame] | 5 | # This file is distributed under the University of Illinois Open Source |
| 6 | # License. See LICENSE.TXT for details. |
Reid Spencer | 52d7a75 | 2004-11-29 03:45:02 +0000 | [diff] [blame] | 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 |
| 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 Lattner | 18232a5 | 2008-02-12 06:07:47 +0000 | [diff] [blame] | 16 | SRC_DOC_DIR= |
| 17 | DST_HTML_DIR=html/ |
| 18 | DST_MAN_DIR=man/man1/ |
| 19 | DST_PS_DIR=ps/ |
Reid Spencer | 6318456 | 2004-12-08 04:43:40 +0000 | [diff] [blame] | 20 | |
Chris Lattner | 18232a5 | 2008-02-12 06:07:47 +0000 | [diff] [blame] | 21 | # If we are in BUILD_FOR_WEBSITE mode, default to the all target. |
| 22 | all:: html man ps |
Reid Spencer | e47fd7d | 2004-12-08 19:01:01 +0000 | [diff] [blame] | 23 | |
| 24 | clean: |
| 25 | rm -f pod2htm*.*~~ $(HTML) $(MAN) $(PS) |
Chris Lattner | 18232a5 | 2008-02-12 06:07:47 +0000 | [diff] [blame] | 26 | else |
Reid Spencer | 6318456 | 2004-12-08 04:43:40 +0000 | [diff] [blame] | 27 | |
Chris Lattner | 18232a5 | 2008-02-12 06:07:47 +0000 | [diff] [blame] | 28 | # Otherwise, if not in BUILD_FOR_WEBSITE mode, use the project info. |
Reid Spencer | 52d7a75 | 2004-11-29 03:45:02 +0000 | [diff] [blame] | 29 | LEVEL := ../.. |
Reid Spencer | 52d7a75 | 2004-11-29 03:45:02 +0000 | [diff] [blame] | 30 | include $(LEVEL)/Makefile.common |
| 31 | |
Chris Lattner | 18232a5 | 2008-02-12 06:07:47 +0000 | [diff] [blame] | 32 | SRC_DOC_DIR=$(PROJ_SRC_DIR)/ |
| 33 | DST_HTML_DIR=$(PROJ_OBJ_DIR)/ |
| 34 | DST_MAN_DIR=$(PROJ_OBJ_DIR)/ |
| 35 | DST_PS_DIR=$(PROJ_OBJ_DIR)/ |
Reid Spencer | 52d7a75 | 2004-11-29 03:45:02 +0000 | [diff] [blame] | 36 | |
Chris Lattner | 18232a5 | 2008-02-12 06:07:47 +0000 | [diff] [blame] | 37 | endif |
Reid Spencer | 52d7a75 | 2004-11-29 03:45:02 +0000 | [diff] [blame] | 38 | |
Chris Lattner | 18232a5 | 2008-02-12 06:07:47 +0000 | [diff] [blame] | 39 | |
| 40 | POD := $(wildcard $(SRC_DOC_DIR)*.pod) |
| 41 | HTML := $(patsubst $(SRC_DOC_DIR)%.pod, $(DST_HTML_DIR)%.html, $(POD)) |
| 42 | MAN := $(patsubst $(SRC_DOC_DIR)%.pod, $(DST_MAN_DIR)%.1, $(POD)) |
| 43 | PS := $(patsubst $(SRC_DOC_DIR)%.pod, $(DST_PS_DIR)%.ps, $(POD)) |
Reid Spencer | 52d7a75 | 2004-11-29 03:45:02 +0000 | [diff] [blame] | 44 | |
Brian Gaeke | e993d20 | 2004-05-14 19:50:33 +0000 | [diff] [blame] | 45 | .SUFFIXES: |
| 46 | .SUFFIXES: .html .pod .1 .ps |
| 47 | |
Chris Lattner | 18232a5 | 2008-02-12 06:07:47 +0000 | [diff] [blame] | 48 | $(DST_HTML_DIR)%.html: %.pod $(DST_HTML_DIR)/.dir |
| 49 | pod2html --css=manpage.css --htmlroot=. \ |
| 50 | --podpath=. --noindex --infile=$< --outfile=$@ --title=$* |
| 51 | |
| 52 | $(DST_MAN_DIR)%.1: %.pod $(DST_MAN_DIR)/.dir |
| 53 | pod2man --release=CVS --center="LLVM Command Guide" $< $@ |
| 54 | |
| 55 | $(DST_PS_DIR)%.ps: $(DST_MAN_DIR)%.1 $(DST_PS_DIR)/.dir |
| 56 | groff -Tps -man $< > $@ |
| 57 | |
Reid Spencer | 52d7a75 | 2004-11-29 03:45:02 +0000 | [diff] [blame] | 58 | |
Chris Lattner | dbcd4f5 | 2004-12-09 21:06:32 +0000 | [diff] [blame] | 59 | html: $(HTML) |
Chris Lattner | 18232a5 | 2008-02-12 06:07:47 +0000 | [diff] [blame] | 60 | man: $(MAN) |
| 61 | ps: $(PS) |
Chris Lattner | dbcd4f5 | 2004-12-09 21:06:32 +0000 | [diff] [blame] | 62 | |
Chris Lattner | 18232a5 | 2008-02-12 06:07:47 +0000 | [diff] [blame] | 63 | EXTRA_DIST := $(POD) index.html |
Brian Gaeke | e993d20 | 2004-05-14 19:50:33 +0000 | [diff] [blame] | 64 | |
Reid Spencer | 52d7a75 | 2004-11-29 03:45:02 +0000 | [diff] [blame] | 65 | clean-local:: |
| 66 | $(Verb) $(RM) -f pod2htm*.*~~ $(HTML) $(MAN) $(PS) |
Brian Gaeke | e993d20 | 2004-05-14 19:50:33 +0000 | [diff] [blame] | 67 | |
Reid Spencer | bdf6a39 | 2005-01-16 02:21:29 +0000 | [diff] [blame] | 68 | HTML_DIR := $(PROJ_docsdir)/html/CommandGuide |
| 69 | MAN_DIR := $(PROJ_mandir)/man1 |
| 70 | PS_DIR := $(PROJ_docsdir)/ps |
Reid Spencer | 3c54b6c | 2004-11-29 04:34:05 +0000 | [diff] [blame] | 71 | |
Reid Spencer | 52d7a75 | 2004-11-29 03:45:02 +0000 | [diff] [blame] | 72 | install-local:: $(HTML) $(MAN) $(PS) |
| 73 | $(Echo) Installing HTML CommandGuide Documentation |
Reid Spencer | 29fbdd7 | 2005-02-24 21:28:08 +0000 | [diff] [blame] | 74 | $(Verb) $(MKDIR) $(HTML_DIR) |
| 75 | $(Verb) $(DataInstall) $(HTML) $(HTML_DIR) |
| 76 | $(Verb) $(DataInstall) $(PROJ_SRC_DIR)/index.html $(HTML_DIR) |
Reid Spencer | 837300a | 2005-02-24 21:41:26 +0000 | [diff] [blame] | 77 | $(Verb) $(DataInstall) $(PROJ_SRC_DIR)/manpage.css $(HTML_DIR) |
Reid Spencer | 52d7a75 | 2004-11-29 03:45:02 +0000 | [diff] [blame] | 78 | $(Echo) Installing MAN CommandGuide Documentation |
Reid Spencer | 29fbdd7 | 2005-02-24 21:28:08 +0000 | [diff] [blame] | 79 | $(Verb) $(MKDIR) $(MAN_DIR) |
| 80 | $(Verb) $(DataInstall) $(MAN) $(MAN_DIR) |
Reid Spencer | 52d7a75 | 2004-11-29 03:45:02 +0000 | [diff] [blame] | 81 | $(Echo) Installing PS CommandGuide Documentation |
Reid Spencer | 29fbdd7 | 2005-02-24 21:28:08 +0000 | [diff] [blame] | 82 | $(Verb) $(MKDIR) $(PS_DIR) |
| 83 | $(Verb) $(DataInstall) $(PS) $(PS_DIR) |
Reid Spencer | 52d7a75 | 2004-11-29 03:45:02 +0000 | [diff] [blame] | 84 | |
| 85 | uninstall-local:: |
Erick Tryzelaar | 4f678c3 | 2008-03-30 20:32:18 +0000 | [diff] [blame^] | 86 | $(Echo) Uninstalling CommandGuide Documentation |
| 87 | $(Verb) $(RM) -rf $(HTML_DIR) $(MAN_DIR) $(PS_DIR) |
Reid Spencer | 52d7a75 | 2004-11-29 03:45:02 +0000 | [diff] [blame] | 88 | |
| 89 | printvars:: |
| 90 | $(Echo) "POD : " '$(POD)' |
| 91 | $(Echo) "HTML : " '$(HTML)' |