try to correctly include the GFDL license
[pve-docs.git] / Makefile
1
2
3 PVESM_SOURCES=attributes.txt pvesm.adoc pvesm.1-synopsis.adoc $(shell ls pve-storage-*.adoc)
4 PVEUM_SOURCES=attributes.txt pveum.adoc pveum.1-synopsis.adoc
5 VZDUMP_SOURCES=attributes.txt vzdump.adoc vzdump.1-synopsis.adoc
6 PVEFW_SOURCES=attributes.txt pve-firewall.adoc pve-firewall.8-synopsis.adoc
7 QM_SOURCES=attributes.txt qm.adoc qm.1-synopsis.adoc
8 PCT_SOURCES=attributes.txt pct.adoc pct.1-synopsis.adoc
9
10 PVE_ADMIN_GUIDE_SOURCES=                \
11         sysadmin.adoc                   \
12         pve-admin-guide.adoc            \
13         pve-intro.adoc                  \
14         pmxcfs.adoc                     \
15         pve-faq.adoc                    \
16         ${QM_SOURCES}                   \
17         ${PCT_SOURCES}                  \
18         ${PVEFW_SOURCES}                \
19         ${PVEUM_SOURCES}                \
20         ${PVESM_SOURCES}                \
21         ${VZDUMP_SOURCES}               \
22         images/cluster-nwdiag.svg       \
23         images/node-nwdiag.svg          \
24         pve-bibliography.adoc           \
25         attributes.txt
26
27 ADOC_STDARG= -a icons -a data-uri -a "date=$(shell date)"
28 ADOC_MAN1_HTML_ARGS=-a "manvolnum=1" ${ADOC_STDARG}
29 ADOC_MAN8_HTML_ARGS=-a "manvolnum=8" ${ADOC_STDARG}
30
31 %-nwdiag.svg: %.nwdiag
32         nwdiag -T svg $*.nwdiag -o $@;
33
34 %.1-synopsis.adoc:
35         perl -e "use PVE::CLI::$(subst -,_,$*);print PVE::CLI::$(subst -,_,$*)->generate_asciidoc_synopsys();" > $@.tmp
36         mv $@.tmp $@
37
38 %.1: %.adoc %.1-synopsis.adoc docinfo.xml
39         a2x -a docinfo1 -a "manvolnum=1" -f manpage $*.adoc
40         test -z "$${NOVIEW}" && man -l $@ 
41
42 %.1.html: %.adoc %.1-synopsis.adoc docinfo.xml
43         asciidoc ${ADOC_MAN1_HTML_ARGS} -o $@ $*.adoc
44         test -z "$${NOVIEW}" && iceweasel $@ &
45
46
47 %.8-synopsis.adoc:
48         perl -e "use PVE::Service::$(subst -,_,$*);print PVE::Service::$(subst -,_,$*)->generate_asciidoc_synopsys();" > $@.tmp
49         mv $@.tmp $@
50
51 %.8: %.adoc %.8-synopsis.adoc docinfo.xml
52         a2x -a docinfo1 -a "manvolnum=1" -f manpage $*.adoc
53         test -z "$${NOVIEW}" && man -l $@ 
54
55 %.8.html: %.adoc %.8-synopsis.adoc docinfo.xml
56         asciidoc ${ADOC_MAN8_HTML_ARGS} -o $@ $*.adoc
57         test -z "$${NOVIEW}" && iceweasel $@ &
58
59
60 all: pve-admin-guide.html
61
62 index.html: index.adoc ${PVE_ADMIN_GUIDE_SOURCES}
63         $(MAKE) NOVIEW=1 pve-admin-guide.pdf pve-admin-guide.html pve-admin-guide.epub
64         $(MAKE) NOVIEW=1 qm.1.html pct.1.html pvesm.1.html pveum.1.html vzdump.1.html pve-firewall.8.html
65         asciidoc -a "date=$(shell date)" index.adoc 
66         iceweasel index.html &
67
68 pve-admin-guide.html: ${PVE_ADMIN_GUIDE_SOURCES}
69         asciidoc -a "date=$(shell date)" pve-admin-guide.adoc 
70         test -z "$${NOVIEW}" && iceweasel $@ &
71
72 pve-admin-guide.pdf: ${PVE_ADMIN_GUIDE_SOURCES} docinfo.xml pve-admin-guide-docinfo.xml
73         a2x -a docinfo -a docinfo1 -f pdf -L --dblatex-opts "-P latex.output.revhistory=0" pve-admin-guide.adoc
74         test -z "$${NOVIEW}" && iceweasel $@ &
75
76 pve-admin-guide.epub: ${PVE_ADMIN_GUIDE_SOURCES}
77         a2x -f epub pve-admin-guide.adoc
78         test -z "$${NOVIEW}" && iceweasel $@ &
79
80
81 clean:
82         rm -rf *~ *.html *.pdf *.epub *.1 *.8