Add Jerry's list of relevant TDB files to smbd manpage
[Samba.git] / docs / Makefile.in
blobe6955d07e448f51449af8ccb08adf498923b7184
1 #################################################################
2 # Makefile.in for Samba Documentation
3 # Authors:
4 # James Moore <jmoore@php.net>
5 # Gerald Carter <jerry@samba.org>
6 # Jelmer Vernooij <jelmer@samba.org>
8 # Please see http://www.samba.org/samba/cvs.html
9 # for information on getting the latest
10 # source and documentation source files.
14 # Programs
15 WGET = @WGET@
16 XSLTPROC = @XSLTPROC@
17 XMLLINT = @XMLLINT@
18 DVIPS = @DVIPS@
19 PNGTOPNM = @PNGTOPNM@
20 EPSTOPNM = @EPSTOPNM@
21 PNMTOPNG = @PNMTOPNG@
22 PNMTOPS = @PNMTOPS@
23 HTML2TEXT = @HTML2TEXT@
24 PLUCKERBUILD = @PLUCKERBUILD@
25 PDFLATEX = TEXINPUTS=xslt/latex:.: @PDFLATEX@
26 LATEX = TEXINPUTS=xslt/latex:.: @LATEX@
27 RM = @RM@
28 ifndef DEBUG_LATEX
29 PDFLATEX += --interaction nonstopmode
30 LATEX += --interaction nonstopmode
31 endif
33 # Paths
34 TOPDIR = $(shell pwd)
35 OUTPUTDIR = $(TOPDIR)/output
36 ARCHIVEDIR = $(OUTPUTDIR)/archive
37 SRCDIR = @SAMBASOURCEDIR@
38 MANDIR = $(OUTPUTDIR)/manpages
39 EPSTOPDF = @EPSTOPDF@
40 MANPAGEDIR = $(TOPDIR)/manpages
41 HOWTODIR = $(TOPDIR)/howto
42 GUIDEDOC = $(TOPDIR)/guide
43 DEVDOCDIR = $(TOPDIR)/devel
44 MAKEINDEX = @MAKEINDEX@
45 IMAGEPROJDIR = $(HOWTODIR)/imagefiles
46 IMAGEGUIDEDIR = $(GUIDEDOC)/images
47 EXAMPLESDIR = $(TOPDIR)/examples
48 SMBDOTCONFDOC = $(TOPDIR)/smbdotconf
49 PSDIR = $(OUTPUTDIR)
50 PDFDIR = $(OUTPUTDIR)
51 DVIDIR = $(OUTPUTDIR)
52 VALIDATEDIR = $(OUTPUTDIR)/validate
53 TXTDIR = $(OUTPUTDIR)/textdocs
54 HTMLDIR=$(OUTPUTDIR)/htmldocs
55 PLUCKERDIR=$(OUTPUTDIR)/plucker
57 # Lists of files to process
58 LATEX_FIGURES = xslt/figures/caution.pdf xslt/figures/important.pdf xslt/figures/note.pdf xslt/figures/tip.pdf xslt/figures/warning.pdf
59 MANPAGES_SOURCES = $(wildcard $(MANPAGEDIR)/*.?.xml)
60 MANPAGES = $(patsubst $(MANPAGEDIR)/%.xml,$(MANDIR)/%,$(MANPAGES_SOURCES)) $(MANDIR)/smb.conf.5
61 MANPAGES_HTML = $(patsubst $(MANPAGEDIR)/%.xml,$(HTMLDIR)/%.html,$(MANPAGES_SOURCES)) $(HTMLDIR)/smb.conf.5.html $(HTMLDIR)/manpages.html
62 MANPAGES_PLUCKER = $(patsubst $(MANPAGEDIR)/%.xml,$(PLUCKERDIR)/%.pdb,$(MANPAGES_SOURCES)) $(PLUCKERDIR)/smb.conf.5.pdb
64 HOWTODIR_IMAGES_PNG = $(wildcard $(IMAGEPROJDIR)/*.png)
65 GUIDEDOC_IMAGES_PNG = $(wildcard $(IMAGEGUIDEDIR)/*.png)
66 HOWTODIR_IMAGES_EPS=$(patsubst %.png,%.eps,$(wildcard $(IMAGEPROJDIR)/*.png))
67 HOWTODIR_DEPS = $(HOWTODIR)/*.xml $(HOWTODIR)/attributions.xml $(MANPAGEDIR)/*.xml $(SMBDOTCONFDOC)/smb.conf.5.xml $(SMBDOTCONFDOC)/parameters.all.xml $(SMBDOTCONFDOC)/parameters.global.xml $(SMBDOTCONFDOC)/parameters.service.xml
68 DEVDOCDIR_DEPS = $(DEVDOCDIR)/*.xml $(DEVDOCDIR)/attributions.xml
70 help:
71 @echo "Supported make targets:"
72 @echo "release - Build the docs needed for a Samba release"
73 @echo "pdf - Build PDF version of book"
74 @echo "tex - Build Latex version of book"
75 @echo "dvi - Build Device Independant File of book"
76 @echo "ps - Build PostScript version of book"
77 @echo "manpages - Build manpages"
78 @echo "txt - Build plain text version of HOWTO Collection and Developers Guide"
79 @echo -n "html-single - Build single file HTML version of HOWTO Collection"
80 @echo " and developers guide"
81 @echo "html - Build HTML version of HOWTO Collection and Developers Guide"
82 @echo "htmlman - Build html version of manpages"
83 @echo "plucker - Build HOWTO, Developers Guide, man pages in Plucker format for PDA"
84 @echo "undocumented - Output list of undocumented smb.conf options"
85 @echo "samples - Extract examples"
86 @echo "files - Extract other files"
87 @echo "all - Build all docs that can be build using the utilities found by configure"
88 @echo "everything - Build all of the above"
90 all: @TARGETS@
92 everything: manpages pdf html-single html htmlman txt ps
94 release: manpages htmlman html pdf guide
96 # Global rules
98 pdf: $(PDFDIR) $(PDFDIR)/Samba-HOWTO-Collection.pdf $(PDFDIR)/Samba-Developers-Guide.pdf
100 dvi: $(DVIDIR) $(DVIDIR)/Samba-HOWTO-Collection.dvi $(DVIDIR)/Samba-Developers-Guide.dvi
102 ps: $(PSDIR) $(PSDIR)/Samba-HOWTO-Collection.ps $(PSDIR)/Samba-Developers-Guide.ps
104 txt: $(TXTDIR) $(TXTDIR)/Samba-HOWTO-Collection.txt $(TXTDIR)/Samba-Developers-Guide.txt
106 htmlman: $(HTMLDIR) $(MANPAGES_HTML) $(HTMLDIR)/samba.css
108 html-single: $(HTMLDIR) $(HTMLDIR)/samba.css $(HTMLDIR)/Samba-HOWTO-Collection.html $(HTMLDIR)/Samba-Developers-Guide.html $(HTMLDIR)/Samba-Guide.html
109 cp -p $(GUIDEDOC_IMAGES_PNG) $(HOWTODIR_IMAGES_PNG) $(HTMLDIR)/images/
111 html: $(HTMLDIR)/howto $(HTMLDIR)/guide $(HTMLDIR)/devel $(HTMLDIR)/index.html
113 $(HTMLDIR)/index.html: htmldocs.html $(HTMLDIR)
114 cp $< $@
116 $(HTMLDIR)/howto: $(HTMLDIR) $(HTMLDIR)/howto/samba.css Samba-HOWTO-Collection.xml
117 $(XSLTPROC) --stringparam base.dir "$(HTMLDIR)/howto/" xslt/html-chunk.xsl Samba-HOWTO-Collection.xml
118 -mkdir $(HTMLDIR)/howto/images
119 cp -R $(HOWTODIR_IMAGES_PNG) $(HTMLDIR)/howto/images
121 $(HTMLDIR)/devel: $(HTMLDIR) $(HTMLDIR)/devel/samba.css Samba-Developers-Guide.xml
122 $(XSLTPROC) --stringparam base.dir "$(HTMLDIR)/devel/" xslt/html-chunk.xsl Samba-Developers-Guide.xml
124 $(HTMLDIR)/guide: $(HTMLDIR) $(HTMLDIR)/guide/samba.css Samba-Guide.xml
125 $(XSLTPROC) --stringparam base.dir "$(HTMLDIR)/guide/" xslt/html-chunk.xsl Samba-Guide.xml
126 -mkdir $(HTMLDIR)/guide/images
127 cp -R $(GUIDEDOC_IMAGES_PNG) $(HTMLDIR)/guide/images
129 manpages: $(MANDIR) $(MANPAGES)
131 manpages.xml: $(MANPAGES_SOURCES)
132 echo "<article><variablelist>" > $@
133 for I in $(MANPAGES_SOURCES); do $(XSLTPROC) xslt/manpage-summary.xsl $$I >> $@; done
134 echo "</variablelist></article>" >> $@
136 tex: Samba-HOWTO-Collection.tex Samba-Developers-Guide.tex gpl.tex
138 plucker: html-single htmlman $(PLUCKERDIR) $(MANPAGES_PLUCKER) $(PLUCKERDIR)/Samba-Developers-Guide.pdb $(PLUCKERDIR)/Samba-HOWTO-Collection.pdb
140 Samba-HOWTO-Collection.xml: $(HOWTODIR)/index.xml $(HOWTODIR_DEPS)
141 $(XSLTPROC) --stringparam noreference 1 --xinclude --output $@ xslt/expand-sambadoc.xsl $<
143 Samba-Guide.xml: $(GUIDEDOC)/guide-main.xml
144 $(XSLTPROC) --stringparam noreference 1 --xinclude --output $@ xslt/expand-sambadoc.xsl $<
146 Samba-Developers-Guide.xml: $(DEVDOCDIR)/index.xml $(DEVDOCDIR_DEPS)
147 $(XSLTPROC) --stringparam noreference 1 --xinclude --output $@ xslt/expand-sambadoc.xsl $<
149 %/attributions.xml: %/index.xml
150 @echo "<empty/>" > $@ # Make sure we don't get recursive dependencies, etc!
151 $(XSLTPROC) --output $@ xslt/generate-attributions.xsl $<
153 clean:
154 rm -rf $(OUTPUTDIR)/*
155 rm -f *.xml $(MANPAGES) $(TXTDIR)/*.txt $(PSDIR)/*.ps \
156 $(PDFDIR)/*.pdf $(HTMLDIR)/*html $(HTMLDIR)/samba.css
157 rm -f xslt/figures/*pdf
158 rm -f $(SMBDOTCONFDOC)/parameters.*.xml $(DVIDIR)/*.dvi
159 rm -f samba-doc.* index.* $(HOWTODIR)/changelog.xml $(HOWTODIR)/attributions.xml $(DEVDOCDIR)/attributions.xml
160 rm -f Samba-HOWTO-Collection.*
161 rm -f Samba-Developers-Guide.*
162 rm -f Samba-Guide.*
163 rm -f $(IMAGEPROJDIR)/*.eps $(MANPAGEDIR)/smb.conf.5.xml
165 # Text files
166 $(TXTDIR):
167 mkdir $(TXTDIR)
169 $(TXTDIR)/%.txt: $(HTMLDIR)/%.html
170 $(HTML2TEXT) -nobs -style pretty -o $@ $<
172 # Tex files
173 %.tex: %.xml
174 $(XSLTPROC) --output $@ xslt/latex.xsl $<
176 gpl.tex:
177 $(WGET) http://www.gnu.org/licenses/gpl.tex
179 latexfigures: $(LATEX_FIGURES)
181 # Adobe PDF files
182 $(PDFDIR)/%.pdf: %.tex latexfigures gpl.tex
183 -$(PDFLATEX) $<
184 $(MAKEINDEX) `echo $< | sed -e 's/.tex//'`
185 -$(PDFLATEX) $<
186 -$(PDFLATEX) $<
187 mv $(patsubst %.tex,%.pdf,$<) $@
189 epsimages: $(HOWTODIR_IMAGES_EPS)
191 # DVI files
192 $(DVIDIR)/%.dvi: %.tex epsimages gpl.tex
193 -$(LATEX) $<
194 $(MAKEINDEX) `echo $< | sed -e 's/.tex//'`
195 -$(LATEX) $<
196 -$(LATEX) $<
197 mv $(patsubst %.tex,%.dvi,$<) $@
199 %.eps: %.png
200 $(PNGTOPNM) $< | $(PNMTOPS) > $@
202 # PostScript files
203 $(PSDIR)/%.ps: $(DVIDIR)/%.dvi
204 $(DVIPS) -o $@ $<
206 xslt/figures/%.pdf: xslt/figures/%.eps
207 $(EPSTOPDF) $<
209 # Single large HTML files
211 $(HTMLDIR):
212 mkdir $(HTMLDIR)
213 mkdir $(HTMLDIR)/howto
214 mkdir $(HTMLDIR)/guide
215 mkdir $(HTMLDIR)/devel
216 mkdir $(HTMLDIR)/images
218 $(PLUCKERDIR):
219 mkdir $(PLUCKERDIR)
221 %/samba.css: xslt/html/samba.css
222 if [ ! -d `dirname $@` ]; then mkdir -p `dirname $@`; fi
223 cp $< $@
225 $(HTMLDIR)/Samba-HOWTO-Collection.html: Samba-HOWTO-Collection.xml $(HOWTODIR_DEPS) $(HOWTODIR_IMAGES_PNG)
226 $(XSLTPROC) --output $@ xslt/html.xsl $<
228 $(HTMLDIR)/Samba-Guide.html: Samba-Guide.xml $(GUIDEDOC_IMAGES_PNG)
229 $(XSLTPROC) --output $@ xslt/html.xsl $<
231 $(HTMLDIR)/Samba-Developers-Guide.html: Samba-Developers-Guide.xml $(DEVDOCDIR_DEPS)
232 $(XSLTPROC) --output $@ xslt/html.xsl $<
234 $(HTMLDIR)/%.html: %.xml
235 $(XSLTPROC) --output $@ xslt/html.xsl $<
237 $(PLUCKERDIR)/%.pdb: $(HTMLDIR)/%.html
238 $(PLUCKERBUILD) -v -M1 --stayonhost --noimages --zlib-compression -H file:$< -f $(patsubst $(PLUCKERDIR)/%.pdb,%,$@) -p $(PLUCKERDIR)
240 %.xml: $(MANPAGEDIR)/%.xml
241 $(XSLTPROC) --stringparam noreference 1 --output $@ xslt/expand-sambadoc.xsl $<
243 # Manpages
244 $(SMBDOTCONFDOC)/parameters.all.xml: $(SMBDOTCONFDOC)/generate-file-list.sh
245 @cd $(SMBDOTCONFDOC) && \
246 /bin/sh generate-file-list.sh >parameters.all.xml && \
247 cd $(OUTPUTDIR)
249 $(SMBDOTCONFDOC)/parameters.global.xml: $(SMBDOTCONFDOC)/parameters.all.xml $(SMBDOTCONFDOC)/generate-context.xsl
250 @cd $(SMBDOTCONFDOC) && \
251 $(XSLTPROC) --xinclude \
252 --param smb.context "'G'" \
253 --output parameters.global.xml \
254 generate-context.xsl parameters.all.xml && \
255 cd $(OUTPUTDIR)
257 $(SMBDOTCONFDOC)/parameters.service.xml: $(SMBDOTCONFDOC)/parameters.all.xml $(SMBDOTCONFDOC)/generate-context.xsl
258 @cd $(SMBDOTCONFDOC) && \
259 $(XSLTPROC) --xinclude \
260 --param smb.context "'S'" \
261 --output parameters.service.xml \
262 generate-context.xsl parameters.all.xml && \
263 cd $(OUTPUTDIR)
265 smb.conf.5.xml: $(SMBDOTCONFDOC)/smb.conf.5.xml $(SMBDOTCONFDOC)/parameters.all.xml \
266 $(SMBDOTCONFDOC)/parameters.global.xml $(SMBDOTCONFDOC)/parameters.service.xml
267 $(XSLTPROC) --stringparam noreference 1 --xinclude --output $@ xslt/expand-sambadoc.xsl $<
269 $(MANDIR):
270 mkdir $(MANDIR)
272 $(MANDIR)/%: %.xml
273 $(XSLTPROC) --output $@ xslt/man.xsl $<
275 $(VALIDATEDIR):
276 mkdir $@
278 $(VALIDATEDIR)/%.report.html: %.xml
279 $(XMLLINT) --valid --noout --htmlout $< 2> $@
281 verify: $(VALIDATEDIR) $(VALIDATEDIR)/Samba-HOWTO-Collection.report.html $(VALIDATEDIR)/Samba-Developers-Guide.report.html $(VALIDATEDIR)/Samba-Guide.report.html
283 # Find undocumented parameters
285 undocumented: $(SMBDOTCONFDOC)/parameters.all.xml
286 @$(PERL) scripts/find_missing_doc.pl $(SRCDIR)
287 @$(PERL) scripts/find_missing_manpages.pl $(SRCDIR)
289 # Examples and the like
291 $(EXAMPLESDIR):
292 mkdir $(EXAMPLESDIR)
294 files: $(HOWTODIR)/index.xml $(HOWTODIR)/attributions.xml $(EXAMPLESDIR)
295 $(XSLTPROC) xslt/extract-smbfiles.xsl $< > /dev/null
297 samples: $(EXAMPLESDIR) Samba-HOWTO-Collection.xml
298 $(XSLTPROC) xslt/extract-examples.xsl Samba-HOWTO-Collection.xml > /dev/null 2> examples/README
299 for I in examples/*.conf; do { ./scripts/indent-smb.conf.pl < $$I > $$I.tmp; mv $$I.tmp $$I; } done
301 howto: $(PDFDIR)/Samba-HOWTO-Collection.pdf
302 guide: $(PDFDIR)/Samba-Guide.pdf
304 %/changelog.xml: % $(wildcard %/CVS/*)
305 touch $@
306 # FIXME
308 $(ARCHIVEDIR):
309 mkdir $(ARCHIVEDIR)
311 archive: $(ARCHIVEDIR) guide howto
312 cp $(PDFDIR)/Samba-HOWTO-Collection.pdf $(ARCHIVEDIR)/TOSHARG-`date +%Y%m%d`.pdf
313 cp $(PDFDIR)/Samba-Guide.pdf $(ARCHIVEDIR)/S3bE-`date +%Y%m%d`.pdf