Makefile 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326
  1. # This is a single Makefile to handle all generated Yocto Project documents.
  2. # The Makefile needs to live in the documents directory and all figures used
  3. # in any manuals must be .PNG files and live in the individual book's figures
  4. # directory as well as in the figures directory for the mega-manual.
  5. # Note that the figures for the Yocto Project Development Manual
  6. # differ depending on the BRANCH being built.
  7. #
  8. # The Makefile has these targets:
  9. #
  10. # pdf: generates a PDF version of a manual. Not valid for the Quick Start
  11. # or the mega-manual (single, large HTML file comprised of all
  12. # Yocto Project manuals).
  13. # html: generates an HTML version of a manual.
  14. # tarball: creates a tarball for the doc files.
  15. # validate: validates
  16. # publish: pushes generated files to the Yocto Project website
  17. # clean: removes files
  18. #
  19. # The Makefile generates an HTML and PDF version of every document except the
  20. # Yocto Project Quick Start and the single, HTML mega-manual, which is comprised
  21. # of all the individual Yocto Project manuals. These two manuals are in HTML
  22. # form only. The variable DOC indicates the folder name for a given manual. The
  23. # variable VER represents the distro version of the Yocto Release for which the
  24. # manuals are being generated. The variable BRANCH is used to indicate the
  25. # branch (edison or denzil) and is used only when DOC=dev-manual or
  26. # DOC=mega-manual. If you do not specify a BRANCH, the default branch used
  27. # will be for the latest Yocto Project release. If you build for either
  28. # edison or denzil, you must use BRANCH. You do not need to use BRANCH for
  29. # any release beyond denzil.
  30. #
  31. # To build a manual, you must invoke Makefile with the DOC argument. If you
  32. # are going to publish the manual, then you must invoke Makefile with both the
  33. # DOC and the VER argument. Furthermore, if you are building or publishing
  34. # the edison or denzil versions of the Yocto Poject Development Manual or
  35. # the mega-manual, you must also use the BRANCH argument.
  36. #
  37. # Examples:
  38. #
  39. # make DOC=bsp-guide
  40. # make DOC=yocto-project-qs
  41. # make pdf DOC=ref-manual
  42. # make DOC=dev-manual BRANCH=edison
  43. # make DOC=mega-manual BRANCH=denzil
  44. #
  45. # The first example generates the HTML and PDF versions of the BSP Guide.
  46. # The second example generates the HTML version only of the Quick Start. Note that
  47. # the Quick Start only has an HTML version available. The third example generates
  48. # both the PDF and HTML versions of the Yocto Project Reference Manual. The
  49. # fourth example generates both the PDF and HTML 'edison' versions of the YP
  50. # Development Manual. The last exmample generates the HTML version of the
  51. # mega-manual and uses the 'denzil' branch when choosing figures for the
  52. # tarball of figures. Any example that does not use the BRANCH argument
  53. # builds the current version of the manual set.
  54. #
  55. # Use the publish target to push the generated manuals to the Yocto Project
  56. # website. All files needed for the manual's HTML form are pushed as well as the
  57. # PDF version (if applicable).
  58. # Examples:
  59. #
  60. # make publish DOC=bsp-guide VER=1.3
  61. # make publish DOC=adt-manual VER=1.3
  62. # make publish DOC=dev-manual VER=1.1.1 BRANCH=edison
  63. # make publish DOC=dev-manual VER=1.2 BRANCH=denzil
  64. #
  65. # The first example publishes the 1.3 version of both the PDF and HTML versions of
  66. # the BSP Guide. The second example publishes the 1.3 version of both the PDF and
  67. # HTML versions of the ADT Manual. The third example publishes the PDF and HTML
  68. # 'edison' versions of the YP Development Manual. The fourth example publishes
  69. # the PDF and HTML 'denzil' versions of the YP Development Manual.
  70. #
  71. ifeq ($(DOC),bsp-guide)
  72. XSLTOPTS = --stringparam html.stylesheet bsp-style.css \
  73. --stringparam chapter.autolabel 1 \
  74. --stringparam section.autolabel 1 \
  75. --stringparam section.label.includes.component.label 1 \
  76. --xinclude
  77. ALLPREQ = html pdf tarball
  78. TARFILES = bsp-style.css bsp-guide.html bsp-guide.pdf figures/bsp-title.png
  79. MANUALS = $(DOC)/$(DOC).html $(DOC)/$(DOC).pdf
  80. FIGURES = figures
  81. STYLESHEET = $(DOC)/*.css
  82. endif
  83. ifeq ($(DOC),dev-manual)
  84. XSLTOPTS = --stringparam html.stylesheet dev-style.css \
  85. --stringparam chapter.autolabel 1 \
  86. --stringparam section.autolabel 1 \
  87. --stringparam section.label.includes.component.label 1 \
  88. --xinclude
  89. ALLPREQ = html pdf tarball
  90. #
  91. # Note that the tarfile might produce the "Cannot stat: No such file or directory" error
  92. # message for .PNG files that are not present when building a particular branch. The
  93. # list of files is all-inclusive for all branches. Note, if you don't provide a BRANCH
  94. # option, it defaults to the latest stuff. This would be appropriate for "master" branch.
  95. #
  96. ifeq ($(BRANCH),edison)
  97. TARFILES = dev-style.css dev-manual.html dev-manual.pdf \
  98. figures/app-dev-flow.png figures/bsp-dev-flow.png figures/dev-title.png \
  99. figures/git-workflow.png figures/index-downloads.png figures/kernel-dev-flow.png \
  100. figures/kernel-example-repos-edison.png \
  101. figures/kernel-overview-1.png figures/kernel-overview-2.png \
  102. figures/kernel-overview-3-edison.png \
  103. figures/source-repos.png figures/yp-download.png \
  104. figures/wip.png
  105. else ifeq ($(BRANCH),denzil)
  106. TARFILES = dev-style.css dev-manual.html dev-manual.pdf \
  107. figures/app-dev-flow.png figures/bsp-dev-flow.png figures/dev-title.png \
  108. figures/git-workflow.png figures/index-downloads.png figures/kernel-dev-flow.png \
  109. figures/kernel-example-repos-denzil.png \
  110. figures/kernel-overview-1.png figures/kernel-overview-2.png \
  111. figures/kernel-overview-3-denzil.png \
  112. figures/source-repos.png figures/yp-download.png \
  113. figures/wip.png
  114. else
  115. TARFILES = dev-style.css dev-manual.html dev-manual.pdf \
  116. figures/app-dev-flow.png figures/bsp-dev-flow.png figures/dev-title.png \
  117. figures/git-workflow.png figures/index-downloads.png figures/kernel-dev-flow.png \
  118. figures/kernel-overview-1.png figures/kernel-overview-2-generic.png \
  119. figures/source-repos.png figures/yp-download.png
  120. endif
  121. MANUALS = $(DOC)/$(DOC).html $(DOC)/$(DOC).pdf
  122. FIGURES = figures
  123. STYLESHEET = $(DOC)/*.css
  124. endif
  125. ifeq ($(DOC),yocto-project-qs)
  126. XSLTOPTS = --stringparam html.stylesheet qs-style.css \
  127. --xinclude
  128. ALLPREQ = html tarball
  129. TARFILES = yocto-project-qs.html qs-style.css figures/yocto-environment.png figures/building-an-image.png figures/using-a-pre-built-image.png figures/yocto-project-transp.png
  130. MANUALS = $(DOC)/$(DOC).html
  131. FIGURES = figures
  132. STYLESHEET = $(DOC)/*.css
  133. endif
  134. ifeq ($(DOC),mega-manual)
  135. XSLTOPTS = --stringparam html.stylesheet mega-style.css \
  136. --stringparam chapter.autolabel 1 \
  137. --stringparam section.autolabel 1 \
  138. --stringparam section.label.includes.component.label 1 \
  139. --xinclude
  140. ALLPREQ = html tarball
  141. ifeq ($(BRANCH),edison)
  142. TARFILES = mega-manual.html mega-style.css figures/yocto-environment.png figures/building-an-image.png \
  143. figures/using-a-pre-built-image.png \
  144. figures/poky-title.png \
  145. figures/adt-title.png figures/bsp-title.png \
  146. figures/kernel-title.png figures/kernel-architecture-overview.png \
  147. figures/app-dev-flow.png figures/bsp-dev-flow.png figures/dev-title.png \
  148. figures/git-workflow.png figures/index-downloads.png figures/kernel-dev-flow.png \
  149. figures/kernel-example-repos-edison.png \
  150. figures/kernel-overview-1.png figures/kernel-overview-2.png \
  151. figures/kernel-overview-3-edison.png \
  152. figures/source-repos.png figures/yp-download.png \
  153. figures/wip.png
  154. else ifeq ($(BRANCH),denzil)
  155. TARFILES = mega-manual.html mega-style.css figures/yocto-environment.png figures/building-an-image.png \
  156. figures/using-a-pre-built-image.png \
  157. figures/poky-title.png \
  158. figures/adt-title.png figures/bsp-title.png \
  159. figures/kernel-title.png figures/kernel-architecture-overview.png \
  160. figures/app-dev-flow.png figures/bsp-dev-flow.png figures/dev-title.png \
  161. figures/git-workflow.png figures/index-downloads.png figures/kernel-dev-flow.png \
  162. figures/kernel-example-repos-denzil.png \
  163. figures/kernel-overview-1.png figures/kernel-overview-2.png \
  164. figures/kernel-overview-3-denzil.png \
  165. figures/source-repos.png figures/yp-download.png \
  166. figures/wip.png
  167. else
  168. TARFILES = mega-manual.html mega-style.css figures/yocto-environment.png figures/building-an-image.png \
  169. figures/using-a-pre-built-image.png \
  170. figures/poky-title.png figures/buildhistory.png figures/buildhistory-web.png \
  171. figures/adt-title.png figures/bsp-title.png \
  172. figures/kernel-title.png figures/kernel-architecture-overview.png \
  173. figures/app-dev-flow.png figures/bsp-dev-flow.png figures/dev-title.png \
  174. figures/git-workflow.png figures/index-downloads.png figures/kernel-dev-flow.png \
  175. figures/kernel-overview-1.png figures/kernel-overview-2-generic.png \
  176. figures/source-repos.png figures/yp-download.png
  177. endif
  178. MANUALS = $(DOC)/$(DOC).html
  179. FIGURES = figures
  180. STYLESHEET = $(DOC)/*.css
  181. endif
  182. ifeq ($(DOC),ref-manual)
  183. XSLTOPTS = --stringparam html.stylesheet ref-style.css \
  184. --stringparam chapter.autolabel 1 \
  185. --stringparam appendix.autolabel A \
  186. --stringparam section.autolabel 1 \
  187. --stringparam section.label.includes.component.label 1 \
  188. --xinclude
  189. ALLPREQ = html pdf tarball
  190. TARFILES = ref-manual.html ref-style.css figures/poky-title.png \
  191. figures/buildhistory.png figures/buildhistory-web.png
  192. MANUALS = $(DOC)/$(DOC).html $(DOC)/$(DOC).pdf
  193. FIGURES = figures
  194. STYLESHEET = $(DOC)/*.css
  195. endif
  196. ifeq ($(DOC),adt-manual)
  197. XSLTOPTS = --stringparam html.stylesheet adt-style.css \
  198. --stringparam chapter.autolabel 1 \
  199. --stringparam appendix.autolabel A \
  200. --stringparam section.autolabel 1 \
  201. --stringparam section.label.includes.component.label 1 \
  202. --xinclude
  203. ALLPREQ = html pdf tarball
  204. TARFILES = adt-manual.html adt-manual.pdf adt-style.css figures/adt-title.png
  205. MANUALS = $(DOC)/$(DOC).html $(DOC)/$(DOC).pdf
  206. FIGURES = figures
  207. STYLESHEET = $(DOC)/*.css
  208. endif
  209. ifeq ($(DOC),kernel-manual)
  210. XSLTOPTS = --stringparam html.stylesheet kernel-style.css \
  211. --stringparam chapter.autolabel 1 \
  212. --stringparam appendix.autolabel A \
  213. --stringparam section.autolabel 1 \
  214. --stringparam section.label.includes.component.label 1 \
  215. --xinclude
  216. ALLPREQ = html pdf tarball
  217. TARFILES = kernel-manual.html kernel-manual.pdf kernel-style.css figures/kernel-title.png figures/kernel-architecture-overview.png
  218. MANUALS = $(DOC)/$(DOC).html $(DOC)/$(DOC).pdf
  219. FIGURES = figures
  220. STYLESHEET = $(DOC)/*.css
  221. endif
  222. ifeq ($(DOC),kernel-dev)
  223. XSLTOPTS = --stringparam html.stylesheet kernel-dev-style.css \
  224. --stringparam chapter.autolabel 1 \
  225. --stringparam appendix.autolabel A \
  226. --stringparam section.autolabel 1 \
  227. --stringparam section.label.includes.component.label 1 \
  228. --xinclude
  229. ALLPREQ = html pdf tarball
  230. TARFILES = kernel-dev.html kernel-dev.pdf kernel-dev-style.css figures/kernel-dev-title.png
  231. MANUALS = $(DOC)/$(DOC).html $(DOC)/$(DOC).pdf
  232. FIGURES = figures
  233. STYLESHEET = $(DOC)/*.css
  234. endif
  235. ##
  236. # These URI should be rewritten by your distribution's xml catalog to
  237. # match your localy installed XSL stylesheets.
  238. XSL_BASE_URI = http://docbook.sourceforge.net/release/xsl/current
  239. XSL_XHTML_URI = $(XSL_BASE_URI)/xhtml/docbook.xsl
  240. all: $(ALLPREQ)
  241. pdf:
  242. ifeq ($(DOC),yocto-project-qs)
  243. @echo " "
  244. @echo "ERROR: You cannot generate a yocto-project-qs PDF file."
  245. @echo " "
  246. else ifeq ($(DOC),mega-manual)
  247. @echo " "
  248. @echo "ERROR: You cannot generate a mega-manual PDF file."
  249. @echo " "
  250. else
  251. cd $(DOC); ../tools/poky-docbook-to-pdf $(DOC).xml ../template; cd ..
  252. endif
  253. html:
  254. ifeq ($(DOC),mega-manual)
  255. # See http://www.sagehill.net/docbookxsl/HtmlOutput.html
  256. @echo " "
  257. @echo "******** Building "$(DOC)
  258. @echo " "
  259. cd $(DOC); xsltproc $(XSLTOPTS) -o $(DOC).html $(DOC)-customization.xsl $(DOC).xml; cd ..
  260. @echo " "
  261. @echo "******** Using mega-manual.sed to process external links"
  262. @echo " "
  263. cd $(DOC); sed -f ../tools/mega-manual.sed < mega-manual.html > mega-output.html; cd ..
  264. @echo " "
  265. @echo "******** Cleaning up transient file mega-output.html"
  266. @echo " "
  267. cd $(DOC); rm mega-manual.html; mv mega-output.html mega-manual.html; cd ..
  268. else
  269. # See http://www.sagehill.net/docbookxsl/HtmlOutput.html
  270. @echo " "
  271. @echo "******** Building "$(DOC)
  272. @echo " "
  273. cd $(DOC); xsltproc $(XSLTOPTS) -o $(DOC).html $(DOC)-customization.xsl $(DOC).xml; cd ..
  274. endif
  275. tarball: html
  276. @echo " "
  277. @echo "******** Creating Tarball of document files"
  278. @echo " "
  279. cd $(DOC); tar -cvzf $(DOC).tgz $(TARFILES); cd ..
  280. validate:
  281. cd $(DOC); xmllint --postvalid --xinclude --noout $(DOC).xml; cd ..
  282. publish:
  283. @if test -f $(DOC)/$(DOC).html; \
  284. then \
  285. echo " "; \
  286. echo "******** Publishing "$(DOC)".html"; \
  287. echo " "; \
  288. scp -r $(MANUALS) $(STYLESHEET) www.yoctoproject.org:/srv/www/www.yoctoproject.org-docs/$(VER)/$(DOC); \
  289. cd $(DOC); scp -r $(FIGURES) www.yoctoproject.org:/srv/www/www.yoctoproject.org-docs/$(VER)/$(DOC); \
  290. else \
  291. echo " "; \
  292. echo $(DOC)".html missing. Generate the file first then try again."; \
  293. echo " "; \
  294. fi
  295. clean:
  296. rm -rf $(MANUALS); rm $(DOC)/$(DOC).tgz;