aboutsummaryrefslogtreecommitdiffstats
path: root/usermanual/Makefile
diff options
context:
space:
mode:
authorHolger Freyther <zecke@selfish.org>2006-05-13 15:51:52 +0000
committerOpenEmbedded Project <openembedded-devel@lists.openembedded.org>2006-05-13 15:51:52 +0000
commit87e62ae69e1596cb2905fef98af057d83b1f356b (patch)
treee82947a296cb3621a4f65db79b8268f0858879a4 /usermanual/Makefile
parent45c5ceafee22266237bedf0b749b57d9f80a9f60 (diff)
downloadopenembedded-87e62ae69e1596cb2905fef98af057d83b1f356b.tar.gz
openembedded-87e62ae69e1596cb2905fef98af057d83b1f356b.tar.bz2
openembedded-87e62ae69e1596cb2905fef98af057d83b1f356b.zip
usermanual:
Add Makefile from bitbake and initial docbook for the Usermanual. Currently make pdf is broken for whatever reasons...
Diffstat (limited to 'usermanual/Makefile')
-rw-r--r--usermanual/Makefile56
1 files changed, 56 insertions, 0 deletions
diff --git a/usermanual/Makefile b/usermanual/Makefile
new file mode 100644
index 0000000000..a43c025455
--- /dev/null
+++ b/usermanual/Makefile
@@ -0,0 +1,56 @@
+topdir = .
+manual = $(topdir)/usermanual.xml
+# types = pdf txt rtf ps xhtml html man tex texi dvi
+# types = pdf txt
+types = $(xmltotypes) $(htmltypes)
+xmltotypes = pdf txt
+htmltypes = html xhtml
+htmlxsl = $(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)
+htmlcssfile = docbook.css
+htmlcss = $(topdir)/html.css
+# htmlcssfile =
+# htmlcss =
+cleanfiles = $(foreach i,$(types),$(topdir)/$(i))
+
+ifdef DEBUG
+define command
+ $(1)
+endef
+else
+define command
+ @echo $(2) $(3) $(4)
+ @$(1) >/dev/null
+endef
+endif
+
+all: $(types)
+
+lint: $(manual) FORCE
+ $(call command,xmllint --xinclude --postvalid --noout $(manual),XMLLINT $(manual))
+
+$(types) $(foreach type,$(htmltypes),$(type)-nochunks): lint FORCE
+
+$(foreach type,$(htmltypes),$(type)-nochunks): $(if $(htmlcss),$(htmlcss)) $(manual)
+ @mkdir -p $@
+ifdef htmlcss
+ $(call command,install -m 0644 $(htmlcss) $@/$(htmlcssfile),CP $(htmlcss) $@/$(htmlcssfile))
+endif
+ $(call command,xsltproc --stringparam base.dir $@/ $(if $(htmlcssfile),--stringparam html.stylesheet $(htmlcssfile)) $(htmlxsl) $(manual) > $@/index.$(patsubst %-nochunks,%,$@),XSLTPROC $@ $(manual))
+
+$(htmltypes): $(if $(htmlcss),$(htmlcss)) $(manual)
+ @mkdir -p $@
+ifdef htmlcss
+ $(call command,install -m 0644 $(htmlcss) $@/$(htmlcssfile),CP $(htmlcss) $@/$(htmlcssfile))
+endif
+ $(call command,xsltproc --stringparam base.dir $@/ $(if $(htmlcssfile),--stringparam html.stylesheet $(htmlcssfile)) $(htmlxsl) $(manual),XSLTPROC $@ $(manual))
+
+$(xmltotypes): $(manual)
+ $(call command,xmlto --extensions -o $(topdir)/$@ $@ $(manual),XMLTO $@ $(manual))
+
+clean:
+ rm -rf $(cleanfiles)
+
+$(foreach i,$(types) $(foreach type,$(htmltypes),$(type)-nochunks),clean-$(i)):
+ rm -rf $(patsubst clean-%,%,$@)
+
+FORCE: