diff options
Diffstat (limited to 'bitbake/doc/Makefile')
-rw-r--r-- | bitbake/doc/Makefile | 108 |
1 files changed, 26 insertions, 82 deletions
diff --git a/bitbake/doc/Makefile b/bitbake/doc/Makefile index 3c28f4b222..4d721d30f3 100644 --- a/bitbake/doc/Makefile +++ b/bitbake/doc/Makefile | |||
@@ -1,91 +1,35 @@ | |||
1 | # This is a single Makefile to handle all generated BitBake documents. | 1 | # Minimal makefile for Sphinx documentation |
2 | # The Makefile needs to live in the documentation directory and all figures used | ||
3 | # in any manuals must be .PNG files and live in the individual book's figures | ||
4 | # directory. | ||
5 | # | ||
6 | # The Makefile has these targets: | ||
7 | # | ||
8 | # pdf: generates a PDF version of a manual. | ||
9 | # html: generates an HTML version of a manual. | ||
10 | # tarball: creates a tarball for the doc files. | ||
11 | # validate: validates | ||
12 | # clean: removes files | ||
13 | # | ||
14 | # The Makefile generates an HTML version of every document. The | ||
15 | # variable DOC indicates the folder name for a given manual. | ||
16 | # | ||
17 | # To build a manual, you must invoke 'make' with the DOC argument. | ||
18 | # | ||
19 | # Examples: | ||
20 | # | ||
21 | # make DOC=bitbake-user-manual | ||
22 | # make pdf DOC=bitbake-user-manual | ||
23 | # | ||
24 | # The first example generates the HTML version of the User Manual. | ||
25 | # The second example generates the PDF version of the User Manual. | ||
26 | # | 2 | # |
27 | 3 | ||
28 | ifeq ($(DOC),bitbake-user-manual) | 4 | # You can set these variables from the command line, and also |
29 | XSLTOPTS = --stringparam html.stylesheet bitbake-user-manual-style.css \ | 5 | # from the environment for the first two. |
30 | --stringparam chapter.autolabel 1 \ | 6 | SPHINXOPTS ?= |
31 | --stringparam section.autolabel 1 \ | 7 | SPHINXBUILD ?= sphinx-build |
32 | --stringparam section.label.includes.component.label 1 \ | 8 | SOURCEDIR = . |
33 | --xinclude | 9 | BUILDDIR = _build |
34 | ALLPREQ = html tarball | 10 | DESTDIR = final |
35 | TARFILES = bitbake-user-manual-style.css bitbake-user-manual.html figures/bitbake-title.png | ||
36 | MANUALS = $(DOC)/$(DOC).html | ||
37 | FIGURES = figures | ||
38 | STYLESHEET = $(DOC)/*.css | ||
39 | 11 | ||
12 | ifeq ($(shell if which $(SPHINXBUILD) >/dev/null 2>&1; then echo 1; else echo 0; fi),0) | ||
13 | $(error "The '$(SPHINXBUILD)' command was not found. Make sure you have Sphinx installed") | ||
40 | endif | 14 | endif |
41 | 15 | ||
42 | ## | 16 | # Put it first so that "make" without argument is like "make help". |
43 | # These URI should be rewritten by your distribution's xml catalog to | 17 | help: |
44 | # match your localy installed XSL stylesheets. | 18 | @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) |
45 | XSL_BASE_URI = http://docbook.sourceforge.net/release/xsl/current | ||
46 | XSL_XHTML_URI = $(XSL_BASE_URI)/xhtml/docbook.xsl | ||
47 | 19 | ||
48 | all: $(ALLPREQ) | 20 | .PHONY: help Makefile clean publish |
49 | 21 | ||
50 | pdf: | 22 | publish: Makefile html singlehtml |
51 | ifeq ($(DOC),bitbake-user-manual) | 23 | rm -rf $(BUILDDIR)/$(DESTDIR)/ |
52 | @echo " " | 24 | mkdir -p $(BUILDDIR)/$(DESTDIR)/ |
53 | @echo "********** Building."$(DOC) | 25 | cp -r $(BUILDDIR)/html/* $(BUILDDIR)/$(DESTDIR)/ |
54 | @echo " " | 26 | cp $(BUILDDIR)/singlehtml/index.html $(BUILDDIR)/$(DESTDIR)/singleindex.html |
55 | cd $(DOC); ../tools/docbook-to-pdf $(DOC).xml ../template; cd .. | 27 | sed -i -e 's@index.html#@singleindex.html#@g' $(BUILDDIR)/$(DESTDIR)/singleindex.html |
56 | endif | ||
57 | |||
58 | html: | ||
59 | ifeq ($(DOC),bitbake-user-manual) | ||
60 | # See http://www.sagehill.net/docbookxsl/HtmlOutput.html | ||
61 | @echo " " | ||
62 | @echo "******** Building "$(DOC) | ||
63 | @echo " " | ||
64 | cd $(DOC); xsltproc $(XSLTOPTS) -o $(DOC).html $(DOC)-customization.xsl $(DOC).xml; cd .. | ||
65 | endif | ||
66 | |||
67 | tarball: html | ||
68 | @echo " " | ||
69 | @echo "******** Creating Tarball of document files" | ||
70 | @echo " " | ||
71 | cd $(DOC); tar -cvzf $(DOC).tgz $(TARFILES); cd .. | ||
72 | |||
73 | validate: | ||
74 | cd $(DOC); xmllint --postvalid --xinclude --noout $(DOC).xml; cd .. | ||
75 | |||
76 | publish: | ||
77 | @if test -f $(DOC)/$(DOC).html; \ | ||
78 | then \ | ||
79 | echo " "; \ | ||
80 | echo "******** Publishing "$(DOC)".html"; \ | ||
81 | echo " "; \ | ||
82 | scp -r $(MANUALS) $(STYLESHEET) docs.yp:/var/www/www.yoctoproject.org-docs/$(VER)/$(DOC); \ | ||
83 | cd $(DOC); scp -r $(FIGURES) docs.yp:/var/www/www.yoctoproject.org-docs/$(VER)/$(DOC); \ | ||
84 | else \ | ||
85 | echo " "; \ | ||
86 | echo $(DOC)".html missing. Generate the file first then try again."; \ | ||
87 | echo " "; \ | ||
88 | fi | ||
89 | 28 | ||
90 | clean: | 29 | clean: |
91 | rm -rf $(MANUALS); rm $(DOC)/$(DOC).tgz; | 30 | @rm -rf $(BUILDDIR) |
31 | |||
32 | # Catch-all target: route all unknown targets to Sphinx using the new | ||
33 | # "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). | ||
34 | %: Makefile | ||
35 | @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) | ||