Update drivers
[vuplus_openembedded] / docs / usermanual / Makefile
1 # XSL stylesheets downloaded from http://docbook.sourceforge.net/release/xsl/current/html/
2
3 topdir = .
4 manual = $(topdir)/usermanual.xml
5 # types = pdf txt rtf ps xhtml html man tex texi dvi
6 # types = pdf txt
7 types = $(xmltotypes) $(htmltypes) $(docbooktotypes)
8 xmltotypes = 
9 docbooktotypes = dvi pdf ps rtf tex texi txt
10 htmltypes = html xhtml
11 htmlxsl = $(if $(filter $@,$(foreach type,$(htmltypes),$(type)-nochunks)),docbook-utf8.xsl,chunk-utf8.xsl)
12 htmlcssfile = docbook.css
13 htmlcss = $(topdir)/html.css
14 # htmlcssfile =
15 # htmlcss =
16 cleanfiles = $(foreach i,$(types),$(topdir)/$(i))
17
18 ifdef DEBUG
19 define command
20         $(1)
21 endef
22 else
23 define command
24         @echo $(2) $(3) $(4)
25         @$(1) 
26 endef
27 endif
28
29 all: $(types)
30
31 lint: $(manual) FORCE
32         $(call command,xmllint --xinclude --postvalid --noout $(manual),XMLLINT $(manual))
33
34 $(types) $(foreach type,$(htmltypes),$(type)-nochunks): lint FORCE
35
36 $(foreach type,$(htmltypes),$(type)-nochunks): $(if $(htmlcss),$(htmlcss)) $(manual)
37         @mkdir -p $@
38 ifdef htmlcss
39         $(call command,install -m 0644 $(htmlcss) $@/$(htmlcssfile),CP $(htmlcss) $@/$(htmlcssfile))
40 endif
41         $(call command,xsltproc --stringparam base.dir $@/ $(if $(htmlcssfile),--stringparam html.stylesheet $(htmlcssfile)) $(htmlxsl) $(manual) > $@/index.$(patsubst %-nochunks,%,$@),XSLTPROC $@ $(manual))
42
43 $(htmltypes): $(if $(htmlcss),$(htmlcss)) $(manual)
44         @mkdir -p $@
45 ifdef htmlcss
46         $(call command,install -m 0644 $(htmlcss) $@/$(htmlcssfile),CP $(htmlcss) $@/$(htmlcssfile))
47 endif
48         $(call command,xsltproc --param use.id.as.filename 1 --stringparam base.dir $@/ $(if $(htmlcssfile),--stringparam html.stylesheet $(htmlcssfile)) $(htmlxsl) $(manual),XSLTPROC $@ $(manual))
49
50 $(xmltotypes): $(manual)
51         $(call command,xmlto --extensions -o $(topdir)/$@ $@ $(manual),XMLTO $@ $(manual))
52
53 $(docbooktotypes): $(manual)
54         $(call command,docbook2$@ $(manual),DOCBOOK2 $@ $(manual))
55
56 clean:
57         rm -rf $(cleanfiles)
58
59 $(foreach i,$(types) $(foreach type,$(htmltypes),$(type)-nochunks),clean-$(i)):
60         rm -rf $(patsubst clean-%,%,$@)
61
62 FORCE: