summaryrefslogtreecommitdiffstats
path: root/bitbake/doc/manual/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'bitbake/doc/manual/Makefile')
-rw-r--r--bitbake/doc/manual/Makefile56
1 files changed, 56 insertions, 0 deletions
diff --git a/bitbake/doc/manual/Makefile b/bitbake/doc/manual/Makefile
new file mode 100644
index 0000000000..a43c025455
--- /dev/null
+++ b/bitbake/doc/manual/Makefile
@@ -0,0 +1,56 @@
1topdir = .
2manual = $(topdir)/usermanual.xml
3# types = pdf txt rtf ps xhtml html man tex texi dvi
4# types = pdf txt
5types = $(xmltotypes) $(htmltypes)
6xmltotypes = pdf txt
7htmltypes = html xhtml
8htmlxsl = $(if $(filter $@,$(foreach type,$(htmltypes),$(type)-nochunks)),http://docbook.sourceforge.net/release/xsl/current/xhtml/docbook.xsl,http://docbook.sourceforge.net/release/xsl/current/$@/chunk.xsl)
9htmlcssfile = docbook.css
10htmlcss = $(topdir)/html.css
11# htmlcssfile =
12# htmlcss =
13cleanfiles = $(foreach i,$(types),$(topdir)/$(i))
14
15ifdef DEBUG
16define command
17 $(1)
18endef
19else
20define command
21 @echo $(2) $(3) $(4)
22 @$(1) >/dev/null
23endef
24endif
25
26all: $(types)
27
28lint: $(manual) FORCE
29 $(call command,xmllint --xinclude --postvalid --noout $(manual),XMLLINT $(manual))
30
31$(types) $(foreach type,$(htmltypes),$(type)-nochunks): lint FORCE
32
33$(foreach type,$(htmltypes),$(type)-nochunks): $(if $(htmlcss),$(htmlcss)) $(manual)
34 @mkdir -p $@
35ifdef htmlcss
36 $(call command,install -m 0644 $(htmlcss) $@/$(htmlcssfile),CP $(htmlcss) $@/$(htmlcssfile))
37endif
38 $(call command,xsltproc --stringparam base.dir $@/ $(if $(htmlcssfile),--stringparam html.stylesheet $(htmlcssfile)) $(htmlxsl) $(manual) > $@/index.$(patsubst %-nochunks,%,$@),XSLTPROC $@ $(manual))
39
40$(htmltypes): $(if $(htmlcss),$(htmlcss)) $(manual)
41 @mkdir -p $@
42ifdef htmlcss
43 $(call command,install -m 0644 $(htmlcss) $@/$(htmlcssfile),CP $(htmlcss) $@/$(htmlcssfile))
44endif
45 $(call command,xsltproc --stringparam base.dir $@/ $(if $(htmlcssfile),--stringparam html.stylesheet $(htmlcssfile)) $(htmlxsl) $(manual),XSLTPROC $@ $(manual))
46
47$(xmltotypes): $(manual)
48 $(call command,xmlto --extensions -o $(topdir)/$@ $@ $(manual),XMLTO $@ $(manual))
49
50clean:
51 rm -rf $(cleanfiles)
52
53$(foreach i,$(types) $(foreach type,$(htmltypes),$(type)-nochunks),clean-$(i)):
54 rm -rf $(patsubst clean-%,%,$@)
55
56FORCE: