1 #################################################################
2 # Makefile.in for Samba Documentation
4 # James Moore <jmoore@php.net>
5 # Gerald Carter <jerry@samba.org>
6 # Jelmer Vernooij <jelmer@samba.org>
17 HTML2TEXT
= @HTML2TEXT@
18 PLUCKERBUILD
= @PLUCKERBUILD@
19 COPY_IMAGES
= .
/scripts
/copy-images.sh
21 PDFLATEX
= TEXINPUTS
=xslt
/latex
:.
: @PDFLATEX@
--file-line-error-style
22 LATEX
= TEXINPUTS
=xslt
/latex
:.
: @LATEX@
--file-line-error-style
25 PDFLATEX
+= --interaction nonstopmode
26 LATEX
+= --interaction nonstopmode
32 SRCDIR
= @SAMBASOURCEDIR@
33 MANDIR
= $(OUTPUTDIR
)/manpages
36 MAKEINDEX
= @MAKEINDEX@
37 EXAMPLESDIR
= examples
38 SMBDOTCONFDOC
= smbdotconf
44 HTMLHELPDIR
= $(OUTPUTDIR
)/htmlhelp
45 VALIDATEDIR
= $(OUTPUTDIR
)/validate
46 PEARSONDIR
= $(OUTPUTDIR
)/pearson
47 TXTDIR
= $(OUTPUTDIR
)/textdocs
48 HTMLDIR
=$(OUTPUTDIR
)/htmldocs
49 PLUCKERDIR
=$(OUTPUTDIR
)/plucker
52 MAIN_DOCS
= $(patsubst %/index.xml
,$(DOCBOOKDIR
)/%.xml
,$(wildcard */index.xml
))
53 MANPAGES
= $(wildcard $(MANPAGEDIR
)/*.?.xml
)
55 # Lists of files to process
56 LATEX_FIGURES
= xslt
/figures
/caution.pdf xslt
/figures
/important.pdf xslt
/figures
/note.pdf xslt
/figures
/tip.pdf xslt
/figures
/warning.pdf
57 MANPAGES_PLUCKER
= $(patsubst $(MANPAGEDIR
)/%.xml
,$(PLUCKERDIR
)/%.pdb
,$(MANPAGES
))
60 @echo
"Supported make targets:"
61 @echo
" release - Build the docs needed for a Samba release"
62 @echo
" all - Build all docs that can be build using the utilities found by configure"
63 @echo
" everything - Build all of the above"
64 @echo
" pdf,tex,dvi,ps,manpages,txt,pearson,fo,htmlhelp - Build specific output format"
65 @echo
" html - Build multi-file HTML version of HOWTO Collection, Guide and Dev-Guide"
66 @echo
" html-single - Build single-file HTML version of HOWTO Collection, Guide and Dev-Guide"
67 @echo
" htmlman - Build HTML version of manpages"
68 @echo
" undocumented - Output list of undocumented smb.conf options"
69 @echo
" samples - Extract examples"
70 @echo
" files - Extract other files"
72 Samba-Guide
/index.xml
: $(subst Samba-Guide
/index.xml
,,$(wildcard Samba-Guide
/*.xml
))
73 Samba-HOWTO-Collection
/index.xml
: $(subst Samba-HOWTO-Collection
/index.xml
,,$(wildcard Samba-HOWTO-Collection
/*.xml
)) Samba-HOWTO-Collection-attributions.xml
74 Samba-Developers-Guide
/index.xml
: $(subst Samba-Developers-Guide
/index.xml
,,$(wildcard Samba-Developers-Guide
/*.xml
)) Samba-Developers-Guide-attributions.xml
78 everything
: manpages pdf html-single html htmlman txt ps fo htmlhelp pearson verify
79 release
: manpages htmlman html pdf
81 # Output format targets
82 pdf
: $(patsubst $(DOCBOOKDIR
)/%.xml
,$(PDFDIR
)/%.pdf
,$(MAIN_DOCS
))
83 dvi: $(patsubst $(DOCBOOKDIR
)/%.xml
,$(DVIDIR
)/%.
dvi,$(MAIN_DOCS
))
84 ps
: $(patsubst $(DOCBOOKDIR
)/%.xml
,$(PSDIR
)/%.ps
,$(MAIN_DOCS
))
85 txt
: $(patsubst $(DOCBOOKDIR
)/%.xml
,$(TXTDIR
)/%.txt
,$(MAIN_DOCS
))
86 fo
: $(patsubst $(DOCBOOKDIR
)/%.xml
,$(FODIR
)/%.fo
,$(MAIN_DOCS
))
87 tex: $(patsubst $(DOCBOOKDIR
)/%.xml
,%.
tex,$(MAIN_DOCS
))
88 manpages
: $(patsubst $(MANPAGEDIR
)/%.xml
,$(MANDIR
)/%,$(MANPAGES
))
89 pearson
: $(PEARSONDIR
)/Samba-HOWTO-Collection.xml
90 pearson-verify
: $(PEARSONDIR
)/Samba-HOWTO-Collection.report.html
91 plucker
: $(patsubst $(DOCBOOKDIR
)/%.xml
,$(PLUCKERDIR
)/%.pdb
,$(MAIN_DOCS
))
92 htmlman
: $(patsubst $(MANPAGEDIR
)/%.xml
,$(HTMLDIR
)/%.html
,$(MANPAGES
)) $(HTMLDIR
)/manpages.html
93 html-single
: $(patsubst $(DOCBOOKDIR
)/%.xml
,$(HTMLDIR
)/%.html
,$(MAIN_DOCS
))
94 html
: $(patsubst $(DOCBOOKDIR
)/%.xml
,$(HTMLDIR
)/%/index.html
,$(MAIN_DOCS
)) $(HTMLDIR
)/index.html
95 htmlhelp
: $(patsubst $(DOCBOOKDIR
)/%.xml
,$(HTMLHELPDIR
)/%,$(MAIN_DOCS
))
97 # Intermediate docbook docs
99 $(DOCBOOKDIR
)/%.xml
: %/index.xml xslt
/expand-sambadoc.xsl
101 $(XSLTPROC
) --stringparam latex.imagebasedir
"$*/" --stringparam noreference
1 --xinclude
--output
$@ xslt
/expand-sambadoc.xsl
$<
103 $(DOCBOOKDIR
)/%.xml
: $(MANPAGEDIR
)/%.xml xslt
/expand-sambadoc.xsl
105 $(XSLTPROC
) --xinclude
--stringparam latex.imagebasedir
"$*/" --stringparam noreference
1 --output
$@ xslt
/expand-sambadoc.xsl
$<
107 $(DOCBOOKDIR
)/manpages.xml
: $(MANPAGES
) xslt
/manpage-summary.xsl
109 echo
"<article><variablelist>" > $@
110 for I in
$(MANPAGES
); do
$(XSLTPROC
) xslt
/manpage-summary.xsl
$$I >> $@
; done
111 echo
"</variablelist></article>" >> $@
115 $(HTMLDIR
)/index.html
: htmldocs.html
119 $(HTMLDIR
)/%/index.html
: $(DOCBOOKDIR
)/%.xml
$(HTMLDIR
)/%/samba.css xslt
/html-chunk.xsl
121 $(XSLTPROC
) --stringparam base.
dir "$(HTMLDIR)/$*/" xslt
/html-chunk.xsl
$<
123 $(COPY_IMAGES
) html
$(DOCBOOKDIR
)/$*.xml
$* $(@D
)
125 # Single large HTML files
126 $(OUTPUTDIR
)/%/samba.css
: xslt
/html
/samba.css
130 $(HTMLDIR
)/%.html
: $(DOCBOOKDIR
)/%.xml
$(HTMLDIR
)/samba.css xslt
/html.xsl
131 mkdir
-p
$(@D
)/images
132 $(COPY_IMAGES
) html
$(DOCBOOKDIR
)/$*.xml
$* $(@D
)
133 $(XSLTPROC
) --output
$@ xslt
/html.xsl
$<
137 $(XSLTPROC
) --xinclude xslt
/generate-attributions.xsl
$*/index.xml
> $@
140 rm Makefile settings.xsl config.status config.log configure
143 rm -rf
$(OUTPUTDIR
)/* $(DOCBOOKDIR
)
145 rm -f xslt
/figures
/*pdf
146 rm -f
$(SMBDOTCONFDOC
)/parameters.
*.xml
147 rm -f
$(patsubst $(DOCBOOKDIR
)/%.xml
,%.
*,$(MAIN_DOCS
))
150 $(TXTDIR
)/%.txt
: $(HTMLDIR
)/%.html
152 $(HTML2TEXT
) -nobs
-style pretty
-o
$@
$<
155 %.
tex: $(DOCBOOKDIR
)/%.xml xslt
/latex.xsl
157 $(XSLTPROC
) --output
$@ xslt
/latex.xsl
$<
159 latexfigures
: $(LATEX_FIGURES
)
161 $(PDFDIR
)/%.pdf
: %.pdf
165 %.idx
: %.
tex latexfigures
172 %.pdf
: %.
tex %.ind latexfigures
173 $(MAKE
) $(shell $(XSLTPROC
) --stringparam prepend
"" --stringparam append
".png" --stringparam role latex xslt
/find-image-dependencies.xsl
$(DOCBOOKDIR
)/$*.xml
)
179 $(DVIDIR
)/%.
dvi: %.
dvi
184 $(MAKE
) $(shell $(XSLTPROC
) --stringparam prepend
"" --stringparam append
".eps" --stringparam role latex xslt
/find-image-dependencies.xsl
$(DOCBOOKDIR
)/$*.xml
)
191 $(PNGTOPNM
) $< |
$(PNMTOPS
) > $@
194 $(PSDIR
)/%.ps
: $(DVIDIR
)/%.
dvi
198 xslt
/figures
/%.pdf
: xslt
/figures
/%.eps
202 $(FODIR
)/%.fo
: $(DOCBOOKDIR
)/%.xml
204 $(XSLTPROC
) --output
$@ http
://docbook.sourceforge.net
/release
/xsl
/current
/fo
/docbook.xsl
$<
206 $(HTMLHELPDIR
)/%: $(DOCBOOKDIR
)/%.xml
208 $(COPY_IMAGES
) html
$(DOCBOOKDIR
)/$*.xml
$* $@
209 $(XSLTPROC
) --stringparam htmlhelp.chm
$*.chm
--stringparam manifest.in.base.
dir "$@/" --stringparam base.
dir "$@/" http
://docbook.sourceforge.net
/release
/xsl
/current
/htmlhelp
/htmlhelp.xsl
$<
212 $(PLUCKERDIR
)/%.pdb
: $(HTMLDIR
)/%.html
214 $(PLUCKERBUILD
) -v
-M1
--stayonhost
--noimages
--zlib-compression
-H file
:$< -f
$* -p
$(PLUCKERDIR
)
217 $(MANPAGEDIR
)/smb.conf
.5.xml
: $(SMBDOTCONFDOC
)/parameters.
all.xml
$(SMBDOTCONFDOC
)/parameters.service.xml
$(SMBDOTCONFDOC
)/parameters.global.xml
219 $(SMBDOTCONFDOC
)/parameters.
all.xml
: $(shell find
$(SMBDOTCONFDOC
) -type f
-name
'*.xml' -mindepth
2 |
sort -t
/ -k3 | xargs
) $(SMBDOTCONFDOC
)/generate-file-list.sh
220 $(SMBDOTCONFDOC
)/generate-file-list.sh
$(SMBDOTCONFDOC
) > $@
222 $(SMBDOTCONFDOC
)/parameters.global.xml
: $(SMBDOTCONFDOC
)/parameters.
all.xml
$(SMBDOTCONFDOC
)/generate-context.xsl
223 $(XSLTPROC
) --xinclude
--param smb.context
"'G'" --output
$(SMBDOTCONFDOC
)/parameters.global.xml
$(SMBDOTCONFDOC
)/generate-context.xsl
$<
225 $(SMBDOTCONFDOC
)/parameters.service.xml
: $(SMBDOTCONFDOC
)/parameters.
all.xml
$(SMBDOTCONFDOC
)/generate-context.xsl
226 $(XSLTPROC
) --xinclude
--param smb.context
"'S'" --output
$(SMBDOTCONFDOC
)/parameters.service.xml
$(SMBDOTCONFDOC
)/generate-context.xsl
$<
228 $(MANDIR
)/%: $(DOCBOOKDIR
)/%.xml xslt
/man.xsl
230 $(XSLTPROC
) --output
$@ xslt
/man.xsl
$<
232 # Individual smb.conf parameters
233 smb.conf-chunks
: $(patsubst $(SMBDOTCONFDOC
)/%.xml
,$(HTMLDIR
)/smb.conf
/%.html
,$(wildcard $(SMBDOTCONFDOC
)/*/*.xml
))
235 $(HTMLDIR
)/smb.conf
/%.html
: $(SMBDOTCONFDOC
)/%.xml
237 $(XSLTPROC
) --output
$@ xslt
/smb.conf-html.xsl
$<
239 # Pearson compatible XML
241 $(PEARSONDIR
)/%.xml
: %/index.xml xslt
/pearson.xsl
243 $(XSLTPROC
) --xinclude
--output
$@ xslt
/sambadoc2pearson.xsl
$<
245 $(PEARSONDIR
)/%.report.html
: $(PEARSONDIR
)/%.xml
247 $(XMLLINT
) --valid
--noout
--htmlout
$< 2> $@
249 # Validation verification
251 $(VALIDATEDIR
)/%.report.html
: $(DOCBOOKDIR
)/%.xml
253 $(XMLLINT
) --valid
--noout
--htmlout
$< 2> $@
255 verify
: $(VALIDATEDIR
)/Samba-HOWTO-Collection.report.html
$(VALIDATEDIR
)/Samba-Developers-Guide.report.html
$(VALIDATEDIR
)/Samba-Guide.report.html
257 # Find undocumented parameters
259 undocumented
: $(SMBDOTCONFDOC
)/parameters.
all.xml scripts
/find_missing_doc.pl scripts
/find_missing_manpages.pl
260 @
$(PERL
) scripts
/find_missing_doc.pl
$(SRCDIR
)
261 @
$(PERL
) scripts
/find_missing_manpages.pl
$(SRCDIR
)
263 # Examples and the like
265 files
: $(HOWTODIR
)/index.xml xslt
/extract-smbfiles.xsl
266 $(XSLTPROC
) xslt
/extract-smbfiles.xsl
$< > /dev
/null
268 samples
: $(DOCBOOKDIR
)/Samba-HOWTO-Collection.xml xslt
/extract-examples.xsl scripts
/indent-smb.conf.pl
269 mkdir
-p
$(EXAMPLESDIR
)
270 $(XSLTPROC
) --xinclude xslt
/extract-examples.xsl
$< > /dev
/null
2> examples
/README
271 for I in examples
/*.conf
; do
{ .
/scripts
/indent-smb.conf.pl
< $$I > $$I.tmp
; mv
$$I.tmp
$$I; } done
275 mkdir
-p
$(ARCHIVEDIR
)
276 cp
$(PDFDIR
)/Samba-HOWTO-Collection.pdf
$(ARCHIVEDIR
)/TOSHARG-
`date +%Y%m%d%H%M%S`.pdf
277 cp
$(PDFDIR
)/Samba-Guide.pdf
$(ARCHIVEDIR
)/S3bE-
`date +%Y%m%d%H%M%S`.pdf
280 xslt
/html.xsl
: xslt
/html-common.xsl settings.xsl
281 xslt
/html-chunk.xsl
: xslt
/html-common.xsl settings.xsl
282 xslt
/latex.xsl
: settings.xsl
283 xslt
/expand-sambadoc.xsl
: settings.xsl
284 xslt
/generate-attributions.xsl
: