aboutsummaryrefslogtreecommitdiffstats
path: root/docs/Makefile
blob: d51d3570e34720ca28d097162d6c3dd3d94d7dce (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
##===- docs/Makefile ---------------------------------------*- Makefile -*-===##
# 
#                     The LLVM Compiler Infrastructure
#
# This file was developed by the LLVM research group and is distributed under
# the University of Illinois Open Source License. See LICENSE.TXT for details.
# 
##===----------------------------------------------------------------------===##

LEVEL      := ..
DIRS       := CommandGuide

include $(LEVEL)/Makefile.common

HTML       := $(wildcard $(BUILD_SRC_DIR)/*.html) \
              $(wildcard $(BUILD_SRC_DIR)/*.css)
IMAGES     := $(wildcard $(BUILD_SRC_DIR)/img/*.*)
DOXYFILES  := $(wildcard $(BUILD_SRC_DIR)/doxygen.*)
EXTRA_DIST := $(HTML) $(DOXYFILES) llvm.css CommandGuide img

.PHONY: install-html install-doxygen doxygen

ifeq ($(ENABLE_DOXYGEN),1)
install-local:: install-html install-doxygen
else
install-local:: install-html
endif

install-html: $(BUILD_OBJ_DIR)/html.tar.gz
	$(Echo) Installing HTML documentation
	$(Verb) $(INSTALL) -d $(LLVM_DOCSDIR)/html
	$(Verb) $(INSTALL) -d $(LLVM_DOCSDIR)/html/img
	$(Verb) $(INSTALL) -C $(HTML) $(LLVM_DOCSDIR)/html
	$(Verb) $(INSTALL) -C $(IMAGES) $(LLVM_DOCSDIR)/html/img
	$(Verb) $(INSTALL) -C $(BUILD_OBJ_DIR)/html.tar.gz $(LLVM_DOCSDIR)

$(BUILD_OBJ_DIR)/html.tar.gz: $(HTML)
	$(Echo) Packaging HTML documentation
	$(Verb) $(RM) -rf $@ $(BUILD_OBJ_DIR)/html.tar
	$(Verb) cd $(BUILD_SRC_DIR) && \
	  $(TAR) cf $(BUILD_OBJ_DIR)/html.tar *.html
	$(Verb) $(GZIP) $(BUILD_OBJ_DIR)/html.tar

install-doxygen: doxygen
	$(Echo) Installing doxygen documentation
	$(Echo) Installing doxygen documentation
	$(Verb) $(INSTALL) -d $(LLVM_DOCSDIR)/html/doxygen
	$(Verb) $(INSTALL) $(BUILD_OBJ_DIR)/doxygen.tar.gz $(LLVM_DOCSDIR)
	$(Verb) cd $(BUILD_OBJ_DIR)/doxygen && \
	  $(FIND) . -type f -exec \
	    $(INSTALL) -C {} $(LLVM_DOCSDIR)/html/doxygen \;

doxygen: $(BUILD_OBJ_DIR)/doxygen.tar.gz

$(BUILD_OBJ_DIR)/doxygen.tar.gz: $(DOXYFILES) $(BUILD_OBJ_DIR)/doxygen.cfg
	$(Echo) Building doxygen documentation
	$(Verb) $(DOXYGEN) $(BUILD_OBJ_DIR)/doxygen.cfg
	$(Echo) Packaging doxygen documentation
	$(Verb) $(RM) -rf $@ $(BUILD_OBJ_DIR)/doxygen.tar
	$(Verb) $(TAR) cf $(BUILD_OBJ_DIR)/doxygen.tar doxygen
	$(Verb) $(GZIP) $(BUILD_OBJ_DIR)/doxygen.tar