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