2004-04-07 14:15:11 +04:00
#################################################################
2005-03-11 18:57:45 +03:00
# Makefile for Samba Documentation
2004-04-07 14:15:11 +04:00
# Authors:
# James Moore <jmoore@php.net>
# Gerald Carter <jerry@samba.org>
# Jelmer Vernooij <jelmer@samba.org>
2005-03-17 03:13:11 +03: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 14:15:11 +04:00
2004-06-20 16:43:16 +04:00
# Docs to build
2005-03-16 20:14:05 +03:00
MAIN_DOCS = $( patsubst %/index.xml,%,$( wildcard */index.xml) )
2005-05-06 02:38:51 +04:00
MANPAGES3 = $( wildcard $( MANPAGEDIR3) /*.?.xml)
2004-06-20 16:43:16 +04:00
2004-04-07 14:15:11 +04:00
# Lists of files to process
2005-05-06 02:38:51 +04:00
MANPAGES_PLUCKER = $( patsubst $( MANPAGEDIR3) /%.xml,$( PLUCKERDIR) /%.pdb,$( MANPAGES3) )
2009-05-01 17:31:14 +04:00
DBLATEX_OPTIONS = -p xslt/latex.xsl -i xslt/latex
2004-06-20 16:43:16 +04:00
2005-03-16 20:14:05 +03:00
DATETIME := $( shell date +%Y%m%d%H%M%S)
2006-12-27 04:30:39 +03:00
i f e q ( $( PROFILE ) , Y )
XSLTPROC += --profile --load-trace --timing
e n d i f
2005-01-29 23:05:52 +03:00
i f n d e f O U T P U T D I R
2005-03-17 03:13:11 +03:00
Makefile.settings : configure
2006-12-27 04:30:39 +03:00
./configure
2005-01-29 23:05:52 +03:00
2007-03-28 04:15:16 +04:00
configure : configure .ac
2006-12-27 04:30:39 +03:00
autoreconf
2005-01-29 23:05:52 +03:00
e n d i f
2004-04-23 18:23:36 +04:00
help :
2004-04-07 14:15:11 +04:00
@echo "Supported make targets:"
2004-06-20 16:43:16 +04: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"
2009-05-01 23:09:13 +04:00
@echo " pdf,tex,ps,manpages3,txt,pearson,htmlhelp - Build specific output format"
2005-03-12 00:33:28 +03:00
@echo " html - Build multi-file HTML versions"
@echo " html-single - Build single-file HTML versions"
2005-06-12 20:46:09 +04:00
@echo " htmlman3 - Build HTML version of manpages"
2004-06-20 16:43:16 +04:00
@echo " undocumented - Output list of undocumented smb.conf options"
@echo " samples - Extract examples"
2009-05-02 03:10:20 +04: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
2005-06-11 00:29:09 +04:00
Samba3-HOWTO/manpages.xml : $( MANPAGEDIR 3) /smb .conf .5.xml
2009-05-02 03:10:20 +04: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
$(PDFDIR)/Samba4-HOWTO.pdf $(PSDIR)/Samba4-HOWTO.ps Samba4-HOWTO.tex $(DOCBOOKDIR)/Samba4-HOWTO.xml : $( filter -out Samba 4-HOWTO /index .xml ,$ ( wildcard Samba 4-HOWTO /*.xml ) ) Samba 4-HOWTO -attributions .xml
2004-06-20 16:43:16 +04:00
# Pseudo targets
2008-05-16 17:46:36 +04:00
all :: $( TARGETS )
everything :: manpages 3 pdf html -single html htmlman 3 txt ps fo htmlhelp pearson
release :: manpages 3 htmlman 3 html pdf
clean ::
2007-06-06 17:43:17 +04:00
@echo "Cleaning up..."
rm -rf $( OUTPUTDIR) /* $( DOCBOOKDIR)
2009-05-02 01:50:49 +04:00
rm -f $( patsubst %.svg,%.png,$( wildcard */images/*.svg) ) \
$( patsubst %.svg,%.eps,$( wildcard */images/*.svg) ) \
$( patsubst %.png,%.eps,$( wildcard */images/*.png) )
2009-05-02 02:39:49 +04:00
rm -f *-attributions.xml
2007-06-06 17:43:17 +04:00
rm -f $( SMBDOTCONFDOC) /parameters.*.xml
2009-01-21 17:09:46 +03:00
rm -f build/catalog.xml
2004-04-07 14:15:11 +04:00
2004-06-20 16:43:16 +04:00
# Output format targets
2008-05-16 17:46:36 +04: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 ) )
manpages3 :: $( patsubst $ ( MANPAGEDIR 3) /%.xml ,$ ( OUTPUTDIR ) /manpages -3/%,$ ( MANPAGES 3) )
pearson :: $( PEARSONDIR ) /Samba 3-HOWTO .xml
pearson-verify :: $( PEARSONDIR ) /Samba 3-HOWTO .report .html
plucker :: $( patsubst %,$ ( PLUCKERDIR ) /%.pdb ,$ ( MAIN_DOCS ) )
htmlman3 :: $( patsubst $ ( MANPAGEDIR 3) /%.xml ,$ ( HTMLDIR ) /manpages -3/%.html ,$ ( MANPAGES 3) ) $( HTMLDIR ) /manpages -3/index .html
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
.PHONY : test check validate
2004-04-07 14:15:11 +04:00
2004-06-20 16:43:16 +04:00
# Intermediate docbook docs
2005-03-29 23:24:12 +04:00
#
2004-06-26 19:43:54 +04:00
$(DOCBOOKDIR)/%.xml : %/index .xml xslt /expand -sambadoc .xsl
2005-08-20 17:11:52 +04:00
@echo " Converting Samba-specific tags for $* ... "
2005-06-30 06:17:59 +04:00
@mkdir -p $( @D)
2008-05-16 17:31:54 +04:00
@$( XSLTPROC) --stringparam latex.imagebasedir " $* / " --stringparam noreference 0 --xinclude --output $@ xslt/expand-sambadoc.xsl $<
2004-04-07 14:15:11 +04:00
2005-05-06 02:38:51 +04:00
$(DOCBOOKDIR)/manpages-3/%.xml : $( MANPAGEDIR 3) /%.xml xslt /expand -sambadoc .xsl
2005-06-30 06:17:59 +04:00
@mkdir -p $( @D)
2008-04-24 23:40:51 +04:00
$( XSLTPROC) --xinclude --stringparam noreference 0 --output $@ xslt/expand-sambadoc.xsl $<
2005-05-06 02:38:51 +04:00
2005-05-06 05:39:51 +04:00
$(DOCBOOKDIR)/manpages-3/index.xml : $( MANPAGES 3) xslt /manpage -summary .xsl
2005-06-30 06:17:59 +04:00
@mkdir -p $( @D)
2004-06-20 16:43:16 +04:00
echo "<article><variablelist>" > $@
2005-05-06 05:39:51 +04:00
$( XSLTPROC) xslt/manpage-summary.xsl $( MANPAGES3) >> $@
2006-12-27 04:30:39 +03:00
@echo "</variablelist></article>" >> $@
2004-05-31 16:33:28 +04:00
2004-06-20 16:43:16 +04:00
# HTML docs
2004-06-26 19:43:54 +04:00
$(HTMLDIR)/index.html : htmldocs .html
2005-06-30 06:17:59 +04:00
@mkdir -p $( @D)
2004-05-31 16:33:28 +04:00
cp $< $@
2004-04-27 02:46:47 +04:00
2009-05-02 01:50:49 +04:00
$(HTMLDIR)/%/index.html : $( DOCBOOKDIR ) /%.xml $( HTMLDIR ) /%/samba .css xslt /html -chunk .xsl
2005-06-30 06:17:59 +04:00
@mkdir -p $( @D)
2004-06-20 16:43:16 +04:00
$( XSLTPROC) --stringparam base.dir " $( HTMLDIR) / $* / " xslt/html-chunk.xsl $<
2004-04-07 14:15:11 +04:00
2004-06-20 16:43:16 +04:00
# Single large HTML files
$(OUTPUTDIR)/%/samba.css : xslt /html /samba .css
2005-06-30 06:17:59 +04:00
@mkdir -p $( @D)
2004-06-20 16:43:16 +04:00
cp $< $@
2004-04-07 14:15:11 +04:00
2009-05-02 01:50:49 +04:00
$(patsubst %,$(HTMLDIR)/%.html,$(MAIN_DOCS)) : $( HTMLDIR ) /%.html : %-images -png
d e f i n e I M A G E S _ T E M P L A T E
$(1)-images-png :: $$( patsubst %.svg ,%.png ,$ $ ( wildcard $ ( 1) /images /*.svg ) ) ;
$(1)-images-eps :: $$( patsubst %.svg ,%.eps ,$ $ ( wildcard $ ( 1) /images /*.svg ) ) ;
$(1)-images-eps :: $$( patsubst %.png ,%.eps ,$ $ ( wildcard $ ( 1) /images /*.png ) ) ;
e n d e f
$( eval $ ( foreach DOC , $ ( MAIN_DOCS ) ,$ ( call IMAGES_TEMPLATE ,$ ( DOC ) ) ) )
2005-03-17 03:13:11 +03:00
2004-07-10 22:10:36 +04:00
$(HTMLDIR)/%.html : $( DOCBOOKDIR ) /%.xml $( HTMLDIR ) /samba .css xslt /html .xsl
2004-06-20 16:43:16 +04:00
$( XSLTPROC) --output $@ xslt/html.xsl $<
2004-04-07 14:15:11 +04:00
2005-03-11 19:26:19 +03:00
# Attributions
2004-06-20 16:43:16 +04:00
%-attributions.xml :
2005-06-30 06:17:59 +04:00
@echo " Generating attributions file $@ from $* / "
2007-06-06 17:43:17 +04:00
@cp -f templates/attributions.xml $@
2008-05-16 17:31:54 +04:00
@$( XSLTPROC) --xinclude -o $@ xslt/generate-attributions.xsl $* /index.xml
2004-04-07 14:15:11 +04:00
# Text files
2004-06-26 19:43:54 +04:00
$(TXTDIR)/%.txt : $( HTMLDIR ) /%.html
2005-06-30 06:17:59 +04:00
@mkdir -p $( @D)
2004-05-15 20:09:50 +04:00
$( HTML2TEXT) -nobs -style pretty -o $@ $<
2004-04-07 14:15:11 +04:00
# Tex files
2005-06-13 04:48:46 +04:00
%.tex : %/index .xml xslt /latex .xsl
2005-06-30 06:17:59 +04:00
@echo " Generating $@ ... "
@mkdir -p $( @D)
2009-05-01 17:31:14 +04:00
@$( DBLATEX) $( DBLATEX_OPTIONS) -t tex -o $@ $<
2004-04-07 14:15:11 +04:00
2009-05-01 17:31:14 +04:00
# Adobe PDF files
2009-05-02 01:50:49 +04:00
$(PDFDIR)/%.pdf : %/index .xml $( PDFDIR ) xslt /latex .xsl %-images -png
2009-05-01 17:31:14 +04:00
$( DBLATEX) $( DBLATEX_OPTIONS) -I $* /images -t pdf -o $@ $<
2004-04-07 14:15:11 +04:00
2009-05-01 19:20:01 +04:00
# PostScript files
2009-05-02 01:50:49 +04:00
$(PSDIR)/%.ps : %/index .xml $( PSDIR ) xslt /latex .xsl %-images -eps
2009-05-01 19:20:01 +04:00
$( DBLATEX) $( DBLATEX_OPTIONS) -I $* /images -t ps -o $@ $<
2004-09-05 16:36:21 +04:00
2008-04-14 19:39:30 +04:00
%.eps : %.svg
2009-08-08 09:02:52 +04:00
$( INKSCAPE) -z -f $( abspath $<) --export-eps= $( abspath $@ )
2008-04-14 19:39:30 +04:00
%.png : %.svg
2009-08-08 09:02:52 +04:00
$( INKSCAPE) -z -f $( abspath $<) --export-png= $( abspath $@ )
2005-06-14 00:25:32 +04:00
2004-04-07 14:15:11 +04:00
%.eps : %.png
$( PNGTOPNM) $< | $( PNMTOPS) > $@
2009-05-02 01:50:49 +04:00
$(HTMLHELPDIR)/% : $( DOCBOOKDIR ) /%.xml %-images -png
2005-03-17 03:13:11 +03: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-27 02:46:47 +04:00
2004-06-20 16:43:16 +04:00
# Plucker docs
2004-12-07 19:54:57 +03:00
$(PLUCKERDIR)/%.pdb : $( HTMLDIR ) /%.html
2005-06-30 06:17:59 +04:00
@mkdir -p $( @D)
2005-03-11 18:57:45 +03:00
$( PLUCKERBUILD) -v -V 2 --stayonhost --zlib-compression -f $* -p $( PLUCKERDIR) file:$<
2004-04-07 14:15:11 +04:00
2005-03-11 19:26:19 +03:00
# Texinfo docs
$(TEXINFODIR)/%.texi : $( DOCBOOKDIR ) /%.xml
2005-06-30 06:17:59 +04:00
@mkdir -p $( @D)
2005-03-11 19:26:19 +03:00
cd $( @D) && $( DB2TEXI) $( shell pwd ) /$<
$(TEXINFODIR)/%.info : $( TEXINFODIR ) /%.texi
$( MAKEINFO) --no-validate --force -o $@ " $< "
2004-04-07 14:15:11 +04:00
# Manpages
2011-04-06 01:07:01 +04:00
$(MANPAGEDIR3)/smb.conf.5.xml : parameters
# 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
parameters : $( SMBDOTCONFDOC ) /parameters .all .xml $( SMBDOTCONFDOC ) /parameters .service .xml $( SMBDOTCONFDOC ) /parameters .global .xml
2004-04-07 14:15:11 +04:00
2005-05-14 19:18:37 +04:00
$(SMBDOTCONFDOC)/parameters.all.xml : $( wildcard $ ( SMBDOTCONFDOC ) /*/*.xml ) $( SMBDOTCONFDOC ) /generate -file -list .sh
2004-06-20 16:43:16 +04:00
$( SMBDOTCONFDOC) /generate-file-list.sh $( SMBDOTCONFDOC) > $@
2004-04-07 14:15:11 +04:00
2004-06-20 16:43:16 +04:00
$(SMBDOTCONFDOC)/parameters.global.xml : $( SMBDOTCONFDOC ) /parameters .all .xml $( SMBDOTCONFDOC ) /generate -context .xsl
2005-06-30 06:17:59 +04:00
@echo "Generating list of global smb.conf options"
2006-12-27 04:30:39 +03:00
$( XSLTPROC) --xinclude --param smb.context "'G'" --output $( SMBDOTCONFDOC) /parameters.global.xml $( SMBDOTCONFDOC) /generate-context.xsl $<
2004-04-07 14:15:11 +04:00
2004-06-20 16:43:16 +04:00
$(SMBDOTCONFDOC)/parameters.service.xml : $( SMBDOTCONFDOC ) /parameters .all .xml $( SMBDOTCONFDOC ) /generate -context .xsl
2005-06-30 06:17:59 +04:00
@echo "Generating list of share-mode smb.conf options"
2006-12-27 04:30:39 +03:00
$( XSLTPROC) --xinclude --param smb.context "'S'" --output $( SMBDOTCONFDOC) /parameters.service.xml $( SMBDOTCONFDOC) /generate-context.xsl $<
2004-04-07 14:15:11 +04:00
2009-05-01 22:25:34 +04:00
$(OUTPUTDIR) :
test -d $@ || mkdir $@
2005-05-06 02:38:51 +04:00
$(OUTPUTDIR)/% : $( DOCBOOKDIR ) /%.xml xslt /man .xsl
2005-06-30 06:17:59 +04:00
@mkdir -p $( @D)
2004-04-07 14:15:11 +04:00
$( XSLTPROC) --output $@ xslt/man.xsl $<
2005-01-07 19:04:34 +03:00
# Individual smb.conf parameters
smb.conf-chunks : $( patsubst $ ( SMBDOTCONFDOC ) /%.xml ,$ ( HTMLDIR ) /smb .conf /%.html ,$ ( wildcard $ ( SMBDOTCONFDOC ) /*/*.xml ) )
$(HTMLDIR)/smb.conf/%.html : $( SMBDOTCONFDOC ) /%.xml
2005-06-30 06:17:59 +04:00
@mkdir -p $( @D)
2005-01-07 19:04:34 +03:00
$( XSLTPROC) --output $@ xslt/smb.conf-html.xsl $<
2004-06-20 16:43:16 +04:00
# Pearson compatible XML
2004-10-05 17:20:54 +04:00
$(PEARSONDIR)/%.xml : %/index .xml xslt /pearson .xsl
2005-06-30 06:17:59 +04:00
@mkdir -p $( @D)
2004-10-05 17:20:54 +04:00
$( XSLTPROC) --xinclude --output $@ xslt/sambadoc2pearson.xsl $<
2004-06-16 00:12:16 +04:00
2004-06-16 20:20:05 +04:00
$(PEARSONDIR)/%.report.html : $( PEARSONDIR ) /%.xml
2005-06-30 06:17:59 +04:00
@mkdir -p $( @D)
2005-03-13 01:34:38 +03:00
-$( XMLLINT) --valid --noout $< 2> $@
2004-06-16 20:20:05 +04:00
2004-06-20 16:43:16 +04:00
# Validation verification
2005-03-13 04:38:40 +03:00
%-validate : %/index .xml
2005-03-17 03:13:11 +03:00
cd $( <D) && $( XMLLINT) --xinclude --noent --postvalid --noout $( <F)
2004-05-21 00:33:00 +04:00
2004-04-07 14:15:11 +04:00
# Find undocumented parameters
2004-06-20 16:43:16 +04:00
undocumented : $( SMBDOTCONFDOC ) /parameters .all .xml scripts /find_missing_doc .pl scripts /find_missing_manpages .pl
2006-12-27 04:30:39 +03:00
$( PERL) scripts/find_missing_doc.pl $( SRCDIR)
$( PERL) scripts/find_missing_manpages.pl $( SRCDIR)
2004-04-07 14:15:11 +04:00
2005-06-11 00:29:09 +04:00
samples : $( DOCBOOKDIR ) /Samba 3-HOWTO .xml xslt /extract -examples .xsl scripts /indent -smb .conf .pl
2009-05-01 06:34:23 +04:00
@mkdir -p examples
2004-06-20 16:43:16 +04:00
$( XSLTPROC) --xinclude xslt/extract-examples.xsl $< > /dev/null 2> examples/README
2004-04-07 14:15:11 +04:00
for I in examples/*.conf; do { ./scripts/indent-smb.conf.pl < $$ I > $$ I.tmp; mv $$ I.tmp $$ I; } done
2004-06-20 16:43:16 +04:00
# Archiving
2004-11-18 14:03:57 +03:00
archive : pdf
2005-06-30 06:17:59 +04:00
@mkdir -p $( ARCHIVEDIR)
2005-06-11 00:29:09 +04:00
cp $( PDFDIR) /Samba3-HOWTO.pdf $( ARCHIVEDIR) /TOSHARG-$( DATETIME) .pdf
cp $( PDFDIR) /Samba3-ByExample.pdf $( ARCHIVEDIR) /S3bE-$( DATETIME) .pdf
2004-06-20 16:43:16 +04:00
# XSL scripts
2005-06-13 14:23:53 +04:00
xslt/html.xsl : xslt /html -common .xsl
xslt/html-chunk.xsl : xslt /html -common .xsl
2004-07-01 22:27:46 +04:00
2008-05-21 19:55:20 +04:00
distclean clobber :: clean
2009-01-21 13:47:46 +03:00
rm -f Makefile.settings config.status config.log
2009-01-21 13:41:14 +03:00
realdistclean :: distclean
rm -f configure
2007-08-16 22:02:07 +04:00
rm -rf autom4te.cache
2009-05-02 02:39:49 +04:00
rm -rf output
2005-03-11 19:26:19 +03:00
# Always keep intermediate files if we can
2004-07-01 22:27:46 +04:00
.SECONDARY :
2008-05-27 20:40:14 +04:00
.PHONY : clean clobber archive release everything all