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
9 export XML_CATALOG_FILES
:= $(XML_CATALOG_FILES
) /etc
/xml
/catalog
$(shell pwd
)/build
/catalog.xml
12 MAIN_DOCS
= $(patsubst %/index.xml
,%,$(wildcard */index.xml
))
13 MANPAGES
= $(sort $(wildcard $(MANPAGEDIR
)/*.?.xml
))
15 # Lists of files to process
16 DBLATEX_OPTIONS
= -p xslt
/latex.xsl
-i xslt
/latex
18 DATETIME
:= $(shell date
+%Y
%m
%d
%H
%M
%S
)
20 XSLTPROC_DEPS
= build
/catalog.xml build
/DTD
/samba.build.version build
/DTD
/samba.build.pathconfig
23 XSLTPROC
+= --profile
--load-trace
--timing
27 Makefile.settings
: configure
30 configure
: configure.ac
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 built using the utilities found by configure"
38 @echo
" everything - Build all of the above"
39 @echo
" pdf,tex,ps,manpages,htmlhelp - Build specific output format"
40 @echo
" html - Build multi-file HTML versions"
41 @echo
" html-single - Build single-file HTML versions"
42 @echo
" htmlman - Build HTML version of manpages"
44 $(PDFDIR
)/Samba3-Developers-Guide.pdf
$(PSDIR
)/Samba3-Developers-Guide.ps
$(DOCBOOKDIR
)/Samba3-Developers-Guide.xml Samba3-Developers-Guide.
tex: $(wildcard Samba3-Developers-Guide
/*.xml
) Samba3-Developers-Guide-attributions.xml
48 everything
:: manpages pdf html-single html htmlman ps fo htmlhelp
49 release
:: manpages htmlman html pdf
51 @echo
"Cleaning up..."
52 rm -rf
$(OUTPUTDIR
)/* $(DOCBOOKDIR
)
53 rm -f
*-attributions.xml
54 rm -f
*-attributions.xml
*.d
*.tpt
*.
tex *.loc
*.toc
*.lof
*.glo
*.idx
*.aux
56 rm -f
*-images-latex-
* $(LATEX_FIGURES
)
57 rm -f xslt
/figures
/*pdf
58 rm -f
$(SMBDOTCONFDOC
)/parameters.
*.xml
59 rm -f build
/catalog.xml
60 rm -f DTD
/samba.build.pathconfig
62 # Output format targets
63 pdf
:: $(patsubst %,$(PDFDIR
)/%.pdf
,$(MAIN_DOCS
))
64 ps
:: $(patsubst %,$(PSDIR
)/%.ps
,$(MAIN_DOCS
))
65 tex:: $(addsuffix .
tex,$(MAIN_DOCS
))
66 manpages
:: $(patsubst $(MANPAGEDIR
)/%.xml
,$(OUTPUTDIR
)/manpages
/%,$(MANPAGES
))
67 htmlman
:: $(patsubst $(MANPAGEDIR
)/%.xml
,$(HTMLDIR
)/manpages
/%.html
,$(MANPAGES
)) $(HTMLDIR
)/manpages
/index.html
68 html-single
:: $(patsubst %,$(HTMLDIR
)/%.html
,$(MAIN_DOCS
))
69 html
:: $(patsubst %,$(HTMLDIR
)/%/index.html
,$(MAIN_DOCS
)) $(HTMLDIR
)/index.html
70 htmlhelp
:: $(addprefix $(HTMLHELPDIR
)/,$(MAIN_DOCS
))
71 validate
:: $(addsuffix -validate
,$(MAIN_DOCS
))
76 .PHONY
: test check validate manpages
78 # Intermediate docbook docs
80 $(DOCBOOKDIR
)/%.xml
: %/index.xml xslt
/expand-sambadoc.xsl
$(XSLTPROC_DEPS
)
81 @echo
"Converting Samba-specific tags for $*..."
83 @
$(XSLTPROC
) --stringparam latex.imagebasedir
"$*/" --stringparam noreference
0 --xinclude
--output
$@ xslt
/expand-sambadoc.xsl
$<
85 $(DOCBOOKDIR
)/manpages
/%.xml
: $(MANPAGEDIR
)/%.xml xslt
/expand-sambadoc.xsl Makefile.settings
$(XSLTPROC_DEPS
)
87 $(XSLTPROC
) --xinclude
--stringparam noreference
0 --output
$@ xslt
/expand-sambadoc.xsl
$<
89 $(DOCBOOKDIR
)/manpages
/index.xml
: $(MANPAGES
) xslt
/manpage-summary.xsl
$(XSLTPROC_DEPS
)
91 echo
"<article><variablelist>" > $@
92 $(XSLTPROC
) xslt
/manpage-summary.xsl
$(MANPAGES
) >> $@
93 @echo
"</variablelist></article>" >> $@
96 $(HTMLDIR
)/index.html
: htmldocs.html
100 $(HTMLDIR
)/%/index.html
: $(DOCBOOKDIR
)/%.xml
$(HTMLDIR
)/%/samba.css xslt
/html-chunk.xsl
%-images-html-chunks
$(XSLTPROC_DEPS
)
102 $(XSLTPROC
) --stringparam base.
dir "$(HTMLDIR)/$*/" xslt
/html-chunk.xsl
$<
104 # Single large HTML files
105 $(OUTPUTDIR
)/%/samba.css
: xslt
/html
/samba.css
$(XSLTPROC_DEPS
)
109 $(patsubst %,$(HTMLDIR
)/%.html
,$(MAIN_DOCS
)): $(HTMLDIR
)/%.html
: %-images-html-single
111 $(HTMLDIR
)/%.html
: $(DOCBOOKDIR
)/%.xml
$(HTMLDIR
)/samba.css xslt
/html.xsl
$(XSLTPROC_DEPS
)
112 $(XSLTPROC
) --output
$@ xslt
/html.xsl
$<
115 %-attributions.xml
: $(XSLTPROC_DEPS
)
116 @echo
"Generating attributions file $@ from $*/"
117 @cp
-f templates
/attributions.xml
$@
118 @
$(XSLTPROC
) --xinclude
-o
$@ xslt
/generate-attributions.xsl
$*/index.xml
121 %.
tex: %/index.xml xslt
/latex.xsl
122 @echo
"Generating $@..."
124 @
$(DBLATEX
) $(DBLATEX_OPTIONS
) -t
tex -o
$@
$<
127 %.d
: $(DOCBOOKDIR
)/%.xml xslt
/generate-dependencies.xsl
$(XSLTPROC_DEPS
)
128 @echo
"Generating dependency file for $*"
129 @
$(XSLTPROC
) --novalid \
130 --stringparam target
"$*" \
131 -o
$@ xslt
/generate-dependencies.xsl
$<
132 @echo
"$*-images-latex-eps: \$$(addsuffix .eps, \$$($*-images-latex))" >> $@
135 @echo
"\$$(HTMLDIR)/%: $*/%" >> $@
136 @echo
" @mkdir -p \$$(@D)" >> $@
137 @echo
" @cp \$$< \$$@" >> $@
139 @echo
"\$$(HTMLDIR)/$*/%: $*/%" >> $@
140 @echo
" @mkdir -p \$$(@D)" >> $@
141 @echo
" @cp \$$< \$$@" >> $@
143 @echo
"\$$(HTMLHELPDIR)/$*/%: $*/%" >> $@
144 @echo
" @mkdir -p \$$(@D)" >> $@
145 @echo
" @cp \$$< \$$@" >> $@
147 @echo
"$*-images-html-single: \$$(addprefix \$$(HTMLDIR)/, \$$($*-images-html))" >> $@
148 @echo
"$*-images-html-chunks: \$$(addprefix \$$(HTMLDIR)/$*/, \$$($*-images-html))" >> $@
149 @echo
"$*-images-htmlhelp: \$$(addprefix \$$(HTMLHELPDIR)/$*/, \$$($*-images-html))" >> $@
152 ifneq ($(MAKECMDGOALS
),clobber)
153 -include $(addsuffix .d
,$(MAIN_DOCS
))
158 $(PDFDIR
)/%.pdf
: %/index.xml
$(PDFDIR
) xslt
/latex.xsl
%-images-latex-png
%-images-latex-pdf
159 $(DBLATEX
) $(DBLATEX_OPTIONS
) -I
$*/images
-t pdf
-o
$@
$<
162 $(PSDIR
)/%.ps
: %/index.xml
$(PSDIR
) xslt
/latex.xsl
%-images-latex-eps
163 $(DBLATEX
) $(DBLATEX_OPTIONS
) -I
$*/images
-t ps
-o
$@
$<
166 $(PNGTOPNM
) $< |
$(PNMTOPS
) > $@
168 $(HTMLHELPDIR
)/%: $(DOCBOOKDIR
)/%.xml
%-images-htmlhelp
$(XSLTPROC_DEPS
)
169 $(XSLTPROC
) --stringparam htmlhelp.chm
$*.chm \
170 --stringparam manifest.in.base.
dir "$@/" \
171 --stringparam base.
dir "$@/" \
172 http
://docbook.sourceforge.net
/release
/xsl
/current
/htmlhelp
/htmlhelp.xsl
$<
175 $(MANPAGEDIR
)/smb.conf
.5.xml
: parameters
177 # The phony parameters target exists in order to always create the
178 # the parameters xml files. Otherwise, when parameters.*.xml does not exist
179 # yet, the parameters are not generated when smb.conf.5.xml is newer than
180 # any smbdotconf/*/*.xml file ...
181 .PHONY
: parameters pathconf
183 parameters
: $(SMBDOTCONFDOC
)/parameters.
all.xml
185 pathconf
: build
/DTD
/samba.build.pathconfig
187 $(SMBDOTCONFDOC
)/parameters.
all.xml
: $(wildcard $(SMBDOTCONFDOC
)/*/*.xml
) $(SMBDOTCONFDOC
)/generate-file-list.sh
188 $(SMBDOTCONFDOC
)/generate-file-list.sh
$(SMBDOTCONFDOC
) > $@
190 build
/DTD
/samba.build.pathconfig
: generate-pathconf-entities.sh
191 .
/generate-pathconf-entities.sh
> $@
194 test -d
$@ || mkdir
$@
196 $(OUTPUTDIR
)/%: $(DOCBOOKDIR
)/%.xml xslt
/man.xsl
198 $(XSLTPROC
) --output
$@ xslt
/man.xsl
$<
200 # Individual smb.conf parameters
201 smb.conf-chunks
: $(patsubst $(SMBDOTCONFDOC
)/%.xml
,$(HTMLDIR
)/smb.conf
/%.html
,$(wildcard $(SMBDOTCONFDOC
)/*/*.xml
))
203 $(HTMLDIR
)/smb.conf
/%.html
: $(SMBDOTCONFDOC
)/%.xml
205 $(XSLTPROC
) --output
$@ xslt
/smb.conf-html.xsl
$<
207 # Validation verification
208 %-validate
: %/index.xml
209 cd
$(<D
) && $(XMLLINT
) --xinclude
--noent
--postvalid
--noout
$(<F
)
211 build
/catalog.xml
: build
/catalog.xml.in
212 sed
-e
"s|@abs_top_srcdir@|`pwd`|g;s|@abs_top_builddir@|`pwd`|g" < build
/catalog.xml.in
> build
/catalog.xml
215 xslt
/html.xsl
: xslt
/html-common.xsl
216 xslt
/html-chunk.xsl
: xslt
/html-common.xsl
218 xslt
/expand-sambadoc.xsl
:
219 xslt
/generate-attributions.xsl
:
222 distclean clobber:: clean
223 rm -f Makefile.settings config.status config.log
225 realdistclean
:: distclean
227 rm -rf autom4te.cache
230 # Always keep intermediate files if we can
232 .PHONY
: clean clobber release everything
all