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
,$(DOCBOOKDIR
)/%.xml
,$(wildcard */index.xml
))
11 MANPAGES
= $(wildcard $(MANPAGEDIR
)/*.?.xml
)
13 # Lists of files to process
14 LATEX_FIGURES
= xslt
/figures
/caution.pdf xslt
/figures
/important.pdf xslt
/figures
/note.pdf xslt
/figures
/tip.pdf xslt
/figures
/warning.pdf
15 MANPAGES_PLUCKER
= $(patsubst $(MANPAGEDIR
)/%.xml
,$(PLUCKERDIR
)/%.pdb
,$(MANPAGES
))
18 Makefile.settings
: Makefile.settings.in configure
19 @echo Makefile.settings not present
, trying to run configure...
22 configure
: configure.in
23 @echo configure not present
, trying to generate
28 @echo
"Supported make targets:"
29 @echo
" release - Build the docs needed for a Samba release"
30 @echo
" all - Build all docs that can be build using the utilities found by configure"
31 @echo
" everything - Build all of the above"
32 @echo
" pdf,tex,dvi,ps,manpages,txt,pearson,fo,htmlhelp - Build specific output format"
33 @echo
" html - Build multi-file HTML versions"
34 @echo
" html-single - Build single-file HTML versions"
35 @echo
" htmlman - Build HTML version of manpages"
36 @echo
" undocumented - Output list of undocumented smb.conf options"
37 @echo
" samples - Extract examples"
38 @echo
" files - Extract other files"
40 Samba-Guide
/index.xml
: $(subst Samba-Guide
/index.xml
,,$(wildcard Samba-Guide
/*.xml
))
41 Samba-HOWTO-Collection
/index.xml
: $(subst Samba-HOWTO-Collection
/index.xml
,,$(wildcard Samba-HOWTO-Collection
/*.xml
)) Samba-HOWTO-Collection-attributions.xml
42 Samba-Developers-Guide
/index.xml
: $(subst Samba-Developers-Guide
/index.xml
,,$(wildcard Samba-Developers-Guide
/*.xml
)) Samba-Developers-Guide-attributions.xml
46 everything
: manpages pdf html-single html htmlman txt ps fo htmlhelp pearson validate
47 release
: manpages htmlman html pdf
49 # Output format targets
50 pdf
: $(patsubst $(DOCBOOKDIR
)/%.xml
,$(PDFDIR
)/%.pdf
,$(MAIN_DOCS
))
51 dvi: $(patsubst $(DOCBOOKDIR
)/%.xml
,$(DVIDIR
)/%.
dvi,$(MAIN_DOCS
))
52 ps
: $(patsubst $(DOCBOOKDIR
)/%.xml
,$(PSDIR
)/%.ps
,$(MAIN_DOCS
))
53 txt
: $(patsubst $(DOCBOOKDIR
)/%.xml
,$(TXTDIR
)/%.txt
,$(MAIN_DOCS
))
54 txt-chunks
: $(patsubst $(DOCBOOKDIR
)/%.xml
,$(TXTDIR
)/%/,$(MAIN_DOCS
))
55 fo
: $(patsubst $(DOCBOOKDIR
)/%.xml
,$(FODIR
)/%.fo
,$(MAIN_DOCS
))
56 fo-pdf
: $(patsubst $(DOCBOOKDIR
)/%.xml
,$(FOPDFDIR
)/%.pdf
,$(MAIN_DOCS
))
57 tex: $(patsubst $(DOCBOOKDIR
)/%.xml
,%.
tex,$(MAIN_DOCS
))
58 texi
: $(patsubst $(DOCBOOKDIR
)/%.xml
,$(TEXINFODIR
)/%.texi
,$(MAIN_DOCS
))
59 texiinfo
: $(patsubst $(DOCBOOKDIR
)/%.xml
,$(TEXINFODIR
)/%.
info,$(MAIN_DOCS
))
60 manpages
: $(patsubst $(MANPAGEDIR
)/%.xml
,$(MANDIR
)/%,$(MANPAGES
))
61 pearson
: $(PEARSONDIR
)/Samba-HOWTO-Collection.xml
62 pearson-verify
: $(PEARSONDIR
)/Samba-HOWTO-Collection.report.html
63 plucker
: $(patsubst $(DOCBOOKDIR
)/%.xml
,$(PLUCKERDIR
)/%.pdb
,$(MAIN_DOCS
))
64 htmlman
: $(patsubst $(MANPAGEDIR
)/%.xml
,$(HTMLDIR
)/%.html
,$(MANPAGES
)) $(HTMLDIR
)/manpages.html
65 html-single
: $(patsubst $(DOCBOOKDIR
)/%.xml
,$(HTMLDIR
)/%.html
,$(MAIN_DOCS
))
66 html
: $(patsubst $(DOCBOOKDIR
)/%.xml
,$(HTMLDIR
)/%/index.html
,$(MAIN_DOCS
)) $(HTMLDIR
)/index.html
67 htmlhelp
: $(patsubst $(DOCBOOKDIR
)/%.xml
,$(HTMLHELPDIR
)/%,$(MAIN_DOCS
))
68 validate
: $(patsubst $(DOCBOOKDIR
)/%.xml
,%-validate
,$(MAIN_DOCS
))
70 # Intermediate docbook docs
72 $(DOCBOOKDIR
)/%.xml
: %/index.xml xslt
/expand-sambadoc.xsl
74 $(XSLTPROC
) --stringparam latex.imagebasedir
"$*/" --stringparam noreference
1 --xinclude
--output
$@ xslt
/expand-sambadoc.xsl
$<
76 $(DOCBOOKDIR
)/%.xml
: $(MANPAGEDIR
)/%.xml xslt
/expand-sambadoc.xsl
78 $(XSLTPROC
) --xinclude
--stringparam latex.imagebasedir
"$*/" --stringparam noreference
1 --output
$@ xslt
/expand-sambadoc.xsl
$<
80 $(DOCBOOKDIR
)/manpages.xml
: $(MANPAGES
) xslt
/manpage-summary.xsl
82 echo
"<article><variablelist>" > $@
83 for I in
$(MANPAGES
); do
$(XSLTPROC
) xslt
/manpage-summary.xsl
$$I >> $@
; done
84 echo
"</variablelist></article>" >> $@
88 $(HTMLDIR
)/index.html
: htmldocs.html
92 $(HTMLDIR
)/%/index.html
: $(DOCBOOKDIR
)/%.xml
$(HTMLDIR
)/%/samba.css xslt
/html-chunk.xsl
94 $(XSLTPROC
) --stringparam base.
dir "$(HTMLDIR)/$*/" xslt
/html-chunk.xsl
$<
96 $(COPY_IMAGES
) html
$(DOCBOOKDIR
)/$*.xml
$* $(@D
)
98 # Single large HTML files
99 $(OUTPUTDIR
)/%/samba.css
: xslt
/html
/samba.css
103 $(HTMLDIR
)/%.html
: $(DOCBOOKDIR
)/%.xml
$(HTMLDIR
)/samba.css xslt
/html.xsl
104 mkdir
-p
$(@D
)/images
105 $(COPY_IMAGES
) html
$(DOCBOOKDIR
)/$*.xml
$* $(@D
)
106 $(XSLTPROC
) --output
$@ xslt
/html.xsl
$<
110 $(XSLTPROC
) --xinclude
-o
$@ xslt
/generate-attributions.xsl
$*/index.xml
113 $(TXTDIR
)/%.txt
: $(HTMLDIR
)/%.html
115 $(HTML2TEXT
) -nobs
-style pretty
-o
$@
$<
117 $(TXTDIR
)/%/: $(HTMLDIR
)/%/index.html
118 $(MAKE
) `echo $(HTMLDIR)/$*/*.html | $(PERL) -p -e 's|$(HTMLDIR)|$(TXTDIR)|g;s/\.html/\.txt/g;'`
121 %.
tex: $(DOCBOOKDIR
)/%.xml xslt
/latex.xsl
123 $(XSLTPROC
) --output
$@ xslt
/latex.xsl
$<
125 latexfigures
: $(LATEX_FIGURES
)
127 $(PDFDIR
)/%.pdf
: %.pdf
131 %.idx
: %.
tex latexfigures
138 %.pdf
: %.
tex %.ind latexfigures
139 $(MAKE
) $(shell $(XSLTPROC
) --stringparam prepend
"" --stringparam append
".png" --stringparam role latex xslt
/find-image-dependencies.xsl
$(DOCBOOKDIR
)/$*.xml
)
145 $(DVIDIR
)/%.
dvi: %.
dvi
150 $(MAKE
) $(shell $(XSLTPROC
) --stringparam prepend
"" --stringparam append
".eps" --stringparam role latex xslt
/find-image-dependencies.xsl
$(DOCBOOKDIR
)/$*.xml
)
157 $(PNGTOPNM
) $< |
$(PNMTOPS
) > $@
160 $(PSDIR
)/%.ps
: $(DVIDIR
)/%.
dvi
164 xslt
/figures
/%.pdf
: xslt
/figures
/%.eps
168 $(FODIR
)/%.fo
: $(DOCBOOKDIR
)/%.xml
170 $(XSLTPROC
) --output
$@ http
://docbook.sourceforge.net
/release
/xsl
/current
/fo
/docbook.xsl
$<
173 $(FOPDFDIR
)/%.pdf
: $(FODIR
)/%.fo
175 $(FOP
) -q
-d
$< -pdf
$@
177 $(HTMLHELPDIR
)/%: $(DOCBOOKDIR
)/%.xml
179 $(COPY_IMAGES
) html
$(DOCBOOKDIR
)/$*.xml
$* $@
180 $(XSLTPROC
) --stringparam htmlhelp.chm
$*.chm
--stringparam manifest.in.base.
dir "$@/" --stringparam base.
dir "$@/" http
://docbook.sourceforge.net
/release
/xsl
/current
/htmlhelp
/htmlhelp.xsl
$<
183 $(PLUCKERDIR
)/%.pdb
: $(HTMLDIR
)/%.html
185 $(PLUCKERBUILD
) -v
-V
2 --stayonhost
--zlib-compression
-f
$* -p
$(PLUCKERDIR
) file
:$<
188 $(TEXINFODIR
)/%.texi
: $(DOCBOOKDIR
)/%.xml
190 cd
$(@D
) && $(DB2TEXI
) $(shell pwd
)/$<
192 $(TEXINFODIR
)/%.
info: $(TEXINFODIR
)/%.texi
193 $(MAKEINFO
) --no-validate
--force -o
$@
"$<"
196 $(MANPAGEDIR
)/smb.conf
.5.xml
: $(SMBDOTCONFDOC
)/parameters.
all.xml
$(SMBDOTCONFDOC
)/parameters.service.xml
$(SMBDOTCONFDOC
)/parameters.global.xml
198 $(SMBDOTCONFDOC
)/parameters.
all.xml
: $(shell find
$(SMBDOTCONFDOC
) -type f
-name
'*.xml' -mindepth
2 |
sort -t
/ -k3 | xargs
) $(SMBDOTCONFDOC
)/generate-file-list.sh
199 $(SMBDOTCONFDOC
)/generate-file-list.sh
$(SMBDOTCONFDOC
) > $@
201 $(SMBDOTCONFDOC
)/parameters.global.xml
: $(SMBDOTCONFDOC
)/parameters.
all.xml
$(SMBDOTCONFDOC
)/generate-context.xsl
202 $(XSLTPROC
) --xinclude
--param smb.context
"'G'" --output
$(SMBDOTCONFDOC
)/parameters.global.xml
$(SMBDOTCONFDOC
)/generate-context.xsl
$<
204 $(SMBDOTCONFDOC
)/parameters.service.xml
: $(SMBDOTCONFDOC
)/parameters.
all.xml
$(SMBDOTCONFDOC
)/generate-context.xsl
205 $(XSLTPROC
) --xinclude
--param smb.context
"'S'" --output
$(SMBDOTCONFDOC
)/parameters.service.xml
$(SMBDOTCONFDOC
)/generate-context.xsl
$<
207 $(MANDIR
)/%: $(DOCBOOKDIR
)/%.xml xslt
/man.xsl
209 $(XSLTPROC
) --output
$@ xslt
/man.xsl
$<
211 # Individual smb.conf parameters
212 smb.conf-chunks
: $(patsubst $(SMBDOTCONFDOC
)/%.xml
,$(HTMLDIR
)/smb.conf
/%.html
,$(wildcard $(SMBDOTCONFDOC
)/*/*.xml
))
214 $(HTMLDIR
)/smb.conf
/%.html
: $(SMBDOTCONFDOC
)/%.xml
216 $(XSLTPROC
) --output
$@ xslt
/smb.conf-html.xsl
$<
218 # Pearson compatible XML
219 $(PEARSONDIR
)/%.xml
: %/index.xml xslt
/pearson.xsl
221 $(XSLTPROC
) --xinclude
--output
$@ xslt
/sambadoc2pearson.xsl
$<
223 $(PEARSONDIR
)/%.report.html
: $(PEARSONDIR
)/%.xml
225 -$(XMLLINT
) --valid
--noout
$< 2> $@
227 # Validation verification
228 %-validate
: %/index.xml
229 -$(XMLLINT
) --xinclude
--noent
--postvalid
--noout
$<
231 # Find undocumented parameters
232 undocumented
: $(SMBDOTCONFDOC
)/parameters.
all.xml scripts
/find_missing_doc.pl scripts
/find_missing_manpages.pl
233 @
$(PERL
) scripts
/find_missing_doc.pl
$(SRCDIR
)
234 @
$(PERL
) scripts
/find_missing_manpages.pl
$(SRCDIR
)
236 # Examples and the like
237 files
: Samba-HOWTO-Collection
/index.xml xslt
/extract-smbfiles.xsl
238 $(XSLTPROC
) xslt
/extract-smbfiles.xsl
$< > /dev
/null
240 samples
: $(DOCBOOKDIR
)/Samba-HOWTO-Collection.xml xslt
/extract-examples.xsl scripts
/indent-smb.conf.pl
241 mkdir
-p
$(EXAMPLESDIR
)
242 $(XSLTPROC
) --xinclude xslt
/extract-examples.xsl
$< > /dev
/null
2> examples
/README
243 for I in examples
/*.conf
; do
{ .
/scripts
/indent-smb.conf.pl
< $$I > $$I.tmp
; mv
$$I.tmp
$$I; } done
247 mkdir
-p
$(ARCHIVEDIR
)
248 cp
$(PDFDIR
)/Samba-HOWTO-Collection.pdf
$(ARCHIVEDIR
)/TOSHARG-
$(shell date
+%Y
%m
%d
%H
%M
%S
).pdf
249 cp
$(PDFDIR
)/Samba-Guide.pdf
$(ARCHIVEDIR
)/S3bE-
$(shell date
+%Y
%m
%d
%H
%M
%S
).pdf
252 xslt
/html.xsl
: xslt
/html-common.xsl settings.xsl
253 xslt
/html-chunk.xsl
: xslt
/html-common.xsl settings.xsl
254 xslt
/latex.xsl
: settings.xsl
255 xslt
/expand-sambadoc.xsl
: settings.xsl
256 xslt
/generate-attributions.xsl
:
261 rm Makefile.settings settings.xsl config.status config.log configure
264 rm -rf
$(OUTPUTDIR
)/* $(DOCBOOKDIR
)
266 rm -f xslt
/figures
/*pdf
267 rm -f
$(SMBDOTCONFDOC
)/parameters.
*.xml
268 rm -f
$(patsubst $(DOCBOOKDIR
)/%.xml
,%.
*,$(MAIN_DOCS
))
270 # Always keep intermediate files if we can