blob: 99adea2fe6683da4d69274c5a7438132aecb8d6d [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 \
131 figures/app-dev-flow.png figures/bsp-dev-flow.png \
132 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 \
137 eclipse
138 endif
139
140MANUALS = $(DOC)/$(DOC).html $(DOC)/eclipse
141FIGURES = figures
142STYLESHEET = $(DOC)/*.css
143
144endif
145
146ifeq ($(DOC),yocto-project-qs)
147XSLTOPTS = --xinclude
148ALLPREQ = html eclipse tarball
149TARFILES = yocto-project-qs.html qs-style.css figures/yocto-environment.png \
150 figures/yocto-project-transp.png \
151 eclipse
152MANUALS = $(DOC)/$(DOC).html $(DOC)/eclipse
153FIGURES = figures
154STYLESHEET = $(DOC)/*.css
155endif
156
157ifeq ($(DOC),mega-manual)
158XSLTOPTS = --stringparam html.stylesheet mega-style.css \
159 --stringparam chapter.autolabel 1 \
160 --stringparam section.autolabel 1 \
161 --stringparam section.label.includes.component.label 1 \
162 --xinclude
163ALLPREQ = html tarball
164
165 ifeq ($(BRANCH),edison)
166TARFILES = mega-manual.html mega-style.css figures/yocto-environment.png \
167 figures/building-an-image.png \
168 figures/using-a-pre-built-image.png \
169 figures/poky-title.png \
170 figures/adt-title.png figures/bsp-title.png \
171 figures/kernel-title.png figures/kernel-architecture-overview.png \
172 figures/app-dev-flow.png figures/bsp-dev-flow.png \
173 figures/dev-title.png figures/git-workflow.png \
174 figures/index-downloads.png figures/kernel-dev-flow.png \
175 figures/kernel-example-repos-edison.png \
176 figures/kernel-overview-1.png figures/kernel-overview-2.png \
177 figures/kernel-overview-3-edison.png \
178 figures/source-repos.png figures/yp-download.png \
179 figures/wip.png
180 else ifeq ($(BRANCH),denzil)
181TARFILES = mega-manual.html mega-style.css figures/yocto-environment.png \
182 figures/building-an-image.png \
183 figures/using-a-pre-built-image.png \
184 figures/poky-title.png \
185 figures/adt-title.png figures/bsp-title.png \
186 figures/kernel-title.png figures/kernel-architecture-overview.png \
187 figures/app-dev-flow.png figures/bsp-dev-flow.png \
188 figures/dev-title.png figures/git-workflow.png \
189 figures/index-downloads.png figures/kernel-dev-flow.png \
190 figures/kernel-example-repos-denzil.png \
191 figures/kernel-overview-1.png figures/kernel-overview-2.png \
192 figures/kernel-overview-3-denzil.png \
193 figures/source-repos.png figures/yp-download.png \
194 figures/wip.png
195 else
196TARFILES = mega-manual.html mega-style.css figures/yocto-environment.png \
197 figures/building-an-image.png \
198 figures/using-a-pre-built-image.png \
199 figures/poky-title.png figures/buildhistory.png \
200 figures/buildhistory-web.png \
201 figures/adt-title.png figures/bsp-title.png \
202 figures/kernel-dev-title.png figures/kernel-architecture-overview.png \
203 figures/app-dev-flow.png figures/bsp-dev-flow.png \
204 figures/dev-title.png \
205 figures/git-workflow.png figures/index-downloads.png \
206 figures/kernel-dev-flow.png \
207 figures/kernel-overview-1.png figures/kernel-overview-2-generic.png \
208 figures/source-repos.png figures/yp-download.png \
209 figures/profile-title.png figures/kernelshark-all.png \
210 figures/kernelshark-choose-events.png \
211 figures/kernelshark-i915-display.png \
212 figures/kernelshark-output-display.png figures/lttngmain0.png \
213 figures/oprofileui-busybox.png figures/oprofileui-copy-to-user.png \
214 figures/oprofileui-downloading.png figures/oprofileui-processes.png \
215 figures/perf-probe-do_fork-profile.png \
216 figures/perf-report-cycles-u.png \
217 figures/perf-systemwide.png figures/perf-systemwide-libc.png \
218 figures/perf-wget-busybox-annotate-menu.png \
219 figures/perf-wget-busybox-annotate-udhcpc.png \
220 figures/perf-wget-busybox-debuginfo.png \
221 figures/perf-wget-busybox-dso-zoom.png \
222 figures/perf-wget-busybox-dso-zoom-menu.png \
223 figures/perf-wget-busybox-expanded-stripped.png \
224 figures/perf-wget-flat-stripped.png \
225 figures/perf-wget-g-copy-from-user-expanded-stripped.png \
226 figures/perf-wget-g-copy-to-user-expanded-debuginfo.png \
227 figures/perf-wget-g-copy-to-user-expanded-stripped.png \
228 figures/perf-wget-g-copy-to-user-expanded-stripped-unresolved-hidden.png \
229 figures/pybootchartgui-linux-yocto.png \
230 figures/pychart-linux-yocto-rpm.png \
231 figures/pychart-linux-yocto-rpm-nostrip.png \
232 figures/sched-wakeup-profile.png figures/sysprof-callers.png \
233 figures/sysprof-copy-from-user.png figures/sysprof-copy-to-user.png \
234 figures/cross-development-toolchains.png \
235 figures/yocto-environment-ref.png figures/user-configuration.png \
236 figures/source-input.png figures/package-feeds.png \
237 figures/layer-input.png figures/images.png figures/sdk.png \
238 figures/source-fetching.png figures/patching.png \
239 figures/configuration-compile-autoreconf.png \
240 figures/analysis-for-package-splitting.png \
241 figures/image-generation.png \
242 figures/sdk-generation.png figures/recipe-workflow.png \
243 figures/build-workspace-directory.png figures/mega-title.png \
244 figures/toaster-title.png figures/hosted-service.png \
245 figures/simple-configuration.png
246 endif
247
248MANUALS = $(DOC)/$(DOC).html
249FIGURES = figures
250STYLESHEET = $(DOC)/*.css
251
252endif
253
254ifeq ($(DOC),ref-manual)
255XSLTOPTS = --xinclude
256ALLPREQ = html eclipse tarball
257TARFILES = ref-manual.html ref-style.css figures/poky-title.png \
258 figures/buildhistory.png figures/buildhistory-web.png eclipse \
259 figures/cross-development-toolchains.png figures/layer-input.png \
260 figures/package-feeds.png figures/source-input.png \
261 figures/user-configuration.png figures/yocto-environment-ref.png \
262 figures/images.png figures/sdk.png figures/source-fetching.png \
263 figures/patching.png figures/configuration-compile-autoreconf.png \
264 figures/analysis-for-package-splitting.png figures/image-generation.png \
265 figures/sdk-generation.png figures/building-an-image.png
266MANUALS = $(DOC)/$(DOC).html $(DOC)/eclipse
267FIGURES = figures
268STYLESHEET = $(DOC)/*.css
269endif
270
271
272ifeq ($(DOC),adt-manual)
273XSLTOPTS = --xinclude
274ALLPREQ = html eclipse tarball
275TARFILES = adt-manual.html adt-style.css figures/adt-title.png \
276 figures/using-a-pre-built-image.png \
277 eclipse
278MANUALS = $(DOC)/$(DOC).html $(DOC)/eclipse
279FIGURES = figures
280STYLESHEET = $(DOC)/*.css
281endif
282
283ifeq ($(DOC),profile-manual)
284XSLTOPTS = --xinclude
285ALLPREQ = html eclipse tarball
286TARFILES = profile-manual.html profile-manual-style.css \
287 figures/profile-title.png figures/kernelshark-all.png \
288 figures/kernelshark-choose-events.png \
289 figures/kernelshark-i915-display.png \
290 figures/kernelshark-output-display.png figures/lttngmain0.png \
291 figures/oprofileui-busybox.png figures/oprofileui-copy-to-user.png \
292 figures/oprofileui-downloading.png figures/oprofileui-processes.png \
293 figures/perf-probe-do_fork-profile.png \
294 figures/perf-report-cycles-u.png \
295 figures/perf-systemwide.png figures/perf-systemwide-libc.png \
296 figures/perf-wget-busybox-annotate-menu.png \
297 figures/perf-wget-busybox-annotate-udhcpc.png \
298 figures/perf-wget-busybox-debuginfo.png \
299 figures/perf-wget-busybox-dso-zoom.png \
300 figures/perf-wget-busybox-dso-zoom-menu.png \
301 figures/perf-wget-busybox-expanded-stripped.png \
302 figures/perf-wget-flat-stripped.png \
303 figures/perf-wget-g-copy-from-user-expanded-stripped.png \
304 figures/perf-wget-g-copy-to-user-expanded-debuginfo.png \
305 figures/perf-wget-g-copy-to-user-expanded-stripped.png \
306 figures/perf-wget-g-copy-to-user-expanded-stripped-unresolved-hidden.png \
307 figures/pybootchartgui-linux-yocto.png \
308 figures/pychart-linux-yocto-rpm.png \
309 figures/pychart-linux-yocto-rpm-nostrip.png \
310 figures/sched-wakeup-profile.png figures/sysprof-callers.png \
311 figures/sysprof-copy-from-user.png figures/sysprof-copy-to-user.png \
312 eclipse
313MANUALS = $(DOC)/$(DOC).html $(DOC)/eclipse
314FIGURES = figures
315STYLESHEET = $(DOC)/*.css
316endif
317
318ifeq ($(DOC),kernel-dev)
319XSLTOPTS = --xinclude
320ALLPREQ = html eclipse tarball
321TARFILES = kernel-dev.html kernel-dev-style.css \
322 figures/kernel-dev-title.png \
323 figures/kernel-architecture-overview.png \
324 eclipse
325MANUALS = $(DOC)/$(DOC).html $(DOC)/eclipse
326FIGURES = figures
327STYLESHEET = $(DOC)/*.css
328endif
329
330ifeq ($(DOC),toaster-manual)
331XSLTOPTS = --xinclude
332ALLPREQ = html tarball
333TARFILES = toaster-manual.html toaster-manual-style.css \
334 figures/toaster-title.png figures/simple-configuration.png \
335 figures/hosted-service.png
Patrick Williamsf1e5d692016-03-30 15:21:19 -0500336MANUALS = $(DOC)/$(DOC).html
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500337FIGURES = figures
338STYLESHEET = $(DOC)/*.css
339endif
340
341
342##
343# These URI should be rewritten by your distribution's xml catalog to
344# match your locally installed XSL stylesheets.
345XSL_BASE_URI = http://docbook.sourceforge.net/release/xsl/1.76.1
346XSL_XHTML_URI = $(XSL_BASE_URI)/xhtml/docbook.xsl
347
348all: $(ALLPREQ)
349
350pdf:
351ifeq ($(DOC),yocto-project-qs)
352 @echo " "
353 @echo "ERROR: You cannot generate a yocto-project-qs PDF file."
354 @echo " "
355
356else ifeq ($(DOC),mega-manual)
357 @echo " "
358 @echo "ERROR: You cannot generate a mega-manual PDF file."
359 @echo " "
360
361else
362
363 cd $(DOC); ../tools/poky-docbook-to-pdf $(DOC).xml ../template; cd ..
364endif
365
366html:
367ifeq ($(DOC),mega-manual)
368# See http://www.sagehill.net/docbookxsl/HtmlOutput.html
369 @echo " "
370 @echo "******** Building "$(DOC)
371 @echo " "
372 cd $(DOC); xsltproc $(XSLTOPTS) -o $(DOC).html $(DOC)-customization.xsl $(DOC).xml; cd ..
373 @echo " "
374 @echo "******** Using mega-manual.sed to process external links"
375 @echo " "
376 cd $(DOC); sed -f ../tools/mega-manual.sed < mega-manual.html > mega-output.html; cd ..
377 @echo " "
378 @echo "******** Cleaning up transient file mega-output.html"
379 @echo " "
380 cd $(DOC); rm mega-manual.html; mv mega-output.html mega-manual.html; cd ..
381else
382# See http://www.sagehill.net/docbookxsl/HtmlOutput.html
383 @echo " "
384 @echo "******** Building "$(DOC)
385 @echo " "
386 cd $(DOC); xsltproc $(XSLTOPTS) -o $(DOC).html $(DOC)-customization.xsl $(DOC).xml; cd ..
387endif
388
389
390eclipse: BASE_DIR = html/$(DOC)/
391
392eclipse: eclipse-generate eclipse-resolve-links
393
394.PHONY : eclipse-generate eclipse-resolve-links
395
396eclipse-generate:
397ifeq ($(filter $(DOC), adt-manual bsp-guide dev-manual kernel-dev profile-manual ref-manual yocto-project-qs),)
398 @echo " "
399 @echo "ERROR: You can only create eclipse documentation"
400 @echo " of the following documentation parts:"
401 @echo " - adt-manual"
402 @echo " - bsp-guide"
403 @echo " - dev-manual"
404 @echo " - kernel-dev"
405 @echo " - profile-manual"
406 @echo " - ref-manual"
407 @echo " - yocto-project-qs"
408 @echo " "
409else
410 @echo " "
411 @echo "******** Building eclipse help of "$(DOC)
412 @echo " "
413 cd $(DOC) && \
414 xsltproc $(XSLTOPTS) \
415 --stringparam base.dir '$(BASE_DIR)' \
416 -o eclipse/$(DOC).html \
417 $(DOC)-eclipse-customization.xsl $(DOC).xml && \
418 mv eclipse/toc.xml eclipse/$(DOC)-toc.xml && \
419 cp -rf $(FIGURES) eclipse/$(BASE_DIR) && \
420 cd ..;
421
422 $(call modify-eclipse)
423endif
424
425eclipse-resolve-links:
426 @echo " "
427 @echo "******** Using eclipse-help.sed to process external links"
428 @echo " "
429 $(foreach FILE, \
430 $(wildcard $(DOC)/eclipse/html/$(DOC)/*.html), \
431 $(shell sed -i -f tools/eclipse-help.sed $(FILE)))
432
433tarball: html
434 @echo " "
435 @echo "******** Creating Tarball of document files"
436 @echo " "
437 cd $(DOC); tar -cvzf $(DOC).tgz $(TARFILES); cd ..
438
439validate:
440 cd $(DOC); xmllint --postvalid --xinclude --noout $(DOC).xml; cd ..
441
442
443publish:
444 @if test -f $(DOC)/$(DOC).html; \
445 then \
446 echo " "; \
447 echo "******** Publishing "$(DOC)".html"; \
448 echo " "; \
449 scp -r $(MANUALS) $(STYLESHEET) docs.yp:/var/www/www.yoctoproject.org-docs/$(VER)/$(DOC); \
450 cd $(DOC); scp -r $(FIGURES) docs.yp:/var/www/www.yoctoproject.org-docs/$(VER)/$(DOC); \
451 else \
452 echo " "; \
453 echo $(DOC)".html missing. Generate the file first then try again."; \
454 echo " "; \
455 fi
456
457clean:
458 rm -rf $(MANUALS); rm $(DOC)/$(DOC).tgz;