2004-04-07 10:15:11 +00:00
#################################################################
2005-03-11 15:57:45 +00:00
# Makefile for Samba Documentation
2004-04-07 10:15:11 +00:00
# Authors:
# James Moore <jmoore@php.net>
# Gerald Carter <jerry@samba.org>
# Jelmer Vernooij <jelmer@samba.org>
2005-03-17 00:13:11 +00:00
i n c l u d e M a k e f i l e . s e t t i n g s
2004-04-07 10:15:11 +00:00
2018-01-04 16:19:13 +01:00
export XML_CATALOG_FILES := $( XML_CATALOG_FILES) /etc/xml/catalog $( shell pwd ) /build/catalog.xml
2004-06-20 12:43:16 +00:00
# Docs to build
2005-03-16 17:14:05 +00:00
MAIN_DOCS = $( patsubst %/index.xml,%,$( wildcard */index.xml) )
2017-06-26 09:46:18 +02:00
MANPAGES = $( sort $( wildcard $( MANPAGEDIR) /*.?.xml) )
2004-06-20 12:43:16 +00:00
2004-04-07 10:15:11 +00:00
# Lists of files to process
2012-09-03 21:49:25 +02:00
MANPAGES_PLUCKER = $( patsubst $( MANPAGEDIR) /%.xml,$( PLUCKERDIR) /%.pdb,$( MANPAGES) )
2009-05-01 15:31:14 +02:00
DBLATEX_OPTIONS = -p xslt/latex.xsl -i xslt/latex
2004-06-20 12:43:16 +00:00
2005-03-16 17:14:05 +00:00
DATETIME := $( shell date +%Y%m%d%H%M%S)
2018-01-04 16:35:12 +01:00
XSLTPROC_DEPS = build/catalog.xml build/DTD/samba.build.version
2006-12-27 01:30:39 +00:00
i f e q ( $( PROFILE ) , Y )
XSLTPROC += --profile --load-trace --timing
e n d i f
2005-01-29 20:05:52 +00:00
i f n d e f O U T P U T D I R
2005-03-17 00:13:11 +00:00
Makefile.settings : configure
2006-12-27 01:30:39 +00:00
./configure
2005-01-29 20:05:52 +00:00
2007-03-28 00:15:16 +00:00
configure : configure .ac
2006-12-27 01:30:39 +00:00
autoreconf
2005-01-29 20:05:52 +00:00
e n d i f
2004-04-23 14:23:36 +00:00
help :
2004-04-07 10:15:11 +00:00
@echo "Supported make targets:"
2004-06-20 12:43:16 +00:00
@echo " release - Build the docs needed for a Samba release"
@echo " all - Build all docs that can be build using the utilities found by configure"
@echo " everything - Build all of the above"
2012-09-03 21:49:25 +02:00
@echo " pdf,tex,ps,manpages,txt,pearson,htmlhelp - Build specific output format"
2005-03-11 21:33:28 +00:00
@echo " html - Build multi-file HTML versions"
@echo " html-single - Build single-file HTML versions"
2012-09-10 12:28:19 +02:00
@echo " htmlman - Build HTML version of manpages"
2004-06-20 12:43:16 +00:00
@echo " samples - Extract examples"
2009-05-02 01:10:20 +02:00
$(PDFDIR)/Samba3-ByExample.pdf $(PSDIR)/Samba3-ByExample.ps $(DOCBOOKDIR)/Samba3-ByExample.xml Samba3-ByExample.tex : $( wildcard Samba 3-ByExample /*.xml )
$(PDFDIR)/Samba3-HOWTO.pdf $(PSDIR)/Samba3-HOWTO.ps Samba3-HOWTO.tex $(DOCBOOKDIR)/Samba3-HOWTO.xml : $( wildcard Samba 3-HOWTO /*.xml ) Samba 3-HOWTO -attributions .xml
2012-09-03 21:49:25 +02:00
Samba3-HOWTO/manpages.xml : $( MANPAGEDIR ) /smb .conf .5.xml
2009-05-02 01:10:20 +02:00
$(PDFDIR)/Samba3-Developers-Guide.pdf $(PSDIR)/Samba3-Developers-Guide.ps $(DOCBOOKDIR)/Samba3-Developers-Guide.xml Samba3-Developers-Guide.tex : $( wildcard Samba 3-Developers -Guide /*.xml ) Samba 3-Developers -Guide -attributions .xml
2004-06-20 12:43:16 +00:00
# Pseudo targets
2008-05-16 15:46:36 +02:00
all :: $( TARGETS )
2012-09-10 12:28:19 +02:00
everything :: manpages pdf html -single html htmlman txt ps fo htmlhelp pearson
release :: manpages htmlman html pdf
2008-05-16 15:46:36 +02:00
clean ::
2007-06-06 13:43:17 +00:00
@echo "Cleaning up..."
rm -rf $( OUTPUTDIR) /* $( DOCBOOKDIR)
2009-05-02 00:39:49 +02:00
rm -f *-attributions.xml
2012-07-16 14:26:50 +02:00
rm -f $( patsubst %.svg,%.png,$( foreach DOC,$( MAIN_DOCS) ,$( $( DOC) -images-latex-dia) ) ) \
$( patsubst %.svg,%.pdf,$( foreach DOC,$( MAIN_DOCS) ,$( $( DOC) -images-latex-svg) ) ) \
$( patsubst %.svg,%.eps,$( foreach DOC,$( MAIN_DOCS) ,$( $( DOC) -images-latex-svg) ) ) \
$( patsubst %.svg,%.png,$( foreach DOC,$( MAIN_DOCS) ,$( $( DOC) -images-latex-svg) ) )
rm -f *-attributions.xml *.d *.tpt *.tex *.loc *.toc *.lof *.glo *.idx *.aux
rm -f *-images-html*
rm -f *-images-latex-* $( LATEX_FIGURES)
rm -f xslt/figures/*pdf
2007-06-06 13:43:17 +00:00
rm -f $( SMBDOTCONFDOC) /parameters.*.xml
2009-01-21 15:09:46 +01:00
rm -f build/catalog.xml
2004-04-07 10:15:11 +00:00
2004-06-20 12:43:16 +00:00
# Output format targets
2008-05-16 15:46:36 +02:00
pdf :: $( patsubst %,$ ( PDFDIR ) /%.pdf ,$ ( MAIN_DOCS ) )
ps :: $( patsubst %,$ ( PSDIR ) /%.ps ,$ ( MAIN_DOCS ) )
txt :: $( patsubst %,$ ( TXTDIR ) /%.txt ,$ ( MAIN_DOCS ) )
tex :: $( addsuffix .tex ,$ ( MAIN_DOCS ) )
texi :: $( patsubst %,$ ( TEXINFODIR ) /%.texi ,$ ( MAIN_DOCS ) )
texiinfo :: $( patsubst %,$ ( TEXINFODIR ) /%.info ,$ ( MAIN_DOCS ) )
2012-09-03 21:49:25 +02:00
manpages :: $( patsubst $ ( MANPAGEDIR ) /%.xml ,$ ( OUTPUTDIR ) /manpages /%,$ ( MANPAGES ) )
2008-05-16 15:46:36 +02:00
pearson :: $( PEARSONDIR ) /Samba 3-HOWTO .xml
pearson-verify :: $( PEARSONDIR ) /Samba 3-HOWTO .report .html
plucker :: $( patsubst %,$ ( PLUCKERDIR ) /%.pdb ,$ ( MAIN_DOCS ) )
2012-09-10 12:28:19 +02:00
htmlman :: $( patsubst $ ( MANPAGEDIR ) /%.xml ,$ ( HTMLDIR ) /manpages /%.html ,$ ( MANPAGES ) ) $( HTMLDIR ) /manpages /index .html
2008-05-16 15:46:36 +02:00
html-single :: $( patsubst %,$ ( HTMLDIR ) /%.html ,$ ( MAIN_DOCS ) )
html :: $( patsubst %,$ ( HTMLDIR ) /%/index .html ,$ ( MAIN_DOCS ) ) $( HTMLDIR ) /index .html
htmlhelp :: $( addprefix $ ( HTMLHELPDIR ) /,$ ( MAIN_DOCS ) )
validate :: $( addsuffix -validate ,$ ( MAIN_DOCS ) )
test :: validate
check :: validate
2012-09-10 01:05:34 +02:00
.PHONY : test check validate manpages
2004-04-07 10:15:11 +00:00
2004-06-20 12:43:16 +00:00
# Intermediate docbook docs
2005-03-29 19:24:12 +00:00
#
2018-01-04 16:35:12 +01:00
$(DOCBOOKDIR)/%.xml : %/index .xml xslt /expand -sambadoc .xsl $( XSLTPROC_DEPS )
2005-08-20 13:11:52 +00:00
@echo " Converting Samba-specific tags for $* ... "
2005-06-30 02:17:59 +00:00
@mkdir -p $( @D)
2008-05-16 15:31:54 +02:00
@$( XSLTPROC) --stringparam latex.imagebasedir " $* / " --stringparam noreference 0 --xinclude --output $@ xslt/expand-sambadoc.xsl $<
2004-04-07 10:15:11 +00:00
2018-01-04 16:35:12 +01:00
$(DOCBOOKDIR)/manpages/%.xml : $( MANPAGEDIR ) /%.xml xslt /expand -sambadoc .xsl Makefile .settings $( XSLTPROC_DEPS )
2005-06-30 02:17:59 +00:00
@mkdir -p $( @D)
2008-04-24 23:40:51 +04:00
$( XSLTPROC) --xinclude --stringparam noreference 0 --output $@ xslt/expand-sambadoc.xsl $<
2005-05-05 22:38:51 +00:00
2018-01-04 16:35:12 +01:00
$(DOCBOOKDIR)/manpages/index.xml : $( MANPAGES ) xslt /manpage -summary .xsl $( XSLTPROC_DEPS )
2005-06-30 02:17:59 +00:00
@mkdir -p $( @D)
2004-06-20 12:43:16 +00:00
echo "<article><variablelist>" > $@
2012-09-03 21:49:25 +02:00
$( XSLTPROC) xslt/manpage-summary.xsl $( MANPAGES) >> $@
2006-12-27 01:30:39 +00:00
@echo "</variablelist></article>" >> $@
2004-05-31 12:33:28 +00:00
2004-06-20 12:43:16 +00:00
# HTML docs
2004-06-26 15:43:54 +00:00
$(HTMLDIR)/index.html : htmldocs .html
2005-06-30 02:17:59 +00:00
@mkdir -p $( @D)
2004-05-31 12:33:28 +00:00
cp $< $@
2012-09-04 09:10:59 +10:00
2018-01-04 16:35:12 +01:00
$(HTMLDIR)/%/index.html : $( DOCBOOKDIR ) /%.xml $( HTMLDIR ) /%/samba .css xslt /html -chunk .xsl %-images -html -chunks $( XSLTPROC_DEPS )
2005-06-30 02:17:59 +00:00
@mkdir -p $( @D)
2004-06-20 12:43:16 +00:00
$( XSLTPROC) --stringparam base.dir " $( HTMLDIR) / $* / " xslt/html-chunk.xsl $<
2004-04-07 10:15:11 +00:00
2004-06-20 12:43:16 +00:00
# Single large HTML files
2018-01-04 16:35:12 +01:00
$(OUTPUTDIR)/%/samba.css : xslt /html /samba .css $( XSLTPROC_DEPS )
2005-06-30 02:17:59 +00:00
@mkdir -p $( @D)
2004-06-20 12:43:16 +00:00
cp $< $@
2004-04-07 10:15:11 +00:00
2012-07-16 14:26:50 +02:00
$(patsubst %,$(HTMLDIR)/%.html,$(MAIN_DOCS)) : $( HTMLDIR ) /%.html : %-images -html -single
2005-03-17 00:13:11 +00:00
2018-01-04 16:35:12 +01:00
$(HTMLDIR)/%.html : $( DOCBOOKDIR ) /%.xml $( HTMLDIR ) /samba .css xslt /html .xsl $( XSLTPROC_DEPS )
2004-06-20 12:43:16 +00:00
$( XSLTPROC) --output $@ xslt/html.xsl $<
2004-04-07 10:15:11 +00:00
2005-03-11 16:26:19 +00:00
# Attributions
2018-01-04 16:35:12 +01:00
%-attributions.xml : $( XSLTPROC_DEPS )
2005-06-30 02:17:59 +00:00
@echo " Generating attributions file $@ from $* / "
2007-06-06 13:43:17 +00:00
@cp -f templates/attributions.xml $@
2008-05-16 15:31:54 +02:00
@$( XSLTPROC) --xinclude -o $@ xslt/generate-attributions.xsl $* /index.xml
2004-04-07 10:15:11 +00:00
# Text files
2004-06-26 15:43:54 +00:00
$(TXTDIR)/%.txt : $( HTMLDIR ) /%.html
2005-06-30 02:17:59 +00:00
@mkdir -p $( @D)
2004-05-15 16:09:50 +00:00
$( HTML2TEXT) -nobs -style pretty -o $@ $<
2004-04-07 10:15:11 +00:00
# Tex files
2005-06-13 00:48:46 +00:00
%.tex : %/index .xml xslt /latex .xsl
2005-06-30 02:17:59 +00:00
@echo " Generating $@ ... "
@mkdir -p $( @D)
2009-05-01 15:31:14 +02:00
@$( DBLATEX) $( DBLATEX_OPTIONS) -t tex -o $@ $<
2004-04-07 10:15:11 +00:00
2012-07-16 14:26:50 +02:00
# Dependency files
2018-01-04 16:35:12 +01:00
%.d : $( DOCBOOKDIR ) /%.xml xslt /generate -dependencies .xsl $( XSLTPROC_DEPS )
2012-07-16 14:26:50 +02:00
@echo " Generating dependency file for $* "
@$( XSLTPROC) --novalid \
--stringparam txtbasedir " $( TXTDIR) / $* / " \
--stringparam target " $* " \
-o $@ xslt/generate-dependencies.xsl $<
@echo " $* -images-latex-svg = \$ $( wildcard \$ $( addsuffix .svg, \$ $( $* -images-latex) ) ) " >> $@
@echo " $* -images-latex-eps: \$ $( addsuffix .eps, \$ $( $* -images-latex) ) " >> $@
@echo " $* -images-latex-pdf: \$ $( patsubst %.svg, %.pdf, \$ $( $* -images-latex-svg) ) " >> $@
@echo " $* -images-latex-png: \$ $( filter-out \$ $( patsubst %.svg,%.png,\$ $( $* -images-latex-svg) ) , \$ $( addsuffix .png, \$ $( $* -images-latex) ) ) " >> $@
@echo >> $@
@echo " \$ $( HTMLDIR) /%: $* /% " >> $@
@echo " @mkdir -p \$ $( @D) " >> $@
@echo " @cp \$ $< \$ $@ " >> $@
@echo >> $@
@echo " \$ $( HTMLDIR) / $* /%: $* /% " >> $@
@echo " @mkdir -p \$ $( @D) " >> $@
@echo " @cp \$ $< \$ $@ " >> $@
@echo >> $@
@echo " \$ $( HTMLHELPDIR) / $* /%: $* /% " >> $@
@echo " @mkdir -p \$ $( @D) " >> $@
@echo " @cp \$ $< \$ $@ " >> $@
@echo >> $@
@echo " $* -images-html-single: \$ $( addprefix \$ $( HTMLDIR) /, \$ $( $* -images-html) ) " >> $@
@echo " $* -images-html-chunks: \$ $( addprefix \$ $( HTMLDIR) /$* /, \$ $( $* -images-html) ) " >> $@
@echo " $* -images-htmlhelp: \$ $( addprefix \$ $( HTMLHELPDIR) /$* /, \$ $( $* -images-html) ) " >> $@
i f d e f O U T P U T D I R
i f n e q ( $( MAKECMDGOALS ) , c l o b b e r )
- i n c l u d e $( addsuffix .d ,$ ( MAIN_DOCS ) )
e n d i f
e n d i f
2009-05-01 15:31:14 +02:00
# Adobe PDF files
2012-07-16 14:26:50 +02:00
$(PDFDIR)/%.pdf : %/index .xml $( PDFDIR ) xslt /latex .xsl %-images -latex -png %-images -latex -pdf
2009-05-01 15:31:14 +02:00
$( DBLATEX) $( DBLATEX_OPTIONS) -I $* /images -t pdf -o $@ $<
2004-04-07 10:15:11 +00:00
2009-05-01 17:20:01 +02:00
# PostScript files
2012-07-16 14:26:50 +02:00
$(PSDIR)/%.ps : %/index .xml $( PSDIR ) xslt /latex .xsl %-images -latex -eps
2009-05-01 17:20:01 +02:00
$( DBLATEX) $( DBLATEX_OPTIONS) -I $* /images -t ps -o $@ $<
2004-09-05 12:36:21 +00:00
2008-04-14 15:39:30 +00:00
%.eps : %.svg
2009-08-08 08:02:52 +03:00
$( INKSCAPE) -z -f $( abspath $<) --export-eps= $( abspath $@ )
2008-04-14 15:39:30 +00:00
%.png : %.svg
2009-08-08 08:02:52 +03:00
$( INKSCAPE) -z -f $( abspath $<) --export-png= $( abspath $@ )
2005-06-13 20:25:32 +00:00
2004-04-07 10:15:11 +00:00
%.eps : %.png
$( PNGTOPNM) $< | $( PNMTOPS) > $@
2012-10-02 14:53:38 +03:00
%.pdf : %.svg
$( INKSCAPE) -z -f $( abspath $<) --export-pdf= $( abspath $@ )
2018-01-04 16:35:12 +01:00
$(HTMLHELPDIR)/% : $( DOCBOOKDIR ) /%.xml %-images -htmlhelp $( XSLTPROC_DEPS )
2005-03-17 00:13:11 +00:00
$( XSLTPROC) --stringparam htmlhelp.chm $* .chm \
--stringparam manifest.in.base.dir " $@ / " \
--stringparam base.dir " $@ / " \
http://docbook.sourceforge.net/release/xsl/current/htmlhelp/htmlhelp.xsl $<
2004-04-26 22:46:47 +00:00
2004-06-20 12:43:16 +00:00
# Plucker docs
2004-12-07 16:54:57 +00:00
$(PLUCKERDIR)/%.pdb : $( HTMLDIR ) /%.html
2005-06-30 02:17:59 +00:00
@mkdir -p $( @D)
2005-03-11 15:57:45 +00:00
$( PLUCKERBUILD) -v -V 2 --stayonhost --zlib-compression -f $* -p $( PLUCKERDIR) file:$<
2004-04-07 10:15:11 +00:00
2005-03-11 16:26:19 +00:00
# Texinfo docs
$(TEXINFODIR)/%.texi : $( DOCBOOKDIR ) /%.xml
2005-06-30 02:17:59 +00:00
@mkdir -p $( @D)
2005-03-11 16:26:19 +00:00
cd $( @D) && $( DB2TEXI) $( shell pwd ) /$<
$(TEXINFODIR)/%.info : $( TEXINFODIR ) /%.texi
$( MAKEINFO) --no-validate --force -o $@ " $< "
2004-04-07 10:15:11 +00:00
# Manpages
2012-09-03 21:49:25 +02:00
$(MANPAGEDIR)/smb.conf.5.xml : parameters
2011-04-05 23:07:01 +02:00
# The phony parameters target exists in order to always create the
# the parameters xml files. Otherwise, when parameters.*.xml does not exist
# yet, the parameters are not generated when smb.conf.5.xml is newer than
# any smbdotconf/*/*.xml file ...
.PHONY : parameters
2014-01-14 12:35:25 +13:00
parameters : $( SMBDOTCONFDOC ) /parameters .all .xml
2004-04-07 10:15:11 +00:00
2005-05-14 15:18:37 +00:00
$(SMBDOTCONFDOC)/parameters.all.xml : $( wildcard $ ( SMBDOTCONFDOC ) /*/*.xml ) $( SMBDOTCONFDOC ) /generate -file -list .sh
2004-06-20 12:43:16 +00:00
$( SMBDOTCONFDOC) /generate-file-list.sh $( SMBDOTCONFDOC) > $@
2004-04-07 10:15:11 +00:00
2009-05-01 20:25:34 +02:00
$(OUTPUTDIR) :
test -d $@ || mkdir $@
2005-05-05 22:38:51 +00:00
$(OUTPUTDIR)/% : $( DOCBOOKDIR ) /%.xml xslt /man .xsl
2005-06-30 02:17:59 +00:00
@mkdir -p $( @D)
2004-04-07 10:15:11 +00:00
$( XSLTPROC) --output $@ xslt/man.xsl $<
2005-01-07 16:04:34 +00:00
# Individual smb.conf parameters
smb.conf-chunks : $( patsubst $ ( SMBDOTCONFDOC ) /%.xml ,$ ( HTMLDIR ) /smb .conf /%.html ,$ ( wildcard $ ( SMBDOTCONFDOC ) /*/*.xml ) )
2012-09-04 09:10:59 +10:00
2005-01-07 16:04:34 +00:00
$(HTMLDIR)/smb.conf/%.html : $( SMBDOTCONFDOC ) /%.xml
2005-06-30 02:17:59 +00:00
@mkdir -p $( @D)
2005-01-07 16:04:34 +00:00
$( XSLTPROC) --output $@ xslt/smb.conf-html.xsl $<
2004-06-20 12:43:16 +00:00
# Pearson compatible XML
2004-10-05 13:20:54 +00:00
$(PEARSONDIR)/%.xml : %/index .xml xslt /pearson .xsl
2005-06-30 02:17:59 +00:00
@mkdir -p $( @D)
2004-10-05 13:20:54 +00:00
$( XSLTPROC) --xinclude --output $@ xslt/sambadoc2pearson.xsl $<
2004-06-15 20:12:16 +00:00
2004-06-16 16:20:05 +00:00
$(PEARSONDIR)/%.report.html : $( PEARSONDIR ) /%.xml
2005-06-30 02:17:59 +00:00
@mkdir -p $( @D)
2005-03-12 22:34:38 +00:00
-$( XMLLINT) --valid --noout $< 2> $@
2004-06-16 16:20:05 +00:00
2004-06-20 12:43:16 +00:00
# Validation verification
2005-03-13 01:38:40 +00:00
%-validate : %/index .xml
2005-03-17 00:13:11 +00:00
cd $( <D) && $( XMLLINT) --xinclude --noent --postvalid --noout $( <F)
2004-05-20 20:33:00 +00:00
2018-01-04 16:12:28 +01:00
build/catalog.xml : build /catalog .xml .in
sed -e "s|@abs_top_srcdir@|`pwd`|g;s|@abs_top_builddir@|`pwd`|g" < build/catalog.xml.in > build/catalog.xml
2005-06-10 20:29:09 +00:00
samples : $( DOCBOOKDIR ) /Samba 3-HOWTO .xml xslt /extract -examples .xsl scripts /indent -smb .conf .pl
2009-05-01 04:34:23 +02:00
@mkdir -p examples
2004-06-20 12:43:16 +00:00
$( XSLTPROC) --xinclude xslt/extract-examples.xsl $< > /dev/null 2> examples/README
2004-04-07 10:15:11 +00:00
for I in examples/*.conf; do { ./scripts/indent-smb.conf.pl < $$ I > $$ I.tmp; mv $$ I.tmp $$ I; } done
2004-06-20 12:43:16 +00:00
# Archiving
2004-11-18 11:03:57 +00:00
archive : pdf
2005-06-30 02:17:59 +00:00
@mkdir -p $( ARCHIVEDIR)
2005-06-10 20:29:09 +00:00
cp $( PDFDIR) /Samba3-HOWTO.pdf $( ARCHIVEDIR) /TOSHARG-$( DATETIME) .pdf
cp $( PDFDIR) /Samba3-ByExample.pdf $( ARCHIVEDIR) /S3bE-$( DATETIME) .pdf
2004-06-20 12:43:16 +00:00
# XSL scripts
2005-06-13 10:23:53 +00:00
xslt/html.xsl : xslt /html -common .xsl
xslt/html-chunk.xsl : xslt /html -common .xsl
2012-07-16 14:26:50 +02:00
xslt/latex.xsl :
xslt/expand-sambadoc.xsl :
xslt/generate-attributions.xsl :
xslt/man.xsl :
xslt/pearson.xsl :
2004-07-01 18:27:46 +00:00
2008-05-21 17:55:20 +02:00
distclean clobber :: clean
2009-01-21 11:47:46 +01:00
rm -f Makefile.settings config.status config.log
2009-01-21 11:41:14 +01:00
realdistclean :: distclean
rm -f configure
2007-08-16 18:02:07 +00:00
rm -rf autom4te.cache
2009-05-02 00:39:49 +02:00
rm -rf output
2005-03-11 16:26:19 +00:00
# Always keep intermediate files if we can
2004-07-01 18:27:46 +00:00
.SECONDARY :
2008-05-27 18:40:14 +02:00
.PHONY : clean clobber archive release everything all