Makefile 18 KB

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