summaryrefslogtreecommitdiff
path: root/docbook/Makefile.auto.am
blob: 8c893c3975fa73195bdfd49efb7af68e2f03cf87 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
#
# Make the "Wireshark User Guide" and "Wireshark Developer Guide"
# in several formats.
# See the Readme.txt file for instructions.
#
# $Id$
#

# if you need to change this, don't forget to change it in catalog.xml too

# On suse 9.2, uncomment the following line:
DOCBOOKXSL="/usr/share/xml/docbook/stylesheet/nwalsh/1.65.1"

#DOCBOOKXSL="/usr/share/docbook-xsl"

############### YOU SHOULDN'T HAVE TO EDIT ANYTHING BELOW THIS LINE! ################

# as wsug_chm will stop with an error, make sure it's the last in this dependency list
all: wsug wsdg

wsug: wsug_validate wsug_pdf_a4 wsug_html wsug_html_chunked wsug_chm 

clean:
	rm -f *.html
	rm -f htmlhelp.*
	rm -f *.hhc
	rm -f *.hhp
	rm -f *.fo
	rm -f *.pdf
	rm -f *.chm
	rm -rf wsug_html
	rm -rf wsug_html_chunked
	rm -rf wsug_chm
	rm -rf wsdg_html
	rm -rf wsdg_html_chunked
	rm -rf wsdg_chm


images:
	cp $(DOCBOOKXSL)/images/note.png ./graphics
	cp $(DOCBOOKXSL)/images/tip.png ./graphics
	cp $(DOCBOOKXSL)/images/warning.png ./graphics

# validate the content
wsug_validate:
	@ echo --- VALIDATING XML ---
	$(XMLLINT) --valid --noout user-guide.xml

