1 #################################################################
2 # Makefile for Samba Documentation
4 # James Moore <jmoore@php.net>
5 # Gerald Carter <jerry@samba.org>
6 # Jelmer Vernooij <jelmer@samba.org>
7 include Makefile.settings
10 MAIN_DOCS
= $(patsubst %/index.xml
,%,$(wildcard */index.xml
))
11 MANPAGES3
= $(wildcard $(MANPAGEDIR3
)/*.?.xml
)
12 export TEXINPUTS
=xslt
/latex
:.
:
14 # Lists of files to process
15 LATEX_FIGURES
= xslt
/figures
/caution.pdf xslt
/figures
/important.pdf xslt
/figures
/note.pdf xslt
/figures
/tip.pdf xslt
/figures
/warning.pdf
16 MANPAGES_PLUCKER
= $(patsubst $(MANPAGEDIR3
)/%.xml
,$(PLUCKERDIR
)/%.pdb
,$(MANPAGES3
))
18 DATETIME
:= $(shell date
+%Y
%m
%d
%H
%M
%S
)
21 XSLTPROC
+= --profile
--load-trace
--timing
25 Makefile.settings
: configure
26 @echo Makefile.settings not present
, trying to run configure...
29 configure
: configure.in
30 @echo configure not present
, trying to regenerate it...
35 @echo
"Supported make targets:"
36 @echo
" release - Build the docs needed for a Samba release"
37 @echo
" all - Build all docs that can be build using the utilities found by configure"
38 @echo
" everything - Build all of the above"
39 @echo
" pdf,tex,dvi,ps,manpages3,txt,pearson,fo,htmlhelp - Build specific output format"
40 @echo
" html - Build multi-file HTML versions"
41 @echo
" html-single - Build single-file HTML versions"
42 @echo
" htmlman3 - Build HTML version of manpages"
43 @echo
" undocumented - Output list of undocumented smb.conf options"
44 @echo
" samples - Extract examples"
46 $(DOCBOOKDIR
)/Samba3-ByExample.xml
: $(filter-out Samba3-ByExample
/index.xml
,$(wildcard Samba3-ByExample
/*.xml
))
47 $(DOCBOOKDIR
)/Samba3-HOWTO.xml
: $(filter-out Samba3-HOWTO
/index.xml
,$(wildcard Samba3-HOWTO
/*.xml
)) Samba3-HOWTO-attributions.xml
48 Samba3-HOWTO
/manpages.xml
: $(MANPAGEDIR3
)/smb.conf
.5.xml
49 $(DOCBOOKDIR
)/Samba3-Developers-Guide.xml
: $(filter-out Samba3-Developers-Guide
/index.xml
,$(wildcard Samba3-Developers-Guide
/*.xml
)) Samba3-Developers-Guide-attributions.xml
50 $(DOCBOOKDIR
)/Samba4-HOWTO.xml
: $(filter-out Samba4-HOWTO
/index.xml
,$(wildcard Samba4-HOWTO
/*.xml
)) Samba4-HOWTO-attributions.xml
54 everything
: manpages3 pdf html-single html htmlman3 txt ps fo htmlhelp pearson
55 release
: manpages3 htmlman3 html pdf
57 # Output format targets
58 pdf
: $(patsubst %,$(PDFDIR
)/%.pdf
,$(MAIN_DOCS
))
59 dvi: $(patsubst %,$(DVIDIR
)/%.
dvi,$(MAIN_DOCS
))
60 ps
: $(patsubst %,$(PSDIR
)/%.ps
,$(MAIN_DOCS
))
61 txt
: $(patsubst %,$(TXTDIR
)/%.txt
,$(MAIN_DOCS
))
62 txt-chunks
: $(addsuffix -txt-chunks
,$(MAIN_DOCS
))
63 fo
: $(patsubst %,$(FODIR
)/%.fo
,$(MAIN_DOCS
))
64 fo-pdf
: $(patsubst %,$(FOPDFDIR
)/%.pdf
,$(MAIN_DOCS
))
65 tex: $(addsuffix .
tex,$(MAIN_DOCS
))
66 texi
: $(patsubst %,$(TEXINFODIR
)/%.texi
,$(MAIN_DOCS
))
67 texiinfo
: $(patsubst %,$(TEXINFODIR
)/%.
info,$(MAIN_DOCS
))
68 manpages3
: $(patsubst $(MANPAGEDIR3
)/%.xml
,$(OUTPUTDIR
)/manpages-3
/%,$(MANPAGES3
))
69 pearson
: $(PEARSONDIR
)/Samba3-HOWTO.xml
70 pearson-verify
: $(PEARSONDIR
)/Samba3-HOWTO.report.html
71 plucker
: $(patsubst %,$(PLUCKERDIR
)/%.pdb
,$(MAIN_DOCS
))
72 htmlman3
: $(patsubst $(MANPAGEDIR3
)/%.xml
,$(HTMLDIR
)/manpages-3
/%.html
,$(MANPAGES3
)) $(HTMLDIR
)/manpages-3
/index.html
73 html-single
: $(patsubst %,$(HTMLDIR
)/%.html
,$(MAIN_DOCS
))
74 html
: $(patsubst %,$(HTMLDIR
)/%/index.html
,$(MAIN_DOCS
)) $(HTMLDIR
)/index.html
75 htmlhelp
: $(addprefix $(HTMLHELPDIR
)/,$(MAIN_DOCS
))
76 validate
: $(addsuffix -validate
,$(MAIN_DOCS
))
78 # Intermediate docbook docs
80 $(DOCBOOKDIR
)/%.xml
: %/index.xml xslt
/expand-sambadoc.xsl
81 @echo
"Converting Samba-specific tags for $*..."
83 $(XSLTPROC
) --stringparam latex.imagebasedir
"$*/" --stringparam noreference
1 --xinclude
--output
$@ xslt
/expand-sambadoc.xsl
$<
85 $(DOCBOOKDIR
)/manpages-3
/%.xml
: $(MANPAGEDIR3
)/%.xml xslt
/expand-sambadoc.xsl
87 $(XSLTPROC
) --xinclude
--stringparam noreference
1 --output
$@ xslt
/expand-sambadoc.xsl
$<
89 $(DOCBOOKDIR
)/manpages-3
/index.xml
: $(MANPAGES3
) xslt
/manpage-summary.xsl
91 echo
"<article><variablelist>" > $@
92 $(XSLTPROC
) xslt
/manpage-summary.xsl
$(MANPAGES3
) >> $@
93 @echo
"</variablelist></article>" >> $@
97 $(HTMLDIR
)/index.html
: htmldocs.html
101 $(HTMLDIR
)/%/index.html
: $(DOCBOOKDIR
)/%.xml
$(HTMLDIR
)/%/samba.css xslt
/html-chunk.xsl
%-images-html-chunks
103 $(XSLTPROC
) --stringparam base.
dir "$(HTMLDIR)/$*/" xslt
/html-chunk.xsl
$<
105 # Single large HTML files
106 $(OUTPUTDIR
)/%/samba.css
: xslt
/html
/samba.css
110 $(patsubst %,$(HTMLDIR
)/%.html
,$(MAIN_DOCS
)): $(HTMLDIR
)/%.html
: %-images-html-single
112 $(HTMLDIR
)/%.html
: $(DOCBOOKDIR
)/%.xml
$(HTMLDIR
)/samba.css xslt
/html.xsl
113 $(XSLTPROC
) --output
$@ xslt
/html.xsl
$<
117 @echo
"Generating attributions file $@ from $*/"
118 $(XSLTPROC
) --xinclude
-o
$@ xslt
/generate-attributions.xsl
$*/index.xml
121 $(TXTDIR
)/%.txt
: $(HTMLDIR
)/%.html
123 $(HTML2TEXT
) -nobs
-style pretty
-o
$@
$<
126 %.
tex: %/index.xml xslt
/latex.xsl
127 @echo
"Generating $@..."
129 $(XSLTPROC
) $(DB2LATEX_ARGS
) --stringparam latex.imagebasedir
"$*/" --xinclude
--output
$@ xslt
/latex.xsl
$<
131 latexfigures
: $(LATEX_FIGURES
)
133 $(PDFDIR
)/%.pdf
: %.pdf
137 %.idx
: %.
tex latexfigures
144 %.d
: $(DOCBOOKDIR
)/%.xml xslt
/generate-dependencies.xsl
145 @echo
"Generating dependency file for $*"
148 --stringparam txtbasedir
"$(TXTDIR)/$*/" \
149 --stringparam target
"$*" \
150 -o
$@ xslt
/generate-dependencies.xsl
$<
151 @echo
"$*-images-latex-dia = \$$(wildcard \$$(addsuffix .dia, \$$($*-images-latex)))" >> $@
152 @echo
"$*-images-latex-eps: \$$(addsuffix .eps, \$$($*-images-latex))" >> $@
153 @echo
"$*-images-latex-pdf: \$$(patsubst %.dia, %.pdf, \$$($*-images-latex-dia))" >> $@
154 @echo
"$*-images-latex-png: \$$(filter-out \$$(patsubst %.dia,%.png,\$$($*-images-latex-dia)), \$$(addsuffix .png, \$$($*-images-latex)))" >> $@
157 @echo
"\$$(HTMLDIR)/%: $*/%" >> $@
158 @echo
" @mkdir -p \$$(@D)" >> $@
159 @echo
" @cp \$$< \$$@" >> $@
161 @echo
"\$$(HTMLDIR)/$*/%: $*/%" >> $@
162 @echo
" @mkdir -p \$$(@D)" >> $@
163 @echo
" @cp \$$< \$$@" >> $@
165 @echo
"\$$(HTMLHELPDIR)/$*/%: $*/%" >> $@
166 @echo
" @mkdir -p \$$(@D)" >> $@
167 @echo
" @cp \$$< \$$@" >> $@
169 @echo
"$*-images-html-single: \$$(addprefix \$$(HTMLDIR)/, \$$($*-images-html))" >> $@
170 @echo
"$*-images-html-chunks: \$$(addprefix \$$(HTMLDIR)/$*/, \$$($*-images-html))" >> $@
171 @echo
"$*-images-htmlhelp: \$$(addprefix \$$(HTMLHELPDIR)/$*/, \$$($*-images-html))" >> $@
174 ifneq ($(MAKECMDGOALS
),clobber)
175 -include $(addsuffix .d
,$(MAIN_DOCS
))
180 %.pdf
: %.
tex %.ind latexfigures
%-images-latex-png
%-images-latex-pdf
182 $(THUMBPDF
) --quiet
$*.pdf
186 $(DVIDIR
)/%.
dvi: %.
dvi
190 %.
dvi: %.
tex %.idx
%-images-latex-eps
194 $(DIA
) -t eps-builtin
-e
$@
$<
203 $(PNGTOPNM
) $< |
$(PNMTOPS
) > $@
206 $(PSDIR
)/%.ps
: $(DVIDIR
)/%.
dvi
211 $(FODIR
)/%.fo
: $(DOCBOOKDIR
)/%.xml
213 $(XSLTPROC
) --output
$@ xslt
/fo.xsl
$<
216 $(FOPDFDIR
)/%.pdf
: $(FODIR
)/%.fo
218 JAVA_OPTS
=-Xmx250m
$(FOP
) -q
-d
$< -pdf
$@
220 $(HTMLHELPDIR
)/%: $(DOCBOOKDIR
)/%.xml
%-images-htmlhelp
221 $(XSLTPROC
) --stringparam htmlhelp.chm
$*.chm \
222 --stringparam manifest.in.base.
dir "$@/" \
223 --stringparam base.
dir "$@/" \
224 http
://docbook.sourceforge.net
/release
/xsl
/current
/htmlhelp
/htmlhelp.xsl
$<
227 $(PLUCKERDIR
)/%.pdb
: $(HTMLDIR
)/%.html
229 $(PLUCKERBUILD
) -v
-V
2 --stayonhost
--zlib-compression
-f
$* -p
$(PLUCKERDIR
) file
:$<
232 $(TEXINFODIR
)/%.texi
: $(DOCBOOKDIR
)/%.xml
234 cd
$(@D
) && $(DB2TEXI
) $(shell pwd
)/$<
236 $(TEXINFODIR
)/%.
info: $(TEXINFODIR
)/%.texi
237 $(MAKEINFO
) --no-validate
--force -o
$@
"$<"
240 $(MANPAGEDIR3
)/smb.conf
.5.xml
: $(SMBDOTCONFDOC
)/parameters.
all.xml
$(SMBDOTCONFDOC
)/parameters.service.xml
$(SMBDOTCONFDOC
)/parameters.global.xml
242 $(SMBDOTCONFDOC
)/parameters.
all.xml
: $(wildcard $(SMBDOTCONFDOC
)/*/*.xml
) $(SMBDOTCONFDOC
)/generate-file-list.sh
243 $(SMBDOTCONFDOC
)/generate-file-list.sh
$(SMBDOTCONFDOC
) > $@
245 $(SMBDOTCONFDOC
)/parameters.global.xml
: $(SMBDOTCONFDOC
)/parameters.
all.xml
$(SMBDOTCONFDOC
)/generate-context.xsl
246 @echo
"Generating list of global smb.conf options"
247 $(XSLTPROC
) --xinclude
--param smb.context
"'G'" --output
$(SMBDOTCONFDOC
)/parameters.global.xml
$(SMBDOTCONFDOC
)/generate-context.xsl
$<
249 $(SMBDOTCONFDOC
)/parameters.service.xml
: $(SMBDOTCONFDOC
)/parameters.
all.xml
$(SMBDOTCONFDOC
)/generate-context.xsl
250 @echo
"Generating list of share-mode smb.conf options"
251 $(XSLTPROC
) --xinclude
--param smb.context
"'S'" --output
$(SMBDOTCONFDOC
)/parameters.service.xml
$(SMBDOTCONFDOC
)/generate-context.xsl
$<
253 $(OUTPUTDIR
)/%: $(DOCBOOKDIR
)/%.xml xslt
/man.xsl
255 $(XSLTPROC
) --output
$@ xslt
/man.xsl
$<
257 # Individual smb.conf parameters
258 smb.conf-chunks
: $(patsubst $(SMBDOTCONFDOC
)/%.xml
,$(HTMLDIR
)/smb.conf
/%.html
,$(wildcard $(SMBDOTCONFDOC
)/*/*.xml
))
260 $(HTMLDIR
)/smb.conf
/%.html
: $(SMBDOTCONFDOC
)/%.xml
262 $(XSLTPROC
) --output
$@ xslt
/smb.conf-html.xsl
$<
264 # Pearson compatible XML
265 $(PEARSONDIR
)/%.xml
: %/index.xml xslt
/pearson.xsl
267 $(XSLTPROC
) --xinclude
--output
$@ xslt
/sambadoc2pearson.xsl
$<
269 $(PEARSONDIR
)/%.report.html
: $(PEARSONDIR
)/%.xml
271 -$(XMLLINT
) --valid
--noout
$< 2> $@
273 # Validation verification
274 %-validate
: %/index.xml
275 cd
$(<D
) && $(XMLLINT
) --xinclude
--noent
--postvalid
--noout
$(<F
)
277 # Find undocumented parameters
278 undocumented
: $(SMBDOTCONFDOC
)/parameters.
all.xml scripts
/find_missing_doc.pl scripts
/find_missing_manpages.pl
279 $(PERL
) scripts
/find_missing_doc.pl
$(SRCDIR
)
280 $(PERL
) scripts
/find_missing_manpages.pl
$(SRCDIR
)
282 samples
: $(DOCBOOKDIR
)/Samba3-HOWTO.xml xslt
/extract-examples.xsl scripts
/indent-smb.conf.pl
283 @mkdir
-p
$(EXAMPLESDIR
)
284 $(XSLTPROC
) --xinclude xslt
/extract-examples.xsl
$< > /dev
/null
2> examples
/README
285 for I in examples
/*.conf
; do
{ .
/scripts
/indent-smb.conf.pl
< $$I > $$I.tmp
; mv
$$I.tmp
$$I; } done
289 @mkdir
-p
$(ARCHIVEDIR
)
290 cp
$(PDFDIR
)/Samba3-HOWTO.pdf
$(ARCHIVEDIR
)/TOSHARG-
$(DATETIME
).pdf
291 cp
$(PDFDIR
)/Samba3-ByExample.pdf
$(ARCHIVEDIR
)/S3bE-
$(DATETIME
).pdf
294 xslt
/html.xsl
: xslt
/html-common.xsl
295 xslt
/html-chunk.xsl
: xslt
/html-common.xsl
297 xslt
/expand-sambadoc.xsl
:
298 xslt
/generate-attributions.xsl
:
302 distclean clobber: clean
303 rm Makefile.settings config.status config.log configure
306 @echo
"Cleaning up..."
307 rm -rf
$(OUTPUTDIR
)/* $(DOCBOOKDIR
)
308 rm -f
$(patsubst %.dia
,%.png
,$(foreach DOC
,$(MAIN_DOCS
),$($(DOC
)-images-latex-dia
))) \
309 $(patsubst %.dia
,%.pdf
,$(foreach DOC
,$(MAIN_DOCS
),$($(DOC
)-images-latex-dia
))) \
310 $(patsubst %.dia
,%.eps
,$(foreach DOC
,$(MAIN_DOCS
),$($(DOC
)-images-latex-dia
)))
311 rm -f
*.xml
*.d
*.tpt
*.
tex *.loc
*.toc
*.lof
*.glo
*.idx
*.aux
313 rm -f
*-images-latex-
* latexfigures
314 rm -f xslt
/figures
/*pdf
315 rm -f
$(SMBDOTCONFDOC
)/parameters.
*.xml
316 rm -f
$(addsuffix .
*,$(MAIN_DOCS
))
318 # Always keep intermediate files if we can
320 .PHONY
: clean clobber archive release everything
all $(TARGETS
) latexfigures