Daniel Dunbar | dbec033 | 2009-04-29 01:00:32 +0000 | [diff] [blame] | 1 | ##===- docs/tools/Makefile ---------------------------------*- Makefile -*-===## |
| 2 | # |
| 3 | # The LLVM Compiler Infrastructure |
| 4 | # |
| 5 | # This file is distributed under the University of Illinois Open Source |
| 6 | # License. See LICENSE.TXT for details. |
| 7 | # |
| 8 | ##===----------------------------------------------------------------------===## |
| 9 | |
| 10 | ifdef BUILD_FOR_WEBSITE |
| 11 | |
| 12 | # FIXME: This was copied from the CommandGuide makefile. Figure out |
| 13 | # how to get this stuff on the website. |
| 14 | |
| 15 | # This special case is for keeping the CommandGuide on the LLVM web site |
| 16 | # up to date automatically as the documents are checked in. It must build |
| 17 | # the POD files to HTML only and keep them in the src directories. It must also |
| 18 | # build in an unconfigured tree, hence the ifdef. To use this, run |
| 19 | # make -s BUILD_FOR_WEBSITE=1 inside the cvs commit script. |
| 20 | SRC_DOC_DIR= |
| 21 | DST_HTML_DIR=html/ |
| 22 | DST_MAN_DIR=man/man1/ |
| 23 | DST_PS_DIR=ps/ |
| 24 | |
| 25 | # If we are in BUILD_FOR_WEBSITE mode, default to the all target. |
| 26 | all:: html man ps |
| 27 | |
| 28 | clean: |
| 29 | rm -f pod2htm*.*~~ $(HTML) $(MAN) $(PS) |
| 30 | |
| 31 | # To create other directories, as needed, and timestamp their creation |
| 32 | %/.dir: |
| 33 | -mkdir $* > /dev/null |
| 34 | date > $@ |
| 35 | |
| 36 | else |
| 37 | |
| 38 | # Otherwise, if not in BUILD_FOR_WEBSITE mode, use the project info. |
| 39 | LEVEL := ../../../.. |
| 40 | include $(LEVEL)/Makefile.common |
| 41 | |
| 42 | SRC_DOC_DIR=$(PROJ_SRC_DIR)/ |
| 43 | DST_HTML_DIR=$(PROJ_OBJ_DIR)/ |
| 44 | DST_MAN_DIR=$(PROJ_OBJ_DIR)/ |
| 45 | DST_PS_DIR=$(PROJ_OBJ_DIR)/ |
| 46 | |
| 47 | endif |
| 48 | |
| 49 | |
| 50 | POD := $(wildcard $(SRC_DOC_DIR)*.pod) |
| 51 | HTML := $(patsubst $(SRC_DOC_DIR)%.pod, $(DST_HTML_DIR)%.html, $(POD)) |
| 52 | MAN := $(patsubst $(SRC_DOC_DIR)%.pod, $(DST_MAN_DIR)%.1, $(POD)) |
| 53 | PS := $(patsubst $(SRC_DOC_DIR)%.pod, $(DST_PS_DIR)%.ps, $(POD)) |
| 54 | |
Daniel Dunbar | e0a8092 | 2009-05-01 23:11:42 +0000 | [diff] [blame] | 55 | ifdef ONLY_MAN_DOCS |
| 56 | INSTALL_TARGETS := install-man |
| 57 | else |
| 58 | INSTALL_TARGETS := install-html install-man install-ps |
| 59 | endif |
| 60 | |
Daniel Dunbar | dbec033 | 2009-04-29 01:00:32 +0000 | [diff] [blame] | 61 | .SUFFIXES: |
| 62 | .SUFFIXES: .html .pod .1 .ps |
| 63 | |
| 64 | $(DST_HTML_DIR)%.html: %.pod $(DST_HTML_DIR)/.dir |
| 65 | pod2html --css=manpage.css --htmlroot=. \ |
Chris Lattner | 482c682 | 2009-05-11 22:45:37 +0000 | [diff] [blame] | 66 | --podpath=. --infile=$< --outfile=$@ --title=$* |
Daniel Dunbar | dbec033 | 2009-04-29 01:00:32 +0000 | [diff] [blame] | 67 | |
| 68 | $(DST_MAN_DIR)%.1: %.pod $(DST_MAN_DIR)/.dir |
Daniel Dunbar | a3c078e | 2009-05-06 00:10:37 +0000 | [diff] [blame] | 69 | pod2man --release "clang 1.0" --center="Clang Tools Documentation" $< $@ |
Daniel Dunbar | dbec033 | 2009-04-29 01:00:32 +0000 | [diff] [blame] | 70 | |
| 71 | $(DST_PS_DIR)%.ps: $(DST_MAN_DIR)%.1 $(DST_PS_DIR)/.dir |
| 72 | groff -Tps -man $< > $@ |
| 73 | |
| 74 | |
| 75 | html: $(HTML) |
| 76 | man: $(MAN) |
| 77 | ps: $(PS) |
| 78 | |
| 79 | EXTRA_DIST := $(POD) |
| 80 | |
| 81 | clean-local:: |
| 82 | $(Verb) $(RM) -f pod2htm*.*~~ $(HTML) $(MAN) $(PS) |
| 83 | |
| 84 | HTML_DIR := $(PROJ_docsdir)/html/clang |
| 85 | MAN_DIR := $(PROJ_mandir)/man1 |
| 86 | PS_DIR := $(PROJ_docsdir)/ps |
| 87 | |
Daniel Dunbar | 632975b | 2009-05-01 23:34:58 +0000 | [diff] [blame] | 88 | install-html:: $(HTML) |
Daniel Dunbar | dbec033 | 2009-04-29 01:00:32 +0000 | [diff] [blame] | 89 | $(Echo) Installing HTML Clang Tools Documentation |
| 90 | $(Verb) $(MKDIR) $(HTML_DIR) |
| 91 | $(Verb) $(DataInstall) $(HTML) $(HTML_DIR) |
| 92 | $(Verb) $(DataInstall) $(PROJ_SRC_DIR)/manpage.css $(HTML_DIR) |
Daniel Dunbar | e0a8092 | 2009-05-01 23:11:42 +0000 | [diff] [blame] | 93 | |
Daniel Dunbar | 632975b | 2009-05-01 23:34:58 +0000 | [diff] [blame] | 94 | install-man:: $(MAN) |
Daniel Dunbar | dbec033 | 2009-04-29 01:00:32 +0000 | [diff] [blame] | 95 | $(Echo) Installing MAN Clang Tools Documentation |
| 96 | $(Verb) $(MKDIR) $(MAN_DIR) |
| 97 | $(Verb) $(DataInstall) $(MAN) $(MAN_DIR) |
Daniel Dunbar | e0a8092 | 2009-05-01 23:11:42 +0000 | [diff] [blame] | 98 | |
Daniel Dunbar | 632975b | 2009-05-01 23:34:58 +0000 | [diff] [blame] | 99 | install-ps:: $(PS) |
Daniel Dunbar | dbec033 | 2009-04-29 01:00:32 +0000 | [diff] [blame] | 100 | $(Echo) Installing PS Clang Tools Documentation |
| 101 | $(Verb) $(MKDIR) $(PS_DIR) |
| 102 | $(Verb) $(DataInstall) $(PS) $(PS_DIR) |
| 103 | |
Daniel Dunbar | e0a8092 | 2009-05-01 23:11:42 +0000 | [diff] [blame] | 104 | install-local:: $(INSTALL_TARGETS) |
| 105 | |
Daniel Dunbar | dbec033 | 2009-04-29 01:00:32 +0000 | [diff] [blame] | 106 | uninstall-local:: |
| 107 | $(Echo) Uninstalling Clang Tools Documentation |
| 108 | $(Verb) $(RM) -rf $(HTML_DIR) $(MAN_DIR) $(PS_DIR) |
| 109 | |
| 110 | printvars:: |
| 111 | $(Echo) "POD : " '$(POD)' |
| 112 | $(Echo) "HTML : " '$(HTML)' |