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-01-29 23:05:52 +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
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
2005-01-29 23:05:52 +03:00
i f n d e f O U T P U T D I R
Makefile.settings : Makefile .settings .in configure
@echo Makefile.settings not present, trying to run configure...
@./configure
configure : configure .in
@echo configure not present, trying to generate
@autoreconf
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"
@echo " pdf,tex,dvi,ps,manpages,txt,pearson,fo,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"
2004-06-20 16:43:16 +04:00
@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
2005-02-01 16:01:10 +03:00
all : $( TARGETS )
2005-02-10 21:50:51 +03:00
everything : manpages pdf html -single html htmlman txt ps fo htmlhelp pearson validate
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 ) )
2005-02-06 00:02:41 +03:00
txt-chunks : $( patsubst $ ( DOCBOOKDIR ) /%.xml ,$ ( TXTDIR ) /%/,$ ( MAIN_DOCS ) )
2004-06-20 16:43:16 +04:00
fo : $( patsubst $ ( DOCBOOKDIR ) /%.xml ,$ ( FODIR ) /%.fo ,$ ( MAIN_DOCS ) )
2005-02-10 11:51:11 +03:00
fo-pdf : $( patsubst $ ( DOCBOOKDIR ) /%.xml ,$ ( FOPDFDIR ) /%.pdf ,$ ( MAIN_DOCS ) )
2004-06-20 16:43:16 +04:00
tex : $( patsubst $ ( DOCBOOKDIR ) /%.xml ,%.tex ,$ ( MAIN_DOCS ) )
2005-03-11 19:26:19 +03:00
texi : $( patsubst $ ( DOCBOOKDIR ) /%.xml ,$ ( TEXINFODIR ) /%.texi ,$ ( MAIN_DOCS ) )
texiinfo : $( patsubst $ ( DOCBOOKDIR ) /%.xml ,$ ( TEXINFODIR ) /%.info ,$ ( MAIN_DOCS ) )
2004-06-20 16:43:16 +04:00
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 ) )
2005-03-13 04:38:40 +03:00
validate : $( patsubst $ ( DOCBOOKDIR ) /%.xml ,%-validate ,$ ( 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 $<
2005-03-12 22:33:59 +03:00
mkdir -p $( @D) /images
2004-07-10 22:10:36 +04:00
$( 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
2005-03-11 19:26:19 +03:00
# Attributions
2004-06-20 16:43:16 +04:00
%-attributions.xml :
2005-02-10 23:27:44 +03: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
mkdir -p $( @D)
2004-05-15 20:09:50 +04:00
$( HTML2TEXT) -nobs -style pretty -o $@ $<
2004-04-07 14:15:11 +04:00
2005-02-06 00:02:41 +03:00
$(TXTDIR)/%/ : $( HTMLDIR ) /%/index .html
$( MAKE) ` echo $( HTMLDIR) /$* /*.html | $( PERL) -p -e 's|$(HTMLDIR)|$(TXTDIR)|g;s/\.html/\.txt/g;' `
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 $<
2005-02-10 11:51:11 +03:00
# PDF thru Fo
$(FOPDFDIR)/%.pdf : $( FODIR ) /%.fo
mkdir -p $( @D)
2005-03-13 21:25:08 +03:00
JAVA_OPTS = -Xmx250m $( FOP) -q -d $< -pdf $@
2005-02-10 11:51:11 +03:00
2004-07-10 22:10:36 +04:00
$(HTMLHELPDIR)/% : $( DOCBOOKDIR ) /%.xml
2005-03-12 22:33:59 +03:00
mkdir -p $@ /images
2004-07-10 22:10:36 +04:00
$( 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)
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
mkdir -p $( @D)
cd $( @D) && $( DB2TEXI) $( shell pwd ) /$<
$(TEXINFODIR)/%.info : $( TEXINFODIR ) /%.texi
$( MAKEINFO) --no-validate --force -o $@ " $< "
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 $<
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
mkdir -p $( @D)
$( 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
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)
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-13 21:25:08 +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
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
2005-03-11 18:57:45 +03:00
files : Samba -HOWTO -Collection /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)
2005-03-12 00:33:28 +03:00
cp $( PDFDIR) /Samba-HOWTO-Collection.pdf $( ARCHIVEDIR) /TOSHARG-$( shell date +%Y%m%d%H%M%S) .pdf
cp $( PDFDIR) /Samba-Guide.pdf $( ARCHIVEDIR) /S3bE-$( shell 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
2005-03-11 19:26:19 +03:00
clobber : clean
rm Makefile.settings settings.xsl config.status config.log configure
clean :
rm -rf $( OUTPUTDIR) /* $( DOCBOOKDIR)
rm -f *.xml
rm -f xslt/figures/*pdf
rm -f $( SMBDOTCONFDOC) /parameters.*.xml
rm -f $( patsubst $( DOCBOOKDIR) /%.xml,%.*,$( MAIN_DOCS) )
# Always keep intermediate files if we can
2004-07-01 22:27:46 +04:00
.SECONDARY :