Makefile 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390
  1. #
  2. # SPDX-License-Identifier: CC-BY-2.0-UK
  3. #
  4. # This is a single Makefile to handle all generated Yocto Project documents,
  5. # which includes the BitBake User Manual and the Toaster User Manual.
  6. # The Makefile needs to live in the documents directory and all figures used
  7. # in any manuals must be .PNG files and live in the individual book's figures
  8. # directory as well as in the figures directory for the mega-manual.
  9. #
  10. # Note that the figures for the Yocto Project Development Tasks Manual
  11. # differ depending on the BRANCH being built.
  12. #
  13. # The Makefile has these targets:
  14. # all: If you leave off the target then "all" is implied.
  15. # You will generate HTML and a tarball of files.
  16. #
  17. # pdf: generates a PDF version of a manual. Not valid for the
  18. # Quick Start or the mega-manual (single, large HTML file
  19. # comprised of all Yocto Project manuals).
  20. # html: generates an HTML version of a manual.
  21. # tarball: creates a tarball for the doc files.
  22. # validate: validates
  23. # publish: pushes generated files to the Yocto Project website
  24. # clean: removes files
  25. #
  26. # The Makefile can generate an HTML and PDF version of every document except the
  27. # Yocto Project Quick Start and the single, HTML mega-manual, which is comprised
  28. # of all the individual Yocto Project manuals. You can generate these two manuals
  29. # in HTML form only. The variable DOC indicates the folder name for a given manual.
  30. # The variable VER represents the distro version of the Yocto Release for which the
  31. # manuals are being generated. The variable BRANCH is used to indicate the
  32. # branch (edison or denzil) and is used only when DOC=dev-manual or
  33. # DOC=mega-manual. If you do not specify a BRANCH, the default branch used
  34. # will be for the latest Yocto Project release. If you build for either
  35. # edison or denzil, you must use BRANCH. You do not need to use BRANCH for
  36. # any release beyond denzil.
  37. #
  38. # To build a manual, you must invoke Makefile with the DOC argument. If you
  39. # are going to publish the manual, then you must invoke Makefile with both the
  40. # DOC and the VER argument. Furthermore, if you are building or publishing
  41. # the edison or denzil versions of the Yocto Project Development Tasks Manual or
  42. # the mega-manual, you must also use the BRANCH argument.
  43. #
  44. # Examples:
  45. #
  46. # make DOC=bsp-guide
  47. # make html DOC=brief-yoctoprojectqs
  48. # make pdf DOC=ref-manual
  49. # make DOC=dev-manual BRANCH=edison
  50. # make DOC=mega-manual BRANCH=denzil
  51. #
  52. # The first example generates the HTML version of the BSP Guide.
  53. # The second example generates the HTML version only of the Quick Start. Note
  54. # that the Quick Start only has an HTML version available. So, the
  55. # 'make DOC=brief-yoctoprojectqs' command would be equivalent. The third example
  56. # generates just the PDF version of the Yocto Project Reference Manual.
  57. # The fourth example generates the HTML 'edison' version of the YP Development
  58. # Tasks Manual. The last example
  59. # generates the HTML version of the mega-manual and uses the 'denzil'
  60. # branch when choosing figures for the tarball of figures. Any example that does
  61. # not use the BRANCH argument builds the current version of the manual set.
  62. #
  63. # The publish target pushes the generated manuals to the Yocto Project
  64. # website. Unless you are a developer on the YP team, you will not succeed in
  65. # pushing manuals to this server. All files needed for the manual's HTML form are
  66. # pushed.
  67. #
  68. # Examples:
  69. #
  70. # make publish DOC=bsp-guide VER=1.7
  71. # make publish DOC=adt-manual VER=1.6
  72. # make publish DOC=dev-manual VER=1.1.1 BRANCH=edison
  73. # make publish DOC=dev-manual VER=1.2 BRANCH=denzil
  74. #
  75. # The first example publishes the 1.7 version of both the PDF and HTML versions of
  76. # the BSP Guide. The second example publishes the 1.6 version of both the PDF and
  77. # HTML versions of the ADT Manual. The third example publishes the 1.1.1 version of
  78. # the PDF and HTML YP Development Tasks Manual for the 'edison' branch. The fourth
  79. # example publishes the 1.2 version of the PDF and HTML YP Development Tasks Manual
  80. # for the 'denzil' branch.
  81. #
  82. # IN MEMORIAM: This comment is to remember Scott Rifenbark (scottrif), whom we lost
  83. # in January, 2020. Scott was the primary technical writer for the Yocto Project for
  84. # over 9 years. In that time, he contributed many thousands of patches, built this
  85. # documentation tree, and enabled tens of thousands of developers to succeed with
  86. # embedded Linux. He ran this Makefile many thousands of times. Godspeed, Dude.
  87. ifeq ($(DOC),brief-yoctoprojectqs)
  88. XSLTOPTS = --stringparam html.stylesheet brief-yoctoprojectqs-style.css \
  89. --stringparam chapter.autolabel 0 \
  90. --stringparam section.autolabel 0 \
  91. --stringparam section.label.includes.component.label 0 \
  92. --xinclude
  93. ALLPREQ = html tarball
  94. TARFILES = brief-yoctoprojectqs-style.css brief-yoctoprojectqs.html figures/bypqs-title.png \
  95. figures/yocto-project-transp.png
  96. MANUALS = $(DOC)/$(DOC).html
  97. FIGURES = figures
  98. STYLESHEET = $(DOC)/*.css
  99. endif
  100. ifeq ($(DOC),overview-manual)
  101. XSLTOPTS = --xinclude
  102. ALLPREQ = html tarball
  103. TARFILES = overview-manual-style.css overview-manual.html figures/overview-manual-title.png \
  104. figures/git-workflow.png figures/source-repos.png figures/index-downloads.png \
  105. figures/yp-download.png figures/YP-flow-diagram.png figures/key-dev-elements.png \
  106. figures/poky-reference-distribution.png figures/cross-development-toolchains.png \
  107. figures/user-configuration.png figures/layer-input.png figures/source-input.png \
  108. figures/package-feeds.png figures/patching.png figures/source-fetching.png \
  109. figures/configuration-compile-autoreconf.png figures/analysis-for-package-splitting.png \
  110. figures/image-generation.png figures/sdk-generation.png figures/images.png \
  111. figures/sdk.png
  112. MANUALS = $(DOC)/$(DOC).html
  113. FIGURES = figures
  114. STYLESHEET = $(DOC)/*.css
  115. endif
  116. ifeq ($(DOC),bsp-guide)
  117. XSLTOPTS = --xinclude
  118. ALLPREQ = html tarball
  119. TARFILES = bsp-style.css bsp-guide.html figures/bsp-title.png \
  120. figures/bsp-dev-flow.png
  121. MANUALS = $(DOC)/$(DOC).html
  122. FIGURES = figures
  123. STYLESHEET = $(DOC)/*.css
  124. endif
  125. ifeq ($(DOC),dev-manual)
  126. XSLTOPTS = --xinclude
  127. ALLPREQ = html tarball
  128. #
  129. # Note that the tarfile might produce the "Cannot stat: No such file or
  130. # directory" error message for .PNG files that are not present when building
  131. # a particular branch. The list of files is all-inclusive for all branches.
  132. # Note, if you don't provide a BRANCH option, it defaults to the latest stuff.
  133. # This would be appropriate for "master" branch.
  134. #
  135. TARFILES = dev-style.css dev-manual.html figures/buildhistory-web.png \
  136. figures/dev-title.png figures/buildhistory.png \
  137. figures/recipe-workflow.png figures/bitbake-build-flow.png \
  138. figures/multiconfig_files.png figures/cute-files-npm-example.png
  139. MANUALS = $(DOC)/$(DOC).html
  140. FIGURES = figures
  141. STYLESHEET = $(DOC)/*.css
  142. endif
  143. ifeq ($(DOC),mega-manual)
  144. XSLTOPTS = --stringparam html.stylesheet mega-style.css \
  145. --stringparam chapter.autolabel 1 \
  146. --stringparam section.autolabel 1 \
  147. --stringparam section.label.includes.component.label 1 \
  148. --xinclude
  149. ALLPREQ = html tarball
  150. TARFILES = mega-manual.html mega-style.css \
  151. figures/YP-flow-diagram.png \
  152. figures/using-a-pre-built-image.png \
  153. figures/poky-title.png figures/buildhistory.png \
  154. figures/buildhistory-web.png \
  155. figures/sdk-title.png figures/bsp-title.png \
  156. figures/kernel-dev-title.png figures/kernel-architecture-overview.png \
  157. figures/bsp-dev-flow.png \
  158. figures/dev-title.png \
  159. figures/git-workflow.png figures/index-downloads.png \
  160. figures/kernel-dev-flow.png \
  161. figures/kernel-overview-2-generic.png \
  162. figures/source-repos.png figures/yp-download.png \
  163. figures/profile-title.png figures/kernelshark-all.png \
  164. figures/kernelshark-choose-events.png \
  165. figures/kernelshark-i915-display.png \
  166. figures/kernelshark-output-display.png \
  167. figures/oprofileui-busybox.png figures/oprofileui-copy-to-user.png \
  168. figures/oprofileui-downloading.png figures/oprofileui-processes.png \
  169. figures/perf-probe-do_fork-profile.png \
  170. figures/perf-report-cycles-u.png \
  171. figures/perf-systemwide.png figures/perf-systemwide-libc.png \
  172. figures/perf-wget-busybox-annotate-menu.png \
  173. figures/perf-wget-busybox-annotate-udhcpc.png \
  174. figures/perf-wget-busybox-debuginfo.png \
  175. figures/perf-wget-busybox-dso-zoom.png \
  176. figures/perf-wget-busybox-dso-zoom-menu.png \
  177. figures/perf-wget-busybox-expanded-stripped.png \
  178. figures/perf-wget-flat-stripped.png \
  179. figures/perf-wget-g-copy-from-user-expanded-stripped.png \
  180. figures/perf-wget-g-copy-to-user-expanded-debuginfo.png \
  181. figures/perf-wget-g-copy-to-user-expanded-stripped.png \
  182. figures/perf-wget-g-copy-to-user-expanded-stripped-unresolved-hidden.png \
  183. figures/pybootchartgui-linux-yocto.png \
  184. figures/pychart-linux-yocto-rpm.png \
  185. figures/pychart-linux-yocto-rpm-nostrip.png \
  186. figures/sched-wakeup-profile.png figures/sysprof-callers.png \
  187. figures/sysprof-copy-from-user.png figures/sysprof-copy-to-user.png \
  188. figures/cross-development-toolchains.png \
  189. figures/user-configuration.png \
  190. figures/source-input.png figures/package-feeds.png \
  191. figures/layer-input.png figures/images.png figures/sdk.png \
  192. figures/source-fetching.png figures/patching.png \
  193. figures/configuration-compile-autoreconf.png \
  194. figures/analysis-for-package-splitting.png \
  195. figures/image-generation.png figures/key-dev-elements.png\
  196. figures/sdk-generation.png figures/recipe-workflow.png \
  197. figures/build-workspace-directory.png figures/mega-title.png \
  198. figures/toaster-title.png figures/hosted-service.png figures/multiconfig_files.png \
  199. figures/simple-configuration.png figures/poky-reference-distribution.png \
  200. figures/compatible-layers.png figures/import-layer.png figures/new-project.png \
  201. figures/sdk-environment.png figures/sdk-installed-standard-sdk-directory.png \
  202. figures/sdk-devtool-add-flow.png figures/sdk-installed-extensible-sdk-directory.png \
  203. figures/sdk-devtool-modify-flow.png \
  204. figures/sdk-devtool-upgrade-flow.png figures/bitbake-build-flow.png figures/bypqs-title.png \
  205. figures/overview-manual-title.png figures/sdk-autotools-flow.png figures/sdk-makefile-flow.png \
  206. figures/bb_multiconfig_files.png figures/bitbake-title.png figures/cute-files-npm-example.png
  207. MANUALS = $(DOC)/$(DOC).html
  208. FIGURES = figures
  209. STYLESHEET = $(DOC)/*.css
  210. endif
  211. ifeq ($(DOC),ref-manual)
  212. XSLTOPTS = --xinclude
  213. ALLPREQ = html tarball
  214. TARFILES = ref-manual.html ref-style.css figures/poky-title.png \
  215. figures/build-workspace-directory.png
  216. MANUALS = $(DOC)/$(DOC).html
  217. FIGURES = figures
  218. STYLESHEET = $(DOC)/*.css
  219. endif
  220. ifeq ($(DOC),sdk-manual)
  221. XSLTOPTS = --xinclude
  222. ALLPREQ = html tarball
  223. TARFILES = sdk-manual.html sdk-style.css figures/sdk-title.png \
  224. figures/sdk-environment.png figures/sdk-installed-standard-sdk-directory.png \
  225. figures/sdk-installed-extensible-sdk-directory.png figures/sdk-devtool-add-flow.png \
  226. figures/sdk-devtool-modify-flow.png \
  227. figures/sdk-devtool-upgrade-flow.png figures/sdk-autotools-flow.png figures/sdk-makefile-flow.png
  228. MANUALS = $(DOC)/$(DOC).html
  229. FIGURES = figures
  230. STYLESHEET = $(DOC)/*.css
  231. endif
  232. ifeq ($(DOC),profile-manual)
  233. XSLTOPTS = --xinclude
  234. ALLPREQ = html tarball
  235. TARFILES = profile-manual.html profile-manual-style.css \
  236. figures/profile-title.png figures/kernelshark-all.png \
  237. figures/kernelshark-choose-events.png \
  238. figures/kernelshark-i915-display.png \
  239. figures/kernelshark-output-display.png \
  240. figures/oprofileui-busybox.png figures/oprofileui-copy-to-user.png \
  241. figures/oprofileui-downloading.png figures/oprofileui-processes.png \
  242. figures/perf-probe-do_fork-profile.png \
  243. figures/perf-report-cycles-u.png \
  244. figures/perf-systemwide.png figures/perf-systemwide-libc.png \
  245. figures/perf-wget-busybox-annotate-menu.png \
  246. figures/perf-wget-busybox-annotate-udhcpc.png \
  247. figures/perf-wget-busybox-debuginfo.png \
  248. figures/perf-wget-busybox-dso-zoom.png \
  249. figures/perf-wget-busybox-dso-zoom-menu.png \
  250. figures/perf-wget-busybox-expanded-stripped.png \
  251. figures/perf-wget-flat-stripped.png \
  252. figures/perf-wget-g-copy-from-user-expanded-stripped.png \
  253. figures/perf-wget-g-copy-to-user-expanded-debuginfo.png \
  254. figures/perf-wget-g-copy-to-user-expanded-stripped.png \
  255. figures/perf-wget-g-copy-to-user-expanded-stripped-unresolved-hidden.png \
  256. figures/pybootchartgui-linux-yocto.png \
  257. figures/pychart-linux-yocto-rpm.png \
  258. figures/pychart-linux-yocto-rpm-nostrip.png \
  259. figures/sched-wakeup-profile.png figures/sysprof-callers.png \
  260. figures/sysprof-copy-from-user.png figures/sysprof-copy-to-user.png
  261. MANUALS = $(DOC)/$(DOC).html
  262. FIGURES = figures
  263. STYLESHEET = $(DOC)/*.css
  264. endif
  265. ifeq ($(DOC),kernel-dev)
  266. XSLTOPTS = --xinclude
  267. ALLPREQ = html tarball
  268. TARFILES = kernel-dev.html kernel-dev-style.css \
  269. figures/kernel-dev-title.png figures/kernel-overview-2-generic.png \
  270. figures/kernel-architecture-overview.png figures/kernel-dev-flow.png
  271. MANUALS = $(DOC)/$(DOC).html
  272. FIGURES = figures
  273. STYLESHEET = $(DOC)/*.css
  274. endif
  275. ifeq ($(DOC),toaster-manual)
  276. XSLTOPTS = --xinclude
  277. ALLPREQ = html tarball
  278. TARFILES = toaster-manual.html toaster-manual-style.css \
  279. figures/toaster-title.png figures/simple-configuration.png \
  280. figures/hosted-service.png \
  281. figures/compatible-layers.png figures/import-layer.png figures/new-project.png
  282. MANUALS = $(DOC)/$(DOC).html
  283. FIGURES = figures
  284. STYLESHEET = $(DOC)/*.css
  285. endif
  286. ifeq ($(DOC),test-manual)
  287. XSLTOPTS = --xinclude
  288. ALLPREQ = html tarball
  289. TARFILES = test-manual.html test-manual-style.css \
  290. figures/test-manual-title.png figures/ab-test-cluster.png
  291. MANUALS = $(DOC)/$(DOC).html
  292. FIGURES = figures
  293. STYLESHEET = $(DOC)/*.css
  294. endif
  295. ##
  296. # These URI should be rewritten by your distribution's xml catalog to
  297. # match your locally installed XSL stylesheets.
  298. XSL_BASE_URI = http://docbook.sourceforge.net/release/xsl/1.76.1
  299. XSL_XHTML_URI = $(XSL_BASE_URI)/xhtml/docbook.xsl
  300. all: $(ALLPREQ)
  301. pdf:
  302. ifeq ($(DOC),brief-yoctoprojectqs)
  303. @echo " "
  304. @echo "ERROR: You cannot generate a PDF file for brief-yoctoprojectqs."
  305. @echo " "
  306. else ifeq ($(DOC),mega-manual)
  307. @echo " "
  308. @echo "ERROR: You cannot generate a mega-manual PDF file."
  309. @echo " "
  310. else
  311. cd $(DOC); ../tools/poky-docbook-to-pdf $(DOC).xml ../template; cd ..
  312. endif
  313. html:
  314. ifeq ($(DOC),mega-manual)
  315. # See http://www.sagehill.net/docbookxsl/HtmlOutput.html
  316. @echo " "
  317. @echo "******** Building "$(DOC)
  318. @echo " "
  319. cd $(DOC); xsltproc $(XSLTOPTS) -o $(DOC).html $(DOC)-customization.xsl $(DOC).xml; cd ..
  320. @echo " "
  321. @echo "******** Using mega-manual.sed to process external links"
  322. @echo " "
  323. cd $(DOC); sed -f ../tools/mega-manual.sed < mega-manual.html > mega-output.html; cd ..
  324. @echo " "
  325. @echo "******** Cleaning up transient file mega-output.html"
  326. @echo " "
  327. cd $(DOC); rm mega-manual.html; mv mega-output.html mega-manual.html; cd ..
  328. else
  329. # See http://www.sagehill.net/docbookxsl/HtmlOutput.html
  330. @echo " "
  331. @echo "******** Building "$(DOC)
  332. @echo " "
  333. cd $(DOC); xsltproc $(XSLTOPTS) -o $(DOC).html $(DOC)-customization.xsl $(DOC).xml; cd ..
  334. endif
  335. tarball: html
  336. @echo " "
  337. @echo "******** Creating Tarball of document files"
  338. @echo " "
  339. cd $(DOC); tar -cvzf $(DOC).tgz $(TARFILES); cd ..
  340. validate:
  341. cd $(DOC); xmllint --postvalid --xinclude --noout $(DOC).xml; cd ..
  342. publish:
  343. @if test -f $(DOC)/$(DOC).html; \
  344. then \
  345. echo " "; \
  346. echo "******** Publishing "$(DOC)".html"; \
  347. echo " "; \
  348. scp -r $(MANUALS) $(STYLESHEET) www.yoctoproject.org:/var/www/www.yoctoproject.org-docs/$(VER)/$(DOC); \
  349. cd $(DOC); scp -r $(FIGURES) www.yoctoproject.org:/var/www/www.yoctoproject.org-docs/$(VER)/$(DOC); \
  350. else \
  351. echo " "; \
  352. echo $(DOC)".html missing. Generate the file first then try again."; \
  353. echo " "; \
  354. fi
  355. clean:
  356. rm -rf $(MANUALS); rm $(DOC)/$(DOC).tgz;