Makefile 17 KB

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