blob: 9077c81215bd797c8dedf022e1476b883e2577fe [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 \
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600136 figures/recipe-workflow.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 \
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600252 figures/sdk-devtool-modify-flow.png figures/sdk-eclipse-dev-flow.png \
253 figures/sdk-devtool-upgrade-flow.png
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500254 endif
255
256MANUALS = $(DOC)/$(DOC).html
257FIGURES = figures
258STYLESHEET = $(DOC)/*.css
259
260endif
261
262ifeq ($(DOC),ref-manual)
263XSLTOPTS = --xinclude
264ALLPREQ = html eclipse tarball
265TARFILES = ref-manual.html ref-style.css figures/poky-title.png \
266 figures/buildhistory.png figures/buildhistory-web.png eclipse \
267 figures/cross-development-toolchains.png figures/layer-input.png \
268 figures/package-feeds.png figures/source-input.png \
269 figures/user-configuration.png figures/yocto-environment-ref.png \
270 figures/images.png figures/sdk.png figures/source-fetching.png \
271 figures/patching.png figures/configuration-compile-autoreconf.png \
272 figures/analysis-for-package-splitting.png figures/image-generation.png \
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600273 figures/sdk-generation.png figures/building-an-image.png \
274 figures/build-workspace-directory.png
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500275MANUALS = $(DOC)/$(DOC).html $(DOC)/eclipse
276FIGURES = figures
277STYLESHEET = $(DOC)/*.css
278endif
279
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500280ifeq ($(DOC),sdk-manual)
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500281XSLTOPTS = --xinclude
282ALLPREQ = html eclipse tarball
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500283TARFILES = sdk-manual.html sdk-style.css figures/sdk-title.png \
284 figures/sdk-environment.png figures/sdk-installed-standard-sdk-directory.png \
285 figures/sdk-installed-extensible-sdk-directory.png figures/sdk-devtool-add-flow.png \
286 figures/sdk-devtool-modify-flow.png figures/sdk-eclipse-dev-flow.png \
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600287 figures/sdk-devtool-upgrade-flow.png \
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500288 eclipse
289MANUALS = $(DOC)/$(DOC).html $(DOC)/eclipse
290FIGURES = figures
291STYLESHEET = $(DOC)/*.css
292endif
293
294ifeq ($(DOC),profile-manual)
295XSLTOPTS = --xinclude
296ALLPREQ = html eclipse tarball
297TARFILES = profile-manual.html profile-manual-style.css \
298 figures/profile-title.png figures/kernelshark-all.png \
299 figures/kernelshark-choose-events.png \
300 figures/kernelshark-i915-display.png \
301 figures/kernelshark-output-display.png figures/lttngmain0.png \
302 figures/oprofileui-busybox.png figures/oprofileui-copy-to-user.png \
303 figures/oprofileui-downloading.png figures/oprofileui-processes.png \
304 figures/perf-probe-do_fork-profile.png \
305 figures/perf-report-cycles-u.png \
306 figures/perf-systemwide.png figures/perf-systemwide-libc.png \
307 figures/perf-wget-busybox-annotate-menu.png \
308 figures/perf-wget-busybox-annotate-udhcpc.png \
309 figures/perf-wget-busybox-debuginfo.png \
310 figures/perf-wget-busybox-dso-zoom.png \
311 figures/perf-wget-busybox-dso-zoom-menu.png \
312 figures/perf-wget-busybox-expanded-stripped.png \
313 figures/perf-wget-flat-stripped.png \
314 figures/perf-wget-g-copy-from-user-expanded-stripped.png \
315 figures/perf-wget-g-copy-to-user-expanded-debuginfo.png \
316 figures/perf-wget-g-copy-to-user-expanded-stripped.png \
317 figures/perf-wget-g-copy-to-user-expanded-stripped-unresolved-hidden.png \
318 figures/pybootchartgui-linux-yocto.png \
319 figures/pychart-linux-yocto-rpm.png \
320 figures/pychart-linux-yocto-rpm-nostrip.png \
321 figures/sched-wakeup-profile.png figures/sysprof-callers.png \
322 figures/sysprof-copy-from-user.png figures/sysprof-copy-to-user.png \
323 eclipse
324MANUALS = $(DOC)/$(DOC).html $(DOC)/eclipse
325FIGURES = figures
326STYLESHEET = $(DOC)/*.css
327endif
328
329ifeq ($(DOC),kernel-dev)
330XSLTOPTS = --xinclude
331ALLPREQ = html eclipse tarball
332TARFILES = kernel-dev.html kernel-dev-style.css \
333 figures/kernel-dev-title.png \
334 figures/kernel-architecture-overview.png \
335 eclipse
336MANUALS = $(DOC)/$(DOC).html $(DOC)/eclipse
337FIGURES = figures
338STYLESHEET = $(DOC)/*.css
339endif
340
341ifeq ($(DOC),toaster-manual)
342XSLTOPTS = --xinclude
343ALLPREQ = html tarball
344TARFILES = toaster-manual.html toaster-manual-style.css \
345 figures/toaster-title.png figures/simple-configuration.png \
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500346 figures/hosted-service.png \
347 figures/compatible-layers.png figures/import-layer.png figures/new-project.png
Patrick Williamsf1e5d692016-03-30 15:21:19 -0500348MANUALS = $(DOC)/$(DOC).html
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500349FIGURES = figures
350STYLESHEET = $(DOC)/*.css
351endif
352
353
354##
355# These URI should be rewritten by your distribution's xml catalog to
356# match your locally installed XSL stylesheets.
357XSL_BASE_URI = http://docbook.sourceforge.net/release/xsl/1.76.1
358XSL_XHTML_URI = $(XSL_BASE_URI)/xhtml/docbook.xsl
359
360all: $(ALLPREQ)
361
362pdf:
363ifeq ($(DOC),yocto-project-qs)
364 @echo " "
365 @echo "ERROR: You cannot generate a yocto-project-qs PDF file."
366 @echo " "
367
368else ifeq ($(DOC),mega-manual)
369 @echo " "
370 @echo "ERROR: You cannot generate a mega-manual PDF file."
371 @echo " "
372
373else
374
375 cd $(DOC); ../tools/poky-docbook-to-pdf $(DOC).xml ../template; cd ..
376endif
377
378html:
379ifeq ($(DOC),mega-manual)
380# See http://www.sagehill.net/docbookxsl/HtmlOutput.html
381 @echo " "
382 @echo "******** Building "$(DOC)
383 @echo " "
384 cd $(DOC); xsltproc $(XSLTOPTS) -o $(DOC).html $(DOC)-customization.xsl $(DOC).xml; cd ..
385 @echo " "
386 @echo "******** Using mega-manual.sed to process external links"
387 @echo " "
388 cd $(DOC); sed -f ../tools/mega-manual.sed < mega-manual.html > mega-output.html; cd ..
389 @echo " "
390 @echo "******** Cleaning up transient file mega-output.html"
391 @echo " "
392 cd $(DOC); rm mega-manual.html; mv mega-output.html mega-manual.html; cd ..
393else
394# See http://www.sagehill.net/docbookxsl/HtmlOutput.html
395 @echo " "
396 @echo "******** Building "$(DOC)
397 @echo " "
398 cd $(DOC); xsltproc $(XSLTOPTS) -o $(DOC).html $(DOC)-customization.xsl $(DOC).xml; cd ..
399endif
400
401
402eclipse: BASE_DIR = html/$(DOC)/
403
404eclipse: eclipse-generate eclipse-resolve-links
405
406.PHONY : eclipse-generate eclipse-resolve-links
407
408eclipse-generate:
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500409ifeq ($(filter $(DOC), sdk-manual bsp-guide dev-manual kernel-dev profile-manual ref-manual yocto-project-qs),)
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500410 @echo " "
411 @echo "ERROR: You can only create eclipse documentation"
412 @echo " of the following documentation parts:"
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500413 @echo " - sdk-manual"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500414 @echo " - bsp-guide"
415 @echo " - dev-manual"
416 @echo " - kernel-dev"
417 @echo " - profile-manual"
418 @echo " - ref-manual"
419 @echo " - yocto-project-qs"
420 @echo " "
421else
422 @echo " "
423 @echo "******** Building eclipse help of "$(DOC)
424 @echo " "
425 cd $(DOC) && \
426 xsltproc $(XSLTOPTS) \
427 --stringparam base.dir '$(BASE_DIR)' \
428 -o eclipse/$(DOC).html \
429 $(DOC)-eclipse-customization.xsl $(DOC).xml && \
430 mv eclipse/toc.xml eclipse/$(DOC)-toc.xml && \
431 cp -rf $(FIGURES) eclipse/$(BASE_DIR) && \
432 cd ..;
433
434 $(call modify-eclipse)
435endif
436
437eclipse-resolve-links:
438 @echo " "
439 @echo "******** Using eclipse-help.sed to process external links"
440 @echo " "
441 $(foreach FILE, \
442 $(wildcard $(DOC)/eclipse/html/$(DOC)/*.html), \
443 $(shell sed -i -f tools/eclipse-help.sed $(FILE)))
444
445tarball: html
446 @echo " "
447 @echo "******** Creating Tarball of document files"
448 @echo " "
449 cd $(DOC); tar -cvzf $(DOC).tgz $(TARFILES); cd ..
450
451validate:
452 cd $(DOC); xmllint --postvalid --xinclude --noout $(DOC).xml; cd ..
453
454
455publish:
456 @if test -f $(DOC)/$(DOC).html; \
457 then \
458 echo " "; \
459 echo "******** Publishing "$(DOC)".html"; \
460 echo " "; \
461 scp -r $(MANUALS) $(STYLESHEET) docs.yp:/var/www/www.yoctoproject.org-docs/$(VER)/$(DOC); \
462 cd $(DOC); scp -r $(FIGURES) docs.yp:/var/www/www.yoctoproject.org-docs/$(VER)/$(DOC); \
463 else \
464 echo " "; \
465 echo $(DOC)".html missing. Generate the file first then try again."; \
466 echo " "; \
467 fi
468
469clean:
470 rm -rf $(MANUALS); rm $(DOC)/$(DOC).tgz;