aboutsummaryrefslogtreecommitdiffstats
path: root/docs/usermanual/Makefile
diff options
context:
space:
mode:
authorMichael 'Mickey' Lauer <mickey@vanille-media.de>2009-02-25 01:47:30 +0100
committerMichael 'Mickey' Lauer <mickey@vanille-media.de>2009-02-25 01:47:30 +0100
commit25b51d32c982a6767f3d4a88dec12f70c8c8f875 (patch)
tree206e94d12d2fda511c5b383adfec3684829703a1 /docs/usermanual/Makefile
parent6d76191b2021518d2f1ea00c20a1ec3151d93069 (diff)
downloadopenembedded-25b51d32c982a6767f3d4a88dec12f70c8c8f875.tar.gz
docs: import usermanual from org.openembedded.documentation.
org.openembedded.documentation is deprecated now; please do all updates here!
Diffstat (limited to 'docs/usermanual/Makefile')
-rw-r--r--docs/usermanual/Makefile60
1 files changed, 60 insertions, 0 deletions
diff --git a/docs/usermanual/Makefile b/docs/usermanual/Makefile
new file mode 100644
index 0000000000..5649442ed5
--- /dev/null
+++ b/docs/usermanual/Makefile
@@ -0,0 +1,60 @@
+topdir = .
+manual = $(topdir)/usermanual.xml
+# types = pdf txt rtf ps xhtml html man tex texi dvi
+# types = pdf txt
+types = $(xmltotypes) $(htmltypes) $(docbooktotypes)
+xmltotypes =
+docbooktotypes = dvi pdf ps rtf tex texi txt
+htmltypes = html xhtml
+htmlxsl = $(if $(filter $@,$(foreach type,$(htmltypes),$(type)-nochunks)),docbook-utf8.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 --param use.id.as.filename 1 --stringparam base.dir $@/ $(if $(htmlcssfile),--stringparam html.stylesheet $(htmlcssfile)) $(htmlxsl) $(manual),XSLTPROC $@ $(manual))
+
+$(xmltotypes): $(manual)
+ $(call command,xmlto --extensions -o $(topdir)/$@ $@ $(manual),XMLTO $@ $(manual))
+
+$(docbooktotypes): $(manual)
+ $(call command,docbook2$@ $(manual),DOCBOOK2 $@ $(manual))
+
+clean:
+ rm -rf $(cleanfiles)
+
+$(foreach i,$(types) $(foreach type,$(htmltypes),$(type)-nochunks),clean-$(i)):
+ rm -rf $(patsubst clean-%,%,$@)
+
+FORCE: