2004-04-07 14:15:11 +04:00
#################################################################
# Makefile.in for Samba Documentation
# Authors:
# James Moore <jmoore@php.net>
# Gerald Carter <jerry@samba.org>
# Jelmer Vernooij <jelmer@samba.org>
# Programs
XSLTPROC = @XSLTPROC@
2004-05-21 00:33:00 +04:00
XMLLINT = @XMLLINT@
2004-04-07 14:15:11 +04:00
DVIPS = @DVIPS@
PNGTOPNM = @PNGTOPNM@
EPSTOPNM = @EPSTOPNM@
PNMTOPNG = @PNMTOPNG@
2004-09-05 16:36:21 +04:00
DIA = @DIA@
2004-04-07 14:15:11 +04:00
PNMTOPS = @PNMTOPS@
2004-05-15 20:09:50 +04:00
HTML2TEXT = @HTML2TEXT@
2004-04-07 14:15:11 +04:00
PLUCKERBUILD = @PLUCKERBUILD@
2004-07-10 22:10:36 +04:00
COPY_IMAGES = ./scripts/copy-images.sh
2004-06-12 17:15:38 +04:00
THUMBPDF = @THUMBPDF@
2004-06-13 01:10:00 +04:00
PDFLATEX = TEXINPUTS = xslt/latex:.: @PDFLATEX@ --file-line-error-style
LATEX = TEXINPUTS = xslt/latex:.: @LATEX@ --file-line-error-style
2004-04-07 14:15:11 +04:00
RM = @RM@
i f n d e f D E B U G _ L A T E X
PDFLATEX += --interaction nonstopmode
LATEX += --interaction nonstopmode
e n d i f
# Paths
2004-06-14 17:47:11 +04:00
OUTPUTDIR = output
2004-11-18 14:03:57 +03:00
ARCHIVEDIR = archive
2004-05-15 20:36:15 +04:00
SRCDIR = @SAMBASOURCEDIR@
2004-04-09 02:19:02 +04:00
MANDIR = $( OUTPUTDIR) /manpages
2004-04-07 14:15:11 +04:00
EPSTOPDF = @EPSTOPDF@
2004-06-14 17:47:11 +04:00
MANPAGEDIR = manpages
2004-04-07 14:15:11 +04:00
MAKEINDEX = @MAKEINDEX@
2004-06-14 17:47:11 +04:00
EXAMPLESDIR = examples
SMBDOTCONFDOC = smbdotconf
2004-06-20 16:43:16 +04:00
DOCBOOKDIR = tmp
2004-04-07 14:15:11 +04:00
PSDIR = $( OUTPUTDIR)
PDFDIR = $( OUTPUTDIR)
DVIDIR = $( OUTPUTDIR)
2004-06-14 17:47:11 +04:00
FODIR = $( OUTPUTDIR)
HTMLHELPDIR = $( OUTPUTDIR) /htmlhelp
2004-05-21 00:33:00 +04:00
VALIDATEDIR = $( OUTPUTDIR) /validate
2004-06-16 00:12:16 +04:00
PEARSONDIR = $( OUTPUTDIR) /pearson
2004-04-07 14:15:11 +04:00
TXTDIR = $( OUTPUTDIR) /textdocs
HTMLDIR = $( OUTPUTDIR) /htmldocs
PLUCKERDIR = $( OUTPUTDIR) /plucker
2004-06-20 16:43:16 +04:00
# Docs to build
MAIN_DOCS = $( patsubst %/index.xml,$( DOCBOOKDIR) /%.xml,$( wildcard */index.xml) )
MANPAGES = $( wildcard $( MANPAGEDIR) /*.?.xml)
2004-04-07 14:15:11 +04:00
# Lists of files to process
LATEX_FIGURES = xslt/figures/caution.pdf xslt/figures/important.pdf xslt/figures/note.pdf xslt/figures/tip.pdf xslt/figures/warning.pdf
2004-12-07 19:54:57 +03:00
MANPAGES_PLUCKER = $( patsubst $( MANPAGEDIR) /%.xml,$( PLUCKERDIR) /%.pdb,$( MANPAGES) )
2004-06-20 16:43:16 +04:00
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"
@echo " pdf,tex,dvi,ps,manpages,txt,pearson,fo,htmlhelp - Build specific output format"
@echo " html - Build multi-file HTML version of HOWTO Collection, Guide and Dev-Guide"
@echo " html-single - Build single-file HTML version of HOWTO Collection, Guide and Dev-Guide"
@echo " htmlman - Build HTML version of manpages"
@echo " undocumented - Output list of undocumented smb.conf options"
@echo " samples - Extract examples"
@echo " files - Extract other files"
Samba-Guide/index.xml : $( subst Samba -Guide /index .xml ,,$ ( wildcard Samba -Guide /*.xml ) )
Samba-HOWTO-Collection/index.xml : $( subst Samba -HOWTO -Collection /index .xml ,,$ ( wildcard Samba -HOWTO -Collection /*.xml ) ) Samba -HOWTO -Collection -attributions .xml
Samba-Developers-Guide/index.xml : $( subst Samba -Developers -Guide /index .xml ,,$ ( wildcard Samba -Developers -Guide /*.xml ) ) Samba -Developers -Guide -attributions .xml
# Pseudo targets
2004-04-23 18:23:36 +04:00
all : @TARGETS @
2004-06-20 16:43:16 +04:00
everything : manpages pdf html -single html htmlman txt ps fo htmlhelp pearson verify
2004-07-08 20:03:02 +04:00
release : manpages htmlman html pdf
2004-04-07 14:15:11 +04:00
2004-06-20 16:43:16 +04:00
# Output format targets
pdf : $( patsubst $ ( DOCBOOKDIR ) /%.xml ,$ ( PDFDIR ) /%.pdf ,$ ( MAIN_DOCS ) )
dvi : $( patsubst $ ( DOCBOOKDIR ) /%.xml ,$ ( DVIDIR ) /%.dvi ,$ ( MAIN_DOCS ) )
ps : $( patsubst $ ( DOCBOOKDIR ) /%.xml ,$ ( PSDIR ) /%.ps ,$ ( MAIN_DOCS ) )
txt : $( patsubst $ ( DOCBOOKDIR ) /%.xml ,$ ( TXTDIR ) /%.txt ,$ ( MAIN_DOCS ) )
fo : $( patsubst $ ( DOCBOOKDIR ) /%.xml ,$ ( FODIR ) /%.fo ,$ ( MAIN_DOCS ) )
tex : $( patsubst $ ( DOCBOOKDIR ) /%.xml ,%.tex ,$ ( MAIN_DOCS ) )
manpages : $( patsubst $ ( MANPAGEDIR ) /%.xml ,$ ( MANDIR ) /%,$ ( MANPAGES ) )
pearson : $( PEARSONDIR ) /Samba -HOWTO -Collection .xml
pearson-verify : $( PEARSONDIR ) /Samba -HOWTO -Collection .report .html
plucker : $( patsubst $ ( DOCBOOKDIR ) /%.xml ,$ ( PLUCKERDIR ) /%.pdb ,$ ( MAIN_DOCS ) )
htmlman : $( patsubst $ ( MANPAGEDIR ) /%.xml ,$ ( HTMLDIR ) /%.html ,$ ( MANPAGES ) ) $( HTMLDIR ) /manpages .html
html-single : $( patsubst $ ( DOCBOOKDIR ) /%.xml ,$ ( HTMLDIR ) /%.html ,$ ( MAIN_DOCS ) )
html : $( patsubst $ ( DOCBOOKDIR ) /%.xml ,$ ( HTMLDIR ) /%/index .html ,$ ( MAIN_DOCS ) ) $( HTMLDIR ) /index .html
htmlhelp : $( patsubst $ ( DOCBOOKDIR ) /%.xml ,$ ( HTMLHELPDIR ) /%,$ ( MAIN_DOCS ) )
2004-04-07 14:15:11 +04:00
2004-06-20 16:43:16 +04:00
# Intermediate docbook docs
2004-04-07 14:15:11 +04:00
2004-06-26 19:43:54 +04:00
$(DOCBOOKDIR)/%.xml : %/index .xml xslt /expand -sambadoc .xsl
mkdir -p $( @D)
2004-07-10 22:10:36 +04:00
$( XSLTPROC) --stringparam latex.imagebasedir " $* / " --stringparam noreference 1 --xinclude --output $@ xslt/expand-sambadoc.xsl $<
2004-04-07 14:15:11 +04:00
2004-06-26 19:43:54 +04:00
$(DOCBOOKDIR)/%.xml : $( MANPAGEDIR ) /%.xml xslt /expand -sambadoc .xsl
mkdir -p $( @D)
2004-07-14 02:47:11 +04:00
$( XSLTPROC) --xinclude --stringparam latex.imagebasedir " $* / " --stringparam noreference 1 --output $@ xslt/expand-sambadoc.xsl $<
2004-04-07 14:15:11 +04:00
2004-12-07 19:54:57 +03:00
$(DOCBOOKDIR)/manpages.xml : $( MANPAGES ) xslt /manpage -summary .xsl
2004-06-26 19:43:54 +04:00
mkdir -p $( @D)
2004-06-20 16:43:16 +04:00
echo "<article><variablelist>" > $@
2004-12-07 19:54:57 +03:00
for I in $( MANPAGES) ; do $( XSLTPROC) xslt/manpage-summary.xsl $$ I >> $@ ; done
2004-06-20 16:43:16 +04:00
echo "</variablelist></article>" >> $@
2004-05-31 16:33:28 +04:00
2004-06-20 16:43:16 +04:00
# HTML docs
2004-06-15 01:25:16 +04:00
2004-06-26 19:43:54 +04:00
$(HTMLDIR)/index.html : htmldocs .html
mkdir -p $( @D)
2004-05-31 16:33:28 +04:00
cp $< $@
2004-04-27 02:46:47 +04:00
2004-06-26 19:43:54 +04:00
$(HTMLDIR)/%/index.html : $( DOCBOOKDIR ) /%.xml $( HTMLDIR ) /%/samba .css xslt /html -chunk .xsl
mkdir -p $( @D)
2004-06-20 16:43:16 +04:00
$( XSLTPROC) --stringparam base.dir " $( HTMLDIR) / $* / " xslt/html-chunk.xsl $<
2004-07-10 22:10:36 +04:00
-mkdir $( @D) /images
$( COPY_IMAGES) html $( DOCBOOKDIR) /$* .xml $* $( @D)
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
2004-06-26 19:43:54 +04:00
mkdir -p $( @D)
2004-06-20 16:43:16 +04:00
cp $< $@
2004-04-07 14:15:11 +04:00
2004-07-10 22:10:36 +04:00
$(HTMLDIR)/%.html : $( DOCBOOKDIR ) /%.xml $( HTMLDIR ) /samba .css xslt /html .xsl
mkdir -p $( @D) /images
$( COPY_IMAGES) html $( DOCBOOKDIR) /$* .xml $* $( @D)
2004-06-20 16:43:16 +04:00
$( XSLTPROC) --output $@ xslt/html.xsl $<
2004-04-07 14:15:11 +04:00
2004-06-20 16:43:16 +04:00
%-attributions.xml :
echo "<para/>" > $@
$( XSLTPROC) --xinclude xslt/generate-attributions.xsl $* /index.xml > $@
2004-04-07 14:15:11 +04:00
2004-11-07 05:16:31 +03:00
clobber : clean
rm Makefile settings.xsl config.status config.log configure
2004-04-07 14:15:11 +04:00
clean :
2004-06-20 16:43:16 +04:00
rm -rf $( OUTPUTDIR) /* $( DOCBOOKDIR)
rm -f *.xml
2004-04-07 14:15:11 +04:00
rm -f xslt/figures/*pdf
2004-06-20 16:43:16 +04:00
rm -f $( SMBDOTCONFDOC) /parameters.*.xml
rm -f $( patsubst $( DOCBOOKDIR) /%.xml,%.*,$( MAIN_DOCS) )
2004-04-07 14:15:11 +04:00
# Text files
2004-06-26 19:43:54 +04:00
$(TXTDIR)/%.txt : $( HTMLDIR ) /%.html
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
2004-06-20 16:43:16 +04:00
%.tex : $( DOCBOOKDIR ) /%.xml xslt /latex .xsl
2004-06-26 19:43:54 +04:00
mkdir -p $( @D)
2004-04-07 14:15:11 +04:00
$( XSLTPROC) --output $@ xslt/latex.xsl $<
latexfigures : $( LATEX_FIGURES )
2004-06-12 17:15:38 +04:00
2004-06-26 19:43:54 +04:00
$(PDFDIR)/%.pdf : %.pdf
mkdir -p $( @D)
cp $< $@
2004-09-04 17:13:48 +04:00
%.idx : %.tex latexfigures
2004-07-01 22:27:46 +04:00
-$( PDFLATEX) $<
2004-09-04 17:13:48 +04:00
%.ind : %.idx
$( MAKEINDEX) $<
# Adobe PDF files
%.pdf : %.tex %.ind latexfigures
2004-09-05 16:36:21 +04:00
$( MAKE) $( shell $( XSLTPROC) --stringparam prepend "" --stringparam append ".png" --stringparam role latex xslt/find-image-dependencies.xsl $( DOCBOOKDIR) /$* .xml)
2004-04-07 14:15:11 +04:00
-$( PDFLATEX) $<
2004-06-20 16:43:16 +04:00
$( THUMBPDF) $* .pdf
2004-04-07 14:15:11 +04:00
-$( PDFLATEX) $<
# DVI files
2004-06-26 19:43:54 +04:00
$(DVIDIR)/%.dvi : %.dvi
mkdir -p $( @D)
cp $< $@
2004-07-31 02:21:25 +04:00
%.dvi : %.tex %.idx
2004-07-10 22:10:36 +04:00
$( MAKE) $( shell $( XSLTPROC) --stringparam prepend "" --stringparam append ".eps" --stringparam role latex xslt/find-image-dependencies.xsl $( DOCBOOKDIR) /$* .xml)
2004-07-01 22:27:46 +04:00
-$( LATEX) $<
2004-09-05 16:36:21 +04:00
%.png : %.dia
$( DIA) -e $@ $<
2004-04-07 14:15:11 +04:00
%.eps : %.png
$( PNGTOPNM) $< | $( PNMTOPS) > $@
# PostScript files
2004-06-26 19:43:54 +04:00
$(PSDIR)/%.ps : $( DVIDIR ) /%.dvi
mkdir -p $( @D)
2004-04-07 14:15:11 +04:00
$( DVIPS) -o $@ $<
xslt/figures/%.pdf : xslt /figures /%.eps
$( EPSTOPDF) $<
2004-06-14 17:47:11 +04:00
# Fo
2004-06-26 19:43:54 +04:00
$(FODIR)/%.fo : $( DOCBOOKDIR ) /%.xml
mkdir -p $( @D)
2004-06-14 17:47:11 +04:00
$( XSLTPROC) --output $@ http://docbook.sourceforge.net/release/xsl/current/fo/docbook.xsl $<
2004-07-10 22:10:36 +04:00
$(HTMLHELPDIR)/% : $( DOCBOOKDIR ) /%.xml
-mkdir -p $@ /images
$( COPY_IMAGES) html $( DOCBOOKDIR) /$* .xml $* $@
2004-06-20 16:43:16 +04: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
2004-06-26 19:43:54 +04:00
mkdir -p $( @D)
2004-06-20 16:43:16 +04:00
$( PLUCKERBUILD) -v -M1 --stayonhost --noimages --zlib-compression -H file:$< -f $* -p $( PLUCKERDIR)
2004-04-07 14:15:11 +04:00
# Manpages
2004-06-16 20:20:05 +04:00
$(MANPAGEDIR)/smb.conf.5.xml : $( SMBDOTCONFDOC ) /parameters .all .xml $( SMBDOTCONFDOC ) /parameters .service .xml $( SMBDOTCONFDOC ) /parameters .global .xml
2004-04-07 14:15:11 +04:00
2004-06-20 16:43:16 +04:00
$(SMBDOTCONFDOC)/parameters.all.xml : $( shell find $ ( SMBDOTCONFDOC ) -type f -name '*.xml ' -mindepth 2 | sort -t / -k 3 | xargs ) $( SMBDOTCONFDOC ) /generate -file -list .sh
$( 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
2004-06-16 20:20:05 +04: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
2004-06-16 20:20:05 +04:00
$( XSLTPROC) --xinclude --param smb.context "'S'" --output $( SMBDOTCONFDOC) /parameters.service.xml $( SMBDOTCONFDOC) /generate-context.xsl $<
2004-04-07 14:15:11 +04:00
2004-06-20 16:43:16 +04:00
$(MANDIR)/% : $( DOCBOOKDIR ) /%.xml xslt /man .xsl
2004-06-26 19:43:54 +04:00
mkdir -p $( @D)
2004-04-07 14:15:11 +04:00
$( XSLTPROC) --output $@ xslt/man.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
2004-06-26 19:43:54 +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
2004-06-26 19:43:54 +04:00
mkdir -p $( @D)
2004-06-16 20:20:05 +04:00
$( XMLLINT) --valid --noout --htmlout $< 2> $@
2004-06-20 16:43:16 +04:00
# Validation verification
2004-06-16 00:12:16 +04:00
2004-06-20 16:43:16 +04:00
$(VALIDATEDIR)/%.report.html : $( DOCBOOKDIR ) /%.xml
2004-06-26 19:43:54 +04:00
mkdir -p $( @D)
2004-05-21 00:33:00 +04:00
$( XMLLINT) --valid --noout --htmlout $< 2> $@
2004-06-26 19:43:54 +04:00
verify : $( VALIDATEDIR ) /Samba -HOWTO -Collection .report .html $( VALIDATEDIR ) /Samba -Developers -Guide .report .html $( VALIDATEDIR ) /Samba -Guide .report .html
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
2004-05-15 20:36:15 +04:00
@$( PERL) scripts/find_missing_doc.pl $( SRCDIR)
2004-05-15 22:08:19 +04:00
@$( PERL) scripts/find_missing_manpages.pl $( SRCDIR)
2004-04-07 14:15:11 +04:00
# Examples and the like
2004-06-26 19:43:54 +04:00
files : $( HOWTODIR ) /index .xml xslt /extract -smbfiles .xsl
2004-04-07 14:15:11 +04:00
$( XSLTPROC) xslt/extract-smbfiles.xsl $< > /dev/null
2004-06-26 19:43:54 +04:00
samples : $( DOCBOOKDIR ) /Samba -HOWTO -Collection .xml xslt /extract -examples .xsl scripts /indent -smb .conf .pl
mkdir -p $( EXAMPLESDIR)
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
2004-06-26 19:43:54 +04:00
mkdir -p $( ARCHIVEDIR)
2004-11-18 14:03:57 +03:00
cp $( PDFDIR) /Samba-HOWTO-Collection.pdf $( ARCHIVEDIR) /TOSHARG-` date +%Y%m%d%H%M%S` .pdf
cp $( PDFDIR) /Samba-Guide.pdf $( ARCHIVEDIR) /S3bE-` date +%Y%m%d%H%M%S` .pdf
2004-06-20 16:43:16 +04:00
# XSL scripts
xslt/html.xsl : xslt /html -common .xsl settings .xsl
xslt/html-chunk.xsl : xslt /html -common .xsl settings .xsl
xslt/latex.xsl : settings .xsl
xslt/expand-sambadoc.xsl : settings .xsl
xslt/generate-attributions.xsl :
xslt/man.xsl :
xslt/pearson.xsl :
2004-07-01 22:27:46 +04:00
.SECONDARY :