# create html single page file
wsug_html:
	@ echo --- HTML SINGLE PAGE ---
	mkdir -p wsug_html
	mkdir -p wsug_html/graphics
	mkdir -p wsug_html/graphics/toolbar
	cp ./graphics/*.* wsug_html/graphics
	cp ./graphics/toolbar/*.* wsug_html/graphics/toolbar
	$(XSLTPROC) --nonet $(DOCBOOKXSL)/html/docbook.xsl user-guide.xml > wsug_html/user-guide.html
	
# create html chunked page files
wsug_html_chunked: images
	@ echo --- HTML CHUNKED ---
	mkdir -p wsug_html_chunked
	mkdir -p wsug_html_chunked/graphics
	mkdir -p wsug_html_chunked/graphics/toolbar
	cp ./graphics/*.* wsug_html_chunked/graphics
	cp ./graphics/toolbar/*.* wsug_html_chunked/graphics/toolbar
	$(XSLTPROC) --stringparam base.dir wsug_html_chunked/ --stringparam  use.id.as.filename 1 --stringparam admon.graphics 1 --stringparam admon.graphics.path graphics/ --stringparam section.autolabel 1 --stringparam  section.label.includes.component.label 1 --nonet $(DOCBOOKXSL)/html/chunk.xsl user-guide.xml

# create pdf file (through XSL-FO), portrait pages on US letter paper (the default)
# you will get lot's of errors, but that's ok
wsug_pdf_us: images
if HAVE_FOP
	@ echo --- PDF US PAPER ---
	$(XSLTPROC) --nonet custom_layer_pdf.xsl $(DOCBOOKXSL)/fo/docbook.xsl user-guide.xml > user-guide.fo
	$(FOP) user-guide.fo user-guide.pdf
endif

# create pdf file (through XSL-FO), portrait pages on A4 paper
# you will get lot's of errors, but that's ok
wsug_pdf_a4: images
if HAVE_FOP
	@ echo --- PDF A4 PAPER ---
	$(XSLTPROC) --stringparam paper.type A4 --nonet custom_layer_pdf.xsl user-guide.xml > user-guide.fo
	$(FOP) user-guide.fo user-guide.pdf
endif

# create MS html help file (through html chunked pages)
wsug_chm: images
if HAVE_HHC
	@ echo --- MICROSOFT HTML HELP ---
	mkdir -p wsug_chm
	mkdir -p wsug_chm/graphics
	mkdir -p wsug_chm/graphics/toolbar
	cp ./graphics/*.* wsug_chm/graphics
	cp ./graphics/toolbar/*.* wsug_chm/graphics/toolbar
	$(XSLTPROC) --stringparam base.dir wsug_chm/ --stringparam  use.id.as.filename 1 --stringparam admon.graphics 1 --stringparam admon.graphics.path graphics/ --stringparam section.autolabel 1 --stringparam  section.label.includes.component.label 1 --nonet $(DOCBOOKXSL)/htmlhelp/htmlhelp.xsl user-guide.xml
	-$(HHC) htmlhelp.hhp
	mv htmlhelp.chm user-guide.chm
	rm -r htmlhelp.hhp
	rm -r toc.hhc
endif


wsdg: wsdg_validate wsdg_html_chunked wsdg_pdf_a4 wsdg_html wsdg_chm 

# validate the content
wsdg_validate:
	@ echo --- VALIDATING XML ---
	$(XMLLINT) --valid --noout developer-guide.xml

# create html single page file
wsdg_html:
	@ echo --- HTML SINGLE PAGE ---
	mkdir -p wsdg_html
	mkdir -p wsdg_html/graphics
	mkdir -p wsdg_html/graphics/toolbar
	cp ./graphics/*.* wsdg_html/graphics
	cp ./graphics/toolbar/*.* wsdg_html/graphics/toolbar
	$(XSLTPROC) --nonet $(DOCBOOKXSL)/html/docbook.xsl developer-guide.xml > wsdg_html/developer-guide.html
	
# create html chunked page files
wsdg_html_chunked: images
	@ echo --- HTML CHUNKED ---
	mkdir -p wsdg_html_chunked
	mkdir -p wsdg_html_chunked/graphics
	mkdir -p wsdg_html_chunked/graphics/toolbar
	cp ./graphics/*.* wsdg_html_chunked/graphics
	cp ./graphics/toolbar/*.* wsdg_html_chunked/graphics/toolbar
	$(XSLTPROC) --stringparam base.dir wsdg_html_chunked/ --stringparam  use.id.as.filename 1 --stringparam admon.graphics 1 --stringparam admon.graphics.path graphics/ --stringparam section.autolabel 1 --stringparam  section.label.includes.component.label 1 --nonet $(DOCBOOKXSL)/html/chunk.xsl developer-guide.xml

# create pdf file (through XSL-FO), portrait pages on US letter paper (the default)
# you will get lot's of errors, but that's ok
wsdg_pdf_us: images
if HAVE_FOP
	@ echo --- PDF US PAPER ---
	$(XSLTPROC) --nonet custom_layer_pdf.xsl $(DOCBOOKXSL)/fo/docbook.xsl developer-guide.xml > developer-guide.fo
	$(FOP) developer-guide.fo developer-guide.pdf
endif

# create pdf file (through XSL-FO), portrait pages on A4 paper
# you will get lot's of errors, but that's ok
wsdg_pdf_a4: images
if HAVE_FOP
	@ echo --- PDF A4 PAPER ---
	$(XSLTPROC) --stringparam paper.type A4 --nonet custom_layer_pdf.xsl developer-guide.xml > developer-guide.fo
	$(FOP) developer-guide.fo developer-guide.pdf
endif

# create MS html help file (through html chunked pages)
wsdg_chm: images
if HAVE_HHC
	@ echo --- MICROSOFT HTML HELP ---
	mkdir -p wsdg_chm
	mkdir -p wsdg_chm/graphics
	mkdir -p wsdg_chm/graphics/toolbar
	cp ./graphics/*.* wsdg_chm/graphics
	cp ./graphics/toolbar/*.* wsdg_chm/graphics/toolbar
	$(XSLTPROC) --stringparam base.dir wsdg_chm/ --stringparam  use.id.as.filename 1 --stringparam admon.graphics 1 --stringparam admon.graphics.path graphics/ --stringparam section.autolabel 1 --stringparam  section.label.includes.component.label 1 --nonet $(DOCBOOKXSL)/htmlhelp/htmlhelp.xsl developer-guide.xml
	-$(HHC) htmlhelp.hhp
	mv htmlhelp.chm developer-guide.chm
	rm -r htmlhelp.hhp
	rm -r toc.hhc
endif