Makefile 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458
  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 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 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 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 Manual for the 'edison' branch. The fourth example
  83. # publishes the 1.2 version of the PDF and HTML YP Development Manual for the
  84. # '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. eclipse
  91. MANUALS = $(DOC)/$(DOC).html $(DOC)/eclipse
  92. FIGURES = figures
  93. STYLESHEET = $(DOC)/*.css
  94. endif
  95. ifeq ($(DOC),dev-manual)
  96. XSLTOPTS = --xinclude
  97. ALLPREQ = html eclipse tarball
  98. #
  99. # Note that the tarfile might produce the "Cannot stat: No such file or
  100. # directory" error message for .PNG files that are not present when building
  101. # a particular branch. The list of files is all-inclusive for all branches.
  102. # Note, if you don't provide a BRANCH option, it defaults to the latest stuff.
  103. # This would be appropriate for "master" branch.
  104. #
  105. ifeq ($(BRANCH),edison)
  106. TARFILES = dev-style.css dev-manual.html \
  107. figures/app-dev-flow.png figures/bsp-dev-flow.png \
  108. figures/dev-title.png figures/git-workflow.png \
  109. figures/index-downloads.png figures/kernel-dev-flow.png \
  110. figures/kernel-example-repos-edison.png \
  111. figures/kernel-overview-1.png figures/kernel-overview-2.png \
  112. figures/kernel-overview-3-edison.png \
  113. figures/source-repos.png figures/yp-download.png \
  114. figures/wip.png
  115. else ifeq ($(BRANCH),denzil)
  116. TARFILES = dev-style.css dev-manual.html \
  117. figures/app-dev-flow.png figures/bsp-dev-flow.png \
  118. figures/dev-title.png figures/git-workflow.png \
  119. figures/index-downloads.png figures/kernel-dev-flow.png \
  120. figures/kernel-example-repos-denzil.png \
  121. figures/kernel-overview-1.png figures/kernel-overview-2.png \
  122. figures/kernel-overview-3-denzil.png \
  123. figures/source-repos.png figures/yp-download.png \
  124. figures/wip.png
  125. else
  126. TARFILES = dev-style.css dev-manual.html \
  127. figures/app-dev-flow.png figures/bsp-dev-flow.png \
  128. figures/dev-title.png figures/git-workflow.png \
  129. figures/index-downloads.png figures/kernel-dev-flow.png \
  130. figures/kernel-overview-1.png figures/kernel-overview-2-generic.png \
  131. figures/source-repos.png figures/yp-download.png \
  132. figures/recipe-workflow.png figures/build-workspace-directory.png \
  133. eclipse
  134. endif
  135. MANUALS = $(DOC)/$(DOC).html $(DOC)/eclipse
  136. FIGURES = figures
  137. STYLESHEET = $(DOC)/*.css
  138. endif
  139. ifeq ($(DOC),yocto-project-qs)
  140. XSLTOPTS = --xinclude
  141. ALLPREQ = html eclipse tarball
  142. TARFILES = yocto-project-qs.html qs-style.css figures/yocto-environment.png \
  143. figures/yocto-project-transp.png \
  144. eclipse
  145. MANUALS = $(DOC)/$(DOC).html $(DOC)/eclipse
  146. FIGURES = figures
  147. STYLESHEET = $(DOC)/*.css
  148. endif
  149. ifeq ($(DOC),mega-manual)
  150. XSLTOPTS = --stringparam html.stylesheet mega-style.css \
  151. --stringparam chapter.autolabel 1 \
  152. --stringparam section.autolabel 1 \
  153. --stringparam section.label.includes.component.label 1 \
  154. --xinclude
  155. ALLPREQ = html tarball
  156. ifeq ($(BRANCH),edison)
  157. TARFILES = mega-manual.html mega-style.css figures/yocto-environment.png \
  158. figures/building-an-image.png \
  159. figures/using-a-pre-built-image.png \
  160. figures/poky-title.png \
  161. figures/adt-title.png figures/bsp-title.png \
  162. figures/kernel-title.png figures/kernel-architecture-overview.png \
  163. figures/app-dev-flow.png figures/bsp-dev-flow.png \
  164. figures/dev-title.png figures/git-workflow.png \
  165. figures/index-downloads.png figures/kernel-dev-flow.png \
  166. figures/kernel-example-repos-edison.png \
  167. figures/kernel-overview-1.png figures/kernel-overview-2.png \
  168. figures/kernel-overview-3-edison.png \
  169. figures/source-repos.png figures/yp-download.png \
  170. figures/wip.png
  171. else ifeq ($(BRANCH),denzil)
  172. TARFILES = mega-manual.html mega-style.css figures/yocto-environment.png \
  173. figures/building-an-image.png \
  174. figures/using-a-pre-built-image.png \
  175. figures/poky-title.png \
  176. figures/adt-title.png figures/bsp-title.png \
  177. figures/kernel-title.png figures/kernel-architecture-overview.png \
  178. figures/app-dev-flow.png figures/bsp-dev-flow.png \
  179. figures/dev-title.png figures/git-workflow.png \
  180. figures/index-downloads.png figures/kernel-dev-flow.png \
  181. figures/kernel-example-repos-denzil.png \
  182. figures/kernel-overview-1.png figures/kernel-overview-2.png \
  183. figures/kernel-overview-3-denzil.png \
  184. figures/source-repos.png figures/yp-download.png \
  185. figures/wip.png
  186. else
  187. TARFILES = mega-manual.html mega-style.css figures/yocto-environment.png \
  188. figures/building-an-image.png \
  189. figures/using-a-pre-built-image.png \
  190. figures/poky-title.png figures/buildhistory.png \
  191. figures/buildhistory-web.png \
  192. figures/adt-title.png figures/bsp-title.png \
  193. figures/kernel-dev-title.png figures/kernel-architecture-overview.png \
  194. figures/app-dev-flow.png figures/bsp-dev-flow.png \
  195. figures/dev-title.png \
  196. figures/git-workflow.png figures/index-downloads.png \
  197. figures/kernel-dev-flow.png \
  198. figures/kernel-overview-1.png figures/kernel-overview-2-generic.png \
  199. figures/source-repos.png figures/yp-download.png \
  200. figures/profile-title.png figures/kernelshark-all.png \
  201. figures/kernelshark-choose-events.png \
  202. figures/kernelshark-i915-display.png \
  203. figures/kernelshark-output-display.png figures/lttngmain0.png \
  204. figures/oprofileui-busybox.png figures/oprofileui-copy-to-user.png \
  205. figures/oprofileui-downloading.png figures/oprofileui-processes.png \
  206. figures/perf-probe-do_fork-profile.png \
  207. figures/perf-report-cycles-u.png \
  208. figures/perf-systemwide.png figures/perf-systemwide-libc.png \
  209. figures/perf-wget-busybox-annotate-menu.png \
  210. figures/perf-wget-busybox-annotate-udhcpc.png \
  211. figures/perf-wget-busybox-debuginfo.png \
  212. figures/perf-wget-busybox-dso-zoom.png \
  213. figures/perf-wget-busybox-dso-zoom-menu.png \
  214. figures/perf-wget-busybox-expanded-stripped.png \
  215. figures/perf-wget-flat-stripped.png \
  216. figures/perf-wget-g-copy-from-user-expanded-stripped.png \
  217. figures/perf-wget-g-copy-to-user-expanded-debuginfo.png \
  218. figures/perf-wget-g-copy-to-user-expanded-stripped.png \
  219. figures/perf-wget-g-copy-to-user-expanded-stripped-unresolved-hidden.png \
  220. figures/pybootchartgui-linux-yocto.png \
  221. figures/pychart-linux-yocto-rpm.png \
  222. figures/pychart-linux-yocto-rpm-nostrip.png \
  223. figures/sched-wakeup-profile.png figures/sysprof-callers.png \
  224. figures/sysprof-copy-from-user.png figures/sysprof-copy-to-user.png \
  225. figures/cross-development-toolchains.png \
  226. figures/yocto-environment-ref.png figures/user-configuration.png \
  227. figures/source-input.png figures/package-feeds.png \
  228. figures/layer-input.png figures/images.png figures/sdk.png \
  229. figures/source-fetching.png figures/patching.png \
  230. figures/configuration-compile-autoreconf.png \
  231. figures/analysis-for-package-splitting.png \
  232. figures/image-generation.png \
  233. figures/sdk-generation.png figures/recipe-workflow.png \
  234. figures/build-workspace-directory.png figures/mega-title.png \
  235. figures/toaster-title.png figures/hosted-service.png \
  236. figures/simple-configuration.png
  237. endif
  238. MANUALS = $(DOC)/$(DOC).html
  239. FIGURES = figures
  240. STYLESHEET = $(DOC)/*.css
  241. endif
  242. ifeq ($(DOC),ref-manual)
  243. XSLTOPTS = --xinclude
  244. ALLPREQ = html eclipse tarball
  245. TARFILES = ref-manual.html ref-style.css figures/poky-title.png \
  246. figures/buildhistory.png figures/buildhistory-web.png eclipse \
  247. figures/cross-development-toolchains.png figures/layer-input.png \
  248. figures/package-feeds.png figures/source-input.png \
  249. figures/user-configuration.png figures/yocto-environment-ref.png \
  250. figures/images.png figures/sdk.png figures/source-fetching.png \
  251. figures/patching.png figures/configuration-compile-autoreconf.png \
  252. figures/analysis-for-package-splitting.png figures/image-generation.png \
  253. figures/sdk-generation.png figures/building-an-image.png
  254. MANUALS = $(DOC)/$(DOC).html $(DOC)/eclipse
  255. FIGURES = figures
  256. STYLESHEET = $(DOC)/*.css
  257. endif
  258. ifeq ($(DOC),adt-manual)
  259. XSLTOPTS = --xinclude
  260. ALLPREQ = html eclipse tarball
  261. TARFILES = adt-manual.html adt-style.css figures/adt-title.png \
  262. figures/using-a-pre-built-image.png \
  263. eclipse
  264. MANUALS = $(DOC)/$(DOC).html $(DOC)/eclipse
  265. FIGURES = figures
  266. STYLESHEET = $(DOC)/*.css
  267. endif
  268. ifeq ($(DOC),profile-manual)
  269. XSLTOPTS = --xinclude
  270. ALLPREQ = html eclipse tarball
  271. TARFILES = profile-manual.html profile-manual-style.css \
  272. figures/profile-title.png figures/kernelshark-all.png \
  273. figures/kernelshark-choose-events.png \
  274. figures/kernelshark-i915-display.png \
  275. figures/kernelshark-output-display.png figures/lttngmain0.png \
  276. figures/oprofileui-busybox.png figures/oprofileui-copy-to-user.png \
  277. figures/oprofileui-downloading.png figures/oprofileui-processes.png \
  278. figures/perf-probe-do_fork-profile.png \
  279. figures/perf-report-cycles-u.png \
  280. figures/perf-systemwide.png figures/perf-systemwide-libc.png \
  281. figures/perf-wget-busybox-annotate-menu.png \
  282. figures/perf-wget-busybox-annotate-udhcpc.png \
  283. figures/perf-wget-busybox-debuginfo.png \
  284. figures/perf-wget-busybox-dso-zoom.png \
  285. figures/perf-wget-busybox-dso-zoom-menu.png \
  286. figures/perf-wget-busybox-expanded-stripped.png \
  287. figures/perf-wget-flat-stripped.png \
  288. figures/perf-wget-g-copy-from-user-expanded-stripped.png \
  289. figures/perf-wget-g-copy-to-user-expanded-debuginfo.png \
  290. figures/perf-wget-g-copy-to-user-expanded-stripped.png \
  291. figures/perf-wget-g-copy-to-user-expanded-stripped-unresolved-hidden.png \
  292. figures/pybootchartgui-linux-yocto.png \
  293. figures/pychart-linux-yocto-rpm.png \
  294. figures/pychart-linux-yocto-rpm-nostrip.png \
  295. figures/sched-wakeup-profile.png figures/sysprof-callers.png \
  296. figures/sysprof-copy-from-user.png figures/sysprof-copy-to-user.png \
  297. eclipse
  298. MANUALS = $(DOC)/$(DOC).html $(DOC)/eclipse
  299. FIGURES = figures
  300. STYLESHEET = $(DOC)/*.css
  301. endif
  302. ifeq ($(DOC),kernel-dev)
  303. XSLTOPTS = --xinclude
  304. ALLPREQ = html eclipse tarball
  305. TARFILES = kernel-dev.html kernel-dev-style.css \
  306. figures/kernel-dev-title.png \
  307. figures/kernel-architecture-overview.png \
  308. eclipse
  309. MANUALS = $(DOC)/$(DOC).html $(DOC)/eclipse
  310. FIGURES = figures
  311. STYLESHEET = $(DOC)/*.css
  312. endif
  313. ifeq ($(DOC),toaster-manual)
  314. XSLTOPTS = --xinclude
  315. ALLPREQ = html tarball
  316. TARFILES = toaster-manual.html toaster-manual-style.css \
  317. figures/toaster-title.png figures/simple-configuration.png \
  318. figures/hosted-service.png
  319. MANUALS = $(DOC)/$(DOC).html $(DOC)/$(DOC).pdf
  320. FIGURES = figures
  321. STYLESHEET = $(DOC)/*.css
  322. endif
  323. ##
  324. # These URI should be rewritten by your distribution's xml catalog to
  325. # match your locally installed XSL stylesheets.
  326. XSL_BASE_URI = http://docbook.sourceforge.net/release/xsl/1.76.1
  327. XSL_XHTML_URI = $(XSL_BASE_URI)/xhtml/docbook.xsl
  328. all: $(ALLPREQ)
  329. pdf:
  330. ifeq ($(DOC),yocto-project-qs)
  331. @echo " "
  332. @echo "ERROR: You cannot generate a yocto-project-qs PDF file."
  333. @echo " "
  334. else ifeq ($(DOC),mega-manual)
  335. @echo " "
  336. @echo "ERROR: You cannot generate a mega-manual PDF file."
  337. @echo " "
  338. else
  339. cd $(DOC); ../tools/poky-docbook-to-pdf $(DOC).xml ../template; cd ..
  340. endif
  341. html:
  342. ifeq ($(DOC),mega-manual)
  343. # See http://www.sagehill.net/docbookxsl/HtmlOutput.html
  344. @echo " "
  345. @echo "******** Building "$(DOC)
  346. @echo " "
  347. cd $(DOC); xsltproc $(XSLTOPTS) -o $(DOC).html $(DOC)-customization.xsl $(DOC).xml; cd ..
  348. @echo " "
  349. @echo "******** Using mega-manual.sed to process external links"
  350. @echo " "
  351. cd $(DOC); sed -f ../tools/mega-manual.sed < mega-manual.html > mega-output.html; cd ..
  352. @echo " "
  353. @echo "******** Cleaning up transient file mega-output.html"
  354. @echo " "
  355. cd $(DOC); rm mega-manual.html; mv mega-output.html mega-manual.html; cd ..
  356. else
  357. # See http://www.sagehill.net/docbookxsl/HtmlOutput.html
  358. @echo " "
  359. @echo "******** Building "$(DOC)
  360. @echo " "
  361. cd $(DOC); xsltproc $(XSLTOPTS) -o $(DOC).html $(DOC)-customization.xsl $(DOC).xml; cd ..
  362. endif
  363. eclipse: BASE_DIR = html/$(DOC)/
  364. eclipse: eclipse-generate eclipse-resolve-links
  365. .PHONY : eclipse-generate eclipse-resolve-links
  366. eclipse-generate:
  367. ifeq ($(filter $(DOC), adt-manual bsp-guide dev-manual kernel-dev profile-manual ref-manual yocto-project-qs),)
  368. @echo " "
  369. @echo "ERROR: You can only create eclipse documentation"
  370. @echo " of the following documentation parts:"
  371. @echo " - adt-manual"
  372. @echo " - bsp-guide"
  373. @echo " - dev-manual"
  374. @echo " - kernel-dev"
  375. @echo " - profile-manual"
  376. @echo " - ref-manual"
  377. @echo " - yocto-project-qs"
  378. @echo " "
  379. else
  380. @echo " "
  381. @echo "******** Building eclipse help of "$(DOC)
  382. @echo " "
  383. cd $(DOC) && \
  384. xsltproc $(XSLTOPTS) \
  385. --stringparam base.dir '$(BASE_DIR)' \
  386. -o eclipse/$(DOC).html \
  387. $(DOC)-eclipse-customization.xsl $(DOC).xml && \
  388. mv eclipse/toc.xml eclipse/$(DOC)-toc.xml && \
  389. cp -rf $(FIGURES) eclipse/$(BASE_DIR) && \
  390. cd ..;
  391. $(call modify-eclipse)
  392. endif
  393. eclipse-resolve-links:
  394. @echo " "
  395. @echo "******** Using eclipse-help.sed to process external links"
  396. @echo " "
  397. $(foreach FILE, \
  398. $(wildcard $(DOC)/eclipse/html/$(DOC)/*.html), \
  399. $(shell sed -i -f tools/eclipse-help.sed $(FILE)))
  400. tarball: html
  401. @echo " "
  402. @echo "******** Creating Tarball of document files"
  403. @echo " "
  404. cd $(DOC); tar -cvzf $(DOC).tgz $(TARFILES); cd ..
  405. validate:
  406. cd $(DOC); xmllint --postvalid --xinclude --noout $(DOC).xml; cd ..
  407. publish:
  408. @if test -f $(DOC)/$(DOC).html; \
  409. then \
  410. echo " "; \
  411. echo "******** Publishing "$(DOC)".html"; \
  412. echo " "; \
  413. scp -r $(MANUALS) $(STYLESHEET) docs.yp:/var/www/www.yoctoproject.org-docs/$(VER)/$(DOC); \
  414. cd $(DOC); scp -r $(FIGURES) docs.yp:/var/www/www.yoctoproject.org-docs/$(VER)/$(DOC); \
  415. else \
  416. echo " "; \
  417. echo $(DOC)".html missing. Generate the file first then try again."; \
  418. echo " "; \
  419. fi
  420. clean:
  421. rm -rf $(MANUALS); rm $(DOC)/$(DOC).tgz;