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>
16 HTML2TEXT
= @HTML2TEXT@
17 PLUCKERBUILD
= @PLUCKERBUILD@
18 COPY_IMAGES
= .
/scripts
/copy-images.sh
20 PDFLATEX
= TEXINPUTS
=xslt
/latex
:.
: @PDFLATEX@
--file-line-error-style
21 LATEX
= TEXINPUTS
=xslt
/latex
:.
: @LATEX@
--file-line-error-style
24 PDFLATEX
+= --interaction nonstopmode
25 LATEX
+= --interaction nonstopmode
30 ARCHIVEDIR
= $(OUTPUTDIR
)/archive
31 SRCDIR
= @SAMBASOURCEDIR@
32 MANDIR
= $(OUTPUTDIR
)/manpages
35 MAKEINDEX
= @MAKEINDEX@
36 EXAMPLESDIR
= examples
37 SMBDOTCONFDOC
= smbdotconf
43 HTMLHELPDIR
= $(OUTPUTDIR
)/htmlhelp
44 VALIDATEDIR
= $(OUTPUTDIR
)/validate
45 PEARSONDIR
= $(OUTPUTDIR
)/pearson
46 TXTDIR
= $(OUTPUTDIR
)/textdocs
47 HTMLDIR
=$(OUTPUTDIR
)/htmldocs
48 PLUCKERDIR
=$(OUTPUTDIR
)/plucker
51 MAIN_DOCS
= $(patsubst %/index.xml
,$(DOCBOOKDIR
)/%.xml
,$(wildcard */index.xml
))
52 MANPAGES
= $(wildcard $(MANPAGEDIR
)/*.?.xml
)
54 # Lists of files to process
55 LATEX_FIGURES
= xslt
/figures
/caution.pdf xslt
/figures
/important.pdf xslt
/figures
/note.pdf xslt
/figures
/tip.pdf xslt
/figures
/warning.pdf
56 MANPAGES_PLUCKER
= $(patsubst $(MANPAGEDIR
)/%.xml
,$(PLUCKERDIR
)/%.pdb
,$(MANPAGES_SOURCES
))
59 @echo
"Supported make targets:"
60 @echo
" release - Build the docs needed for a Samba release"
61 @echo
" all - Build all docs that can be build using the utilities found by configure"
62 @echo
" everything - Build all of the above"
63 @echo
" pdf,tex,dvi,ps,manpages,txt,pearson,fo,htmlhelp - Build specific output format"
64 @echo
" html - Build multi-file HTML version of HOWTO Collection, Guide and Dev-Guide"
65 @echo
" html-single - Build single-file HTML version of HOWTO Collection, Guide and Dev-Guide"
66 @echo
" htmlman - Build HTML version of manpages"
67 @echo
" undocumented - Output list of undocumented smb.conf options"
68 @echo
" samples - Extract examples"
69 @echo
" files - Extract other files"
71 Samba-Guide
/index.xml
: $(subst Samba-Guide
/index.xml
,,$(wildcard Samba-Guide
/*.xml
))
72 Samba-HOWTO-Collection
/index.xml
: $(subst Samba-HOWTO-Collection
/index.xml
,,$(wildcard Samba-HOWTO-Collection
/*.xml
)) Samba-HOWTO-Collection-attributions.xml
73 Samba-Developers-Guide
/index.xml
: $(subst Samba-Developers-Guide
/index.xml
,,$(wildcard Samba-Developers-Guide
/*.xml
)) Samba-Developers-Guide-attributions.xml
77 everything
: manpages pdf html-single html htmlman txt ps fo htmlhelp pearson verify
78 release
: manpages htmlman html pdf
80 # Output format targets
81 pdf
: $(patsubst $(DOCBOOKDIR
)/%.xml
,$(PDFDIR
)/%.pdf
,$(MAIN_DOCS
))
82 dvi: $(patsubst $(DOCBOOKDIR
)/%.xml
,$(DVIDIR
)/%.
dvi,$(MAIN_DOCS
))
83 ps
: $(patsubst $(DOCBOOKDIR
)/%.xml
,$(PSDIR
)/%.ps
,$(MAIN_DOCS
))
84 txt
: $(patsubst $(DOCBOOKDIR
)/%.xml
,$(TXTDIR
)/%.txt
,$(MAIN_DOCS
))
85 fo
: $(patsubst $(DOCBOOKDIR
)/%.xml
,$(FODIR
)/%.fo
,$(MAIN_DOCS
))
86 tex: $(patsubst $(DOCBOOKDIR
)/%.xml
,%.
tex,$(MAIN_DOCS
))
87 manpages
: $(patsubst $(MANPAGEDIR
)/%.xml
,$(MANDIR
)/%,$(MANPAGES
))
88 pearson
: $(PEARSONDIR
)/Samba-HOWTO-Collection.xml
89 pearson-verify
: $(PEARSONDIR
)/Samba-HOWTO-Collection.report.html
90 plucker
: $(patsubst $(DOCBOOKDIR
)/%.xml
,$(PLUCKERDIR
)/%.pdb
,$(MAIN_DOCS
))
91 htmlman
: $(patsubst $(MANPAGEDIR
)/%.xml
,$(HTMLDIR
)/%.html
,$(MANPAGES
)) $(HTMLDIR
)/manpages.html
92 html-single
: $(patsubst $(DOCBOOKDIR
)/%.xml
,$(HTMLDIR
)/%.html
,$(MAIN_DOCS
))
93 html
: $(patsubst $(DOCBOOKDIR
)/%.xml
,$(HTMLDIR
)/%/index.html
,$(MAIN_DOCS
)) $(HTMLDIR
)/index.html
94 htmlhelp
: $(patsubst $(DOCBOOKDIR
)/%.xml
,$(HTMLHELPDIR
)/%,$(MAIN_DOCS
))
96 # Intermediate docbook docs
98 $(DOCBOOKDIR
)/%.xml
: %/index.xml xslt
/expand-sambadoc.xsl
100 $(XSLTPROC
) --stringparam latex.imagebasedir
"$*/" --stringparam noreference
1 --xinclude
--output
$@ xslt
/expand-sambadoc.xsl
$<
102 $(DOCBOOKDIR
)/%.xml
: $(MANPAGEDIR
)/%.xml xslt
/expand-sambadoc.xsl
104 $(XSLTPROC
) --xinclude
--stringparam latex.imagebasedir
"$*/" --stringparam noreference
1 --output
$@ xslt
/expand-sambadoc.xsl
$<
106 $(DOCBOOKDIR
)/manpages.xml
: $(MANPAGES_SOURCES
) xslt
/manpage-summary.xsl
108 echo
"<article><variablelist>" > $@
109 for I in
$(MANPAGES_SOURCES
); do
$(XSLTPROC
) xslt
/manpage-summary.xsl
$$I >> $@
; done
110 echo
"</variablelist></article>" >> $@
114 $(HTMLDIR
)/index.html
: htmldocs.html
118 $(HTMLDIR
)/%/index.html
: $(DOCBOOKDIR
)/%.xml
$(HTMLDIR
)/%/samba.css xslt
/html-chunk.xsl
120 $(XSLTPROC
) --stringparam base.
dir "$(HTMLDIR)/$*/" xslt
/html-chunk.xsl
$<
122 $(COPY_IMAGES
) html
$(DOCBOOKDIR
)/$*.xml
$* $(@D
)
124 # Single large HTML files
125 $(OUTPUTDIR
)/%/samba.css
: xslt
/html
/samba.css
129 $(HTMLDIR
)/%.html
: $(DOCBOOKDIR
)/%.xml
$(HTMLDIR
)/samba.css xslt
/html.xsl
130 mkdir
-p
$(@D
)/images
131 $(COPY_IMAGES
) html
$(DOCBOOKDIR
)/$*.xml
$* $(@D
)
132 $(XSLTPROC
) --output
$@ xslt
/html.xsl
$<
136 $(XSLTPROC
) --xinclude xslt
/generate-attributions.xsl
$*/index.xml
> $@
139 rm -rf
$(OUTPUTDIR
)/* $(DOCBOOKDIR
)
141 rm -f xslt
/figures
/*pdf
142 rm -f
$(SMBDOTCONFDOC
)/parameters.
*.xml
143 rm -f
$(patsubst $(DOCBOOKDIR
)/%.xml
,%.
*,$(MAIN_DOCS
))
146 $(TXTDIR
)/%.txt
: $(HTMLDIR
)/%.html
148 $(HTML2TEXT
) -nobs
-style pretty
-o
$@
$<
151 %.
tex: $(DOCBOOKDIR
)/%.xml xslt
/latex.xsl
153 $(XSLTPROC
) --output
$@ xslt
/latex.xsl
$<
155 latexfigures
: $(LATEX_FIGURES
)
157 $(PDFDIR
)/%.pdf
: %.pdf
162 %.pdf
: %.
tex latexfigures
170 $(DVIDIR
)/%.
dvi: %.
dvi
175 $(MAKE
) $(shell $(XSLTPROC
) --stringparam prepend
"" --stringparam append
".eps" --stringparam role latex xslt
/find-image-dependencies.xsl
$(DOCBOOKDIR
)/$*.xml
)
182 $(PNGTOPNM
) $< |
$(PNMTOPS
) > $@
185 $(PSDIR
)/%.ps
: $(DVIDIR
)/%.
dvi
189 xslt
/figures
/%.pdf
: xslt
/figures
/%.eps
193 $(FODIR
)/%.fo
: $(DOCBOOKDIR
)/%.xml
195 $(XSLTPROC
) --output
$@ http
://docbook.sourceforge.net
/release
/xsl
/current
/fo
/docbook.xsl
$<
197 $(HTMLHELPDIR
)/%: $(DOCBOOKDIR
)/%.xml
199 $(COPY_IMAGES
) html
$(DOCBOOKDIR
)/$*.xml
$* $@
200 $(XSLTPROC
) --stringparam htmlhelp.chm
$*.chm
--stringparam manifest.in.base.
dir "$@/" --stringparam base.
dir "$@/" http
://docbook.sourceforge.net
/release
/xsl
/current
/htmlhelp
/htmlhelp.xsl
$<
203 $(PLUCKERDIR
)/%.pdb
: $(HTMLDIR
)/%.html
$(PLUCKERDIR
)
205 $(PLUCKERBUILD
) -v
-M1
--stayonhost
--noimages
--zlib-compression
-H file
:$< -f
$* -p
$(PLUCKERDIR
)
208 $(MANPAGEDIR
)/smb.conf
.5.xml
: $(SMBDOTCONFDOC
)/parameters.
all.xml
$(SMBDOTCONFDOC
)/parameters.service.xml
$(SMBDOTCONFDOC
)/parameters.global.xml
210 $(SMBDOTCONFDOC
)/parameters.
all.xml
: $(shell find
$(SMBDOTCONFDOC
) -type f
-name
'*.xml' -mindepth
2 |
sort -t
/ -k3 | xargs
) $(SMBDOTCONFDOC
)/generate-file-list.sh
211 $(SMBDOTCONFDOC
)/generate-file-list.sh
$(SMBDOTCONFDOC
) > $@
213 $(SMBDOTCONFDOC
)/parameters.global.xml
: $(SMBDOTCONFDOC
)/parameters.
all.xml
$(SMBDOTCONFDOC
)/generate-context.xsl
214 $(XSLTPROC
) --xinclude
--param smb.context
"'G'" --output
$(SMBDOTCONFDOC
)/parameters.global.xml
$(SMBDOTCONFDOC
)/generate-context.xsl
$<
216 $(SMBDOTCONFDOC
)/parameters.service.xml
: $(SMBDOTCONFDOC
)/parameters.
all.xml
$(SMBDOTCONFDOC
)/generate-context.xsl
217 $(XSLTPROC
) --xinclude
--param smb.context
"'S'" --output
$(SMBDOTCONFDOC
)/parameters.service.xml
$(SMBDOTCONFDOC
)/generate-context.xsl
$<
219 $(MANDIR
)/%: $(DOCBOOKDIR
)/%.xml xslt
/man.xsl
221 $(XSLTPROC
) --output
$@ xslt
/man.xsl
$<
223 # Pearson compatible XML
225 $(PEARSONDIR
)/%.xml
: $(DOCBOOKDIR
)/%.xml xslt
/pearson.xsl
227 $(XSLTPROC
) --xinclude
--output
$@ xslt
/pearson.xsl
$<
229 $(PEARSONDIR
)/%.report.html
: $(PEARSONDIR
)/%.xml
231 $(XMLLINT
) --valid
--noout
--htmlout
$< 2> $@
233 # Validation verification
235 $(VALIDATEDIR
)/%.report.html
: $(DOCBOOKDIR
)/%.xml
237 $(XMLLINT
) --valid
--noout
--htmlout
$< 2> $@
239 verify
: $(VALIDATEDIR
)/Samba-HOWTO-Collection.report.html
$(VALIDATEDIR
)/Samba-Developers-Guide.report.html
$(VALIDATEDIR
)/Samba-Guide.report.html
241 # Find undocumented parameters
243 undocumented
: $(SMBDOTCONFDOC
)/parameters.
all.xml scripts
/find_missing_doc.pl scripts
/find_missing_manpages.pl
244 @
$(PERL
) scripts
/find_missing_doc.pl
$(SRCDIR
)
245 @
$(PERL
) scripts
/find_missing_manpages.pl
$(SRCDIR
)
247 # Examples and the like
249 files
: $(HOWTODIR
)/index.xml xslt
/extract-smbfiles.xsl
250 $(XSLTPROC
) xslt
/extract-smbfiles.xsl
$< > /dev
/null
252 samples
: $(DOCBOOKDIR
)/Samba-HOWTO-Collection.xml xslt
/extract-examples.xsl scripts
/indent-smb.conf.pl
253 mkdir
-p
$(EXAMPLESDIR
)
254 $(XSLTPROC
) --xinclude xslt
/extract-examples.xsl
$< > /dev
/null
2> examples
/README
255 for I in examples
/*.conf
; do
{ .
/scripts
/indent-smb.conf.pl
< $$I > $$I.tmp
; mv
$$I.tmp
$$I; } done
259 mkdir
-p
$(ARCHIVEDIR
)
260 cp
$(PDFDIR
)/Samba-HOWTO-Collection.pdf
$(ARCHIVEDIR
)/TOSHARG-
`date +%Y%m%d`.pdf
261 cp
$(PDFDIR
)/Samba-Guide.pdf
$(ARCHIVEDIR
)/S3bE-
`date +%Y%m%d`.pdf
264 xslt
/html.xsl
: xslt
/html-common.xsl settings.xsl
265 xslt
/html-chunk.xsl
: xslt
/html-common.xsl settings.xsl
266 xslt
/latex.xsl
: settings.xsl
267 xslt
/expand-sambadoc.xsl
: settings.xsl
268 xslt
/generate-attributions.xsl
: