Makefile 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  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. ifeq ($(DOC),bitbake-user-manual)
  28. XSLTOPTS = --stringparam html.stylesheet bitbake-user-manual-style.css \
  29. --stringparam chapter.autolabel 1 \
  30. --stringparam section.autolabel 1 \
  31. --stringparam section.label.includes.component.label 1 \
  32. --xinclude
  33. ALLPREQ = html tarball
  34. TARFILES = bitbake-user-manual-style.css bitbake-user-manual.html figures/bitbake-title.png
  35. MANUALS = $(DOC)/$(DOC).html
  36. FIGURES = figures
  37. STYLESHEET = $(DOC)/*.css
  38. endif
  39. ##
  40. # These URI should be rewritten by your distribution's xml catalog to
  41. # match your localy installed XSL stylesheets.
  42. XSL_BASE_URI = http://docbook.sourceforge.net/release/xsl/current
  43. XSL_XHTML_URI = $(XSL_BASE_URI)/xhtml/docbook.xsl
  44. all: $(ALLPREQ)
  45. pdf:
  46. ifeq ($(DOC),bitbake-user-manual)
  47. @echo " "
  48. @echo "********** Building."$(DOC)
  49. @echo " "
  50. cd $(DOC); ../tools/docbook-to-pdf $(DOC).xml ../template; cd ..
  51. endif
  52. html:
  53. ifeq ($(DOC),bitbake-user-manual)
  54. # See http://www.sagehill.net/docbookxsl/HtmlOutput.html
  55. @echo " "
  56. @echo "******** Building "$(DOC)
  57. @echo " "
  58. cd $(DOC); xsltproc $(XSLTOPTS) -o $(DOC).html $(DOC)-customization.xsl $(DOC).xml; cd ..
  59. endif
  60. tarball: html
  61. @echo " "
  62. @echo "******** Creating Tarball of document files"
  63. @echo " "
  64. cd $(DOC); tar -cvzf $(DOC).tgz $(TARFILES); cd ..
  65. validate:
  66. cd $(DOC); xmllint --postvalid --xinclude --noout $(DOC).xml; cd ..
  67. publish:
  68. @if test -f $(DOC)/$(DOC).html; \
  69. then \
  70. echo " "; \
  71. echo "******** Publishing "$(DOC)".html"; \
  72. echo " "; \
  73. scp -r $(MANUALS) $(STYLESHEET) docs.yp:/var/www/www.yoctoproject.org-docs/$(VER)/$(DOC); \
  74. cd $(DOC); scp -r $(FIGURES) docs.yp:/var/www/www.yoctoproject.org-docs/$(VER)/$(DOC); \
  75. else \
  76. echo " "; \
  77. echo $(DOC)".html missing. Generate the file first then try again."; \
  78. echo " "; \
  79. fi
  80. clean:
  81. rm -rf $(MANUALS); rm $(DOC)/$(DOC).tgz;