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>
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 version of HOWTO Collection, Guide and Dev-Guide"
34 @echo
" html-single - Build single-file HTML version of HOWTO Collection, Guide and Dev-Guide"
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"
42 Samba-Guide
/index.xml
: $(subst Samba-Guide
/index.xml
,,$(wildcard Samba-Guide
/*.xml
))
43 Samba-HOWTO-Collection
/index.xml
: $(subst Samba-HOWTO-Collection
/index.xml
,,$(wildcard Samba-HOWTO-Collection
/*.xml
)) Samba-HOWTO-Collection-attributions.xml
44 Samba-Developers-Guide
/index.xml
: $(subst Samba-Developers-Guide
/index.xml
,,$(wildcard Samba-Developers-Guide
/*.xml
)) Samba-Developers-Guide-attributions.xml
48 everything
: manpages pdf html-single html htmlman txt ps fo htmlhelp pearson verify
49 release
: manpages htmlman html pdf
51 # Output format targets
52 pdf
: $(patsubst $(DOCBOOKDIR
)/%.xml
,$(PDFDIR
)/%.pdf
,$(MAIN_DOCS
))
53 dvi: $(patsubst $(DOCBOOKDIR
)/%.xml
,$(DVIDIR
)/%.
dvi,$(MAIN_DOCS
))
54 ps
: $(patsubst $(DOCBOOKDIR
)/%.xml
,$(PSDIR
)/%.ps
,$(MAIN_DOCS
))
55 txt
: $(patsubst $(DOCBOOKDIR
)/%.xml
,$(TXTDIR
)/%.txt
,$(MAIN_DOCS
))
56 fo
: $(patsubst $(DOCBOOKDIR
)/%.xml
,$(FODIR
)/%.fo
,$(MAIN_DOCS
))
57 tex: $(patsubst $(DOCBOOKDIR
)/%.xml
,%.
tex,$(MAIN_DOCS
))
58 manpages
: $(patsubst $(MANPAGEDIR
)/%.xml
,$(MANDIR
)/%,$(MANPAGES
))
59 pearson
: $(PEARSONDIR
)/Samba-HOWTO-Collection.xml
60 pearson-verify
: $(PEARSONDIR
)/Samba-HOWTO-Collection.report.html
61 plucker
: $(patsubst $(DOCBOOKDIR
)/%.xml
,$(PLUCKERDIR
)/%.pdb
,$(MAIN_DOCS
))
62 htmlman
: $(patsubst $(MANPAGEDIR
)/%.xml
,$(HTMLDIR
)/%.html
,$(MANPAGES
)) $(HTMLDIR
)/manpages.html
63 html-single
: $(patsubst $(DOCBOOKDIR
)/%.xml
,$(HTMLDIR
)/%.html
,$(MAIN_DOCS
))
64 html
: $(patsubst $(DOCBOOKDIR
)/%.xml
,$(HTMLDIR
)/%/index.html
,$(MAIN_DOCS
)) $(HTMLDIR
)/index.html
65 htmlhelp
: $(patsubst $(DOCBOOKDIR
)/%.xml
,$(HTMLHELPDIR
)/%,$(MAIN_DOCS
))
67 # Intermediate docbook docs
69 $(DOCBOOKDIR
)/%.xml
: %/index.xml xslt
/expand-sambadoc.xsl
71 $(XSLTPROC
) --stringparam latex.imagebasedir
"$*/" --stringparam noreference
1 --xinclude
--output
$@ xslt
/expand-sambadoc.xsl
$<
73 $(DOCBOOKDIR
)/%.xml
: $(MANPAGEDIR
)/%.xml xslt
/expand-sambadoc.xsl
75 $(XSLTPROC
) --xinclude
--stringparam latex.imagebasedir
"$*/" --stringparam noreference
1 --output
$@ xslt
/expand-sambadoc.xsl
$<
77 $(DOCBOOKDIR
)/manpages.xml
: $(MANPAGES
) xslt
/manpage-summary.xsl
79 echo
"<article><variablelist>" > $@
80 for I in
$(MANPAGES
); do
$(XSLTPROC
) xslt
/manpage-summary.xsl
$$I >> $@
; done
81 echo
"</variablelist></article>" >> $@
85 $(HTMLDIR
)/index.html
: htmldocs.html
89 $(HTMLDIR
)/%/index.html
: $(DOCBOOKDIR
)/%.xml
$(HTMLDIR
)/%/samba.css xslt
/html-chunk.xsl
91 $(XSLTPROC
) --stringparam base.
dir "$(HTMLDIR)/$*/" xslt
/html-chunk.xsl
$<
93 $(COPY_IMAGES
) html
$(DOCBOOKDIR
)/$*.xml
$* $(@D
)
95 # Single large HTML files
96 $(OUTPUTDIR
)/%/samba.css
: xslt
/html
/samba.css
100 $(HTMLDIR
)/%.html
: $(DOCBOOKDIR
)/%.xml
$(HTMLDIR
)/samba.css xslt
/html.xsl
101 mkdir
-p
$(@D
)/images
102 $(COPY_IMAGES
) html
$(DOCBOOKDIR
)/$*.xml
$* $(@D
)
103 $(XSLTPROC
) --output
$@ xslt
/html.xsl
$<
107 $(XSLTPROC
) --xinclude xslt
/generate-attributions.xsl
$*/index.xml
> $@
110 rm Makefile.settings settings.xsl config.status config.log configure
113 rm -rf
$(OUTPUTDIR
)/* $(DOCBOOKDIR
)
115 rm -f xslt
/figures
/*pdf
116 rm -f
$(SMBDOTCONFDOC
)/parameters.
*.xml
117 rm -f
$(patsubst $(DOCBOOKDIR
)/%.xml
,%.
*,$(MAIN_DOCS
))
120 $(TXTDIR
)/%.txt
: $(HTMLDIR
)/%.html
122 $(HTML2TEXT
) -nobs
-style pretty
-o
$@
$<
125 %.
tex: $(DOCBOOKDIR
)/%.xml xslt
/latex.xsl
127 $(XSLTPROC
) --output
$@ xslt
/latex.xsl
$<
129 latexfigures
: $(LATEX_FIGURES
)
131 $(PDFDIR
)/%.pdf
: %.pdf
135 %.idx
: %.
tex latexfigures
142 %.pdf
: %.
tex %.ind latexfigures
143 $(MAKE
) $(shell $(XSLTPROC
) --stringparam prepend
"" --stringparam append
".png" --stringparam role latex xslt
/find-image-dependencies.xsl
$(DOCBOOKDIR
)/$*.xml
)
149 $(DVIDIR
)/%.
dvi: %.
dvi
154 $(MAKE
) $(shell $(XSLTPROC
) --stringparam prepend
"" --stringparam append
".eps" --stringparam role latex xslt
/find-image-dependencies.xsl
$(DOCBOOKDIR
)/$*.xml
)
161 $(PNGTOPNM
) $< |
$(PNMTOPS
) > $@
164 $(PSDIR
)/%.ps
: $(DVIDIR
)/%.
dvi
168 xslt
/figures
/%.pdf
: xslt
/figures
/%.eps
172 $(FODIR
)/%.fo
: $(DOCBOOKDIR
)/%.xml
174 $(XSLTPROC
) --output
$@ http
://docbook.sourceforge.net
/release
/xsl
/current
/fo
/docbook.xsl
$<
176 $(HTMLHELPDIR
)/%: $(DOCBOOKDIR
)/%.xml
178 $(COPY_IMAGES
) html
$(DOCBOOKDIR
)/$*.xml
$* $@
179 $(XSLTPROC
) --stringparam htmlhelp.chm
$*.chm
--stringparam manifest.in.base.
dir "$@/" --stringparam base.
dir "$@/" http
://docbook.sourceforge.net
/release
/xsl
/current
/htmlhelp
/htmlhelp.xsl
$<
182 $(PLUCKERDIR
)/%.pdb
: $(HTMLDIR
)/%.html
184 $(PLUCKERBUILD
) -v
-M1
--stayonhost
--noimages
--zlib-compression
-H file
:$< -f
$* -p
$(PLUCKERDIR
)
187 $(MANPAGEDIR
)/smb.conf
.5.xml
: $(SMBDOTCONFDOC
)/parameters.
all.xml
$(SMBDOTCONFDOC
)/parameters.service.xml
$(SMBDOTCONFDOC
)/parameters.global.xml
189 $(SMBDOTCONFDOC
)/parameters.
all.xml
: $(shell find
$(SMBDOTCONFDOC
) -type f
-name
'*.xml' -mindepth
2 |
sort -t
/ -k3 | xargs
) $(SMBDOTCONFDOC
)/generate-file-list.sh
190 $(SMBDOTCONFDOC
)/generate-file-list.sh
$(SMBDOTCONFDOC
) > $@
192 $(SMBDOTCONFDOC
)/parameters.global.xml
: $(SMBDOTCONFDOC
)/parameters.
all.xml
$(SMBDOTCONFDOC
)/generate-context.xsl
193 $(XSLTPROC
) --xinclude
--param smb.context
"'G'" --output
$(SMBDOTCONFDOC
)/parameters.global.xml
$(SMBDOTCONFDOC
)/generate-context.xsl
$<
195 $(SMBDOTCONFDOC
)/parameters.service.xml
: $(SMBDOTCONFDOC
)/parameters.
all.xml
$(SMBDOTCONFDOC
)/generate-context.xsl
196 $(XSLTPROC
) --xinclude
--param smb.context
"'S'" --output
$(SMBDOTCONFDOC
)/parameters.service.xml
$(SMBDOTCONFDOC
)/generate-context.xsl
$<
198 $(MANDIR
)/%: $(DOCBOOKDIR
)/%.xml xslt
/man.xsl
200 $(XSLTPROC
) --output
$@ xslt
/man.xsl
$<
202 # Individual smb.conf parameters
203 smb.conf-chunks
: $(patsubst $(SMBDOTCONFDOC
)/%.xml
,$(HTMLDIR
)/smb.conf
/%.html
,$(wildcard $(SMBDOTCONFDOC
)/*/*.xml
))
205 $(HTMLDIR
)/smb.conf
/%.html
: $(SMBDOTCONFDOC
)/%.xml
207 $(XSLTPROC
) --output
$@ xslt
/smb.conf-html.xsl
$<
209 # Pearson compatible XML
211 $(PEARSONDIR
)/%.xml
: %/index.xml xslt
/pearson.xsl
213 $(XSLTPROC
) --xinclude
--output
$@ xslt
/sambadoc2pearson.xsl
$<
215 $(PEARSONDIR
)/%.report.html
: $(PEARSONDIR
)/%.xml
217 $(XMLLINT
) --valid
--noout
--htmlout
$< 2> $@
219 # Validation verification
221 $(VALIDATEDIR
)/%.report.html
: $(DOCBOOKDIR
)/%.xml
223 $(XMLLINT
) --valid
--noout
--htmlout
$< 2> $@
225 verify
: $(VALIDATEDIR
)/Samba-HOWTO-Collection.report.html
$(VALIDATEDIR
)/Samba-Developers-Guide.report.html
$(VALIDATEDIR
)/Samba-Guide.report.html
227 # Find undocumented parameters
229 undocumented
: $(SMBDOTCONFDOC
)/parameters.
all.xml scripts
/find_missing_doc.pl scripts
/find_missing_manpages.pl
230 @
$(PERL
) scripts
/find_missing_doc.pl
$(SRCDIR
)
231 @
$(PERL
) scripts
/find_missing_manpages.pl
$(SRCDIR
)
233 # Examples and the like
235 files
: $(HOWTODIR
)/index.xml xslt
/extract-smbfiles.xsl
236 $(XSLTPROC
) xslt
/extract-smbfiles.xsl
$< > /dev
/null
238 samples
: $(DOCBOOKDIR
)/Samba-HOWTO-Collection.xml xslt
/extract-examples.xsl scripts
/indent-smb.conf.pl
239 mkdir
-p
$(EXAMPLESDIR
)
240 $(XSLTPROC
) --xinclude xslt
/extract-examples.xsl
$< > /dev
/null
2> examples
/README
241 for I in examples
/*.conf
; do
{ .
/scripts
/indent-smb.conf.pl
< $$I > $$I.tmp
; mv
$$I.tmp
$$I; } done
245 mkdir
-p
$(ARCHIVEDIR
)
246 cp
$(PDFDIR
)/Samba-HOWTO-Collection.pdf
$(ARCHIVEDIR
)/TOSHARG-
`date +%Y%m%d%H%M%S`.pdf
247 cp
$(PDFDIR
)/Samba-Guide.pdf
$(ARCHIVEDIR
)/S3bE-
`date +%Y%m%d%H%M%S`.pdf
250 xslt
/html.xsl
: xslt
/html-common.xsl settings.xsl
251 xslt
/html-chunk.xsl
: xslt
/html-common.xsl settings.xsl
252 xslt
/latex.xsl
: settings.xsl
253 xslt
/expand-sambadoc.xsl
: settings.xsl
254 xslt
/generate-attributions.xsl
: