Andrew Geissler | 4873add | 2020-11-02 18:44:49 -0600 | [diff] [blame] | 1 | # This is a single Makefile to handle all generated BitBake documents. |
| 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 | # |
| 27 | |
| 28 | ifeq ($(DOC),bitbake-user-manual) |
| 29 | XSLTOPTS = --stringparam html.stylesheet bitbake-user-manual-style.css \ |
| 30 | --stringparam chapter.autolabel 1 \ |
| 31 | --stringparam section.autolabel 1 \ |
| 32 | --stringparam section.label.includes.component.label 1 \ |
| 33 | --xinclude |
| 34 | ALLPREQ = html tarball |
| 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 | |
| 40 | endif |
| 41 | |
| 42 | ## |
| 43 | # These URI should be rewritten by your distribution's xml catalog to |
| 44 | # match your localy installed XSL stylesheets. |
| 45 | XSL_BASE_URI = http://docbook.sourceforge.net/release/xsl/current |
| 46 | XSL_XHTML_URI = $(XSL_BASE_URI)/xhtml/docbook.xsl |
| 47 | |
| 48 | all: $(ALLPREQ) |
| 49 | |
| 50 | pdf: |
| 51 | ifeq ($(DOC),bitbake-user-manual) |
| 52 | @echo " " |
| 53 | @echo "********** Building."$(DOC) |
| 54 | @echo " " |
| 55 | cd $(DOC); ../tools/docbook-to-pdf $(DOC).xml ../template; cd .. |
| 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 | |
| 90 | clean: |
| 91 | rm -rf $(MANUALS); rm $(DOC)/$(DOC).tgz; |