Makefile 19 KB

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