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>
#
# Please see http://www.samba.org/samba/cvs.html
# for information on getting the latest
# source and documentation source files.
#
#
# Programs
WGET = @WGET@
XSLTPROC = @XSLTPROC@
DVIPS = @DVIPS@
PNGTOPNM = @PNGTOPNM@
EPSTOPNM = @EPSTOPNM@
PNMTOPNG = @PNMTOPNG@
PNMTOPS = @PNMTOPS@
XMLTO = @XMLTO@
PLUCKERBUILD = @PLUCKERBUILD@
PDFLATEX = TEXINPUTS = xslt/latex:.: @PDFLATEX@
LATEX = TEXINPUTS = xslt/latex:.: @LATEX@
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-04-08 15:18:59 +04:00
TOPDIR = $( shell pwd )
OUTPUTDIR = $( TOPDIR) /output
ARCHIVEDIR = $( OUTPUTDIR) /archive
2004-04-07 14:15:11 +04:00
SRCDIR = @srcdir@
2004-04-09 02:19:02 +04:00
MANDIR = $( OUTPUTDIR) /manpages
2004-04-07 14:15:11 +04:00
EPSTOPDF = @EPSTOPDF@
2004-04-08 15:18:59 +04:00
MANPAGEDIR = $( TOPDIR) /manpages
HOWTODIR = $( TOPDIR) /howto
2004-04-27 01:09:39 +04:00
GUIDEDOC = $( TOPDIR) /guide
DEVDOCDIR = $( TOPDIR) /devel
2004-04-07 14:15:11 +04:00
MAKEINDEX = @MAKEINDEX@
2004-04-07 14:40:50 +04:00
IMAGEPROJDIR = $( HOWTODIR) /imagefiles
2004-04-27 01:09:39 +04:00
IMAGEGUIDEDIR = $( GUIDEDOC) /images
2004-04-08 15:18:59 +04:00
EXAMPLESDIR = $( TOPDIR) /examples
SMBDOTCONFDOC = $( TOPDIR) /smbdotconf
2004-04-07 14:15:11 +04:00
PSDIR = $( OUTPUTDIR)
PDFDIR = $( OUTPUTDIR)
DVIDIR = $( OUTPUTDIR)
TXTDIR = $( OUTPUTDIR) /textdocs
HTMLDIR = $( OUTPUTDIR) /htmldocs
PLUCKERDIR = $( OUTPUTDIR) /plucker
# 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-04-07 14:40:50 +04:00
MANPAGES_SOURCES = $( wildcard $( MANPAGEDIR) /*.?.xml)
MANPAGES = $( patsubst $( MANPAGEDIR) /%.xml,$( MANDIR) /%,$( MANPAGES_SOURCES) ) $( MANDIR) /smb.conf.5
MANPAGES_HTML = $( patsubst $( MANPAGEDIR) /%.xml,$( HTMLDIR) /%.html,$( MANPAGES_SOURCES) ) $( HTMLDIR) /smb.conf.5.html
MANPAGES_PLUCKER = $( patsubst $( MANPAGEDIR) /%.xml,$( PLUCKERDIR) /%.pdb,$( MANPAGES_SOURCES) ) $( PLUCKERDIR) /smb.conf.5.pdb
HOWTODIR_IMAGES_PNG = $( wildcard $( IMAGEPROJDIR) /*.png)
2004-04-27 02:46:47 +04:00
GUIDEDOC_IMAGES_PNG = $( wildcard $( IMAGEGUIDEDIR) /*.png)
2004-04-07 14:40:50 +04:00
HOWTODIR_IMAGES_EPS = $( patsubst %.png,%.eps,$( wildcard $( IMAGEPROJDIR) /*.png) )
HOWTODIR_DEPS = $( HOWTODIR) /*.xml $( HOWTODIR) /attributions.xml $( MANPAGEDIR) /*.xml $( SMBDOTCONFDOC) /smb.conf.5.xml $( SMBDOTCONFDOC) /parameters.all.xml $( SMBDOTCONFDOC) /parameters.global.xml $( SMBDOTCONFDOC) /parameters.service.xml
2004-04-09 02:19:02 +04:00
DEVDOCDIR_DEPS = $( DEVDOCDIR) /*.xml $( DEVDOCDIR) /attributions.xml
2004-04-07 14:15:11 +04:00
2004-04-23 18:23:36 +04:00
help :
2004-04-07 14:15:11 +04:00
@echo "Supported make targets:"
@echo "release - Build the docs needed for a Samba release"
@echo "pdf - Build PDF version of book"
@echo "tex - Build Latex version of book"
@echo "dvi - Build Device Independant File of book"
@echo "ps - Build PostScript version of book"
@echo "manpages - Build manpages"
@echo "txt - Build plain text version of HOWTO Collection and Developers Guide"
@echo -n "html-single - Build single file HTML version of HOWTO Collection"
@echo " and developers guide"
@echo "html - Build HTML version of HOWTO Collection and Developers Guide"
@echo "htmlman - Build html version of manpages"
2004-04-09 02:19:02 +04:00
@echo "plucker - Build HOWTO, Developers Guide, man pages in Plucker format for PDA"
2004-04-07 14:15:11 +04:00
@echo "undocumented - Output list of undocumented smb.conf options"
@echo "samples - Extract examples"
@echo "files - Extract other files"
2004-04-23 18:23:36 +04:00
@echo "all - Build all docs that can be build using the utilities found by configure"
2004-04-07 14:15:11 +04:00
@echo "everything - Build all of the above"
2004-04-23 18:23:36 +04:00
all : @TARGETS @
2004-04-09 02:19:02 +04:00
everything : manpages pdf html -single html htmlman txt ps
2004-04-07 14:15:11 +04:00
2004-05-05 19:16:00 +04:00
release : manpages htmlman html pdf guide
2004-04-07 14:15:11 +04:00
# Global rules
pdf : $( PDFDIR ) $( PDFDIR ) /Samba -HOWTO -Collection .pdf $( PDFDIR ) /Samba -Developers -Guide .pdf
dvi : $( DVIDIR ) $( DVIDIR ) /Samba -HOWTO -Collection .dvi $( DVIDIR ) /Samba -Developers -Guide .dvi
ps : $( PSDIR ) $( PSDIR ) /Samba -HOWTO -Collection .ps $( PSDIR ) /Samba -Developers -Guide .ps
txt : $( TXTDIR ) $( TXTDIR ) /Samba -HOWTO -Collection .txt $( TXTDIR ) /Samba -Developers -Guide .txt
2004-04-27 17:52:27 +04:00
htmlman : $( HTMLDIR ) $( MANPAGES_HTML ) $( HTMLDIR ) /samba .css
2004-04-07 14:15:11 +04:00
2004-04-27 17:52:27 +04:00
html-single : $( HTMLDIR ) $( HTMLDIR ) /samba .css $( HTMLDIR ) /Samba -HOWTO -Collection .html $( HTMLDIR ) /Samba -Developers -Guide .html $( HTMLDIR ) /Samba -Guide .html
2004-04-27 03:29:19 +04:00
cp -p $( GUIDEDOC_IMAGES_PNG) $( HOWTODIR_IMAGES_PNG) $( HTMLDIR) /images/
2004-04-07 14:15:11 +04:00
2004-04-27 03:05:31 +04:00
html : $( HTMLDIR ) /howto $( HTMLDIR ) /guide $( HTMLDIR ) /devel
2004-04-27 02:46:47 +04:00
2004-04-27 17:52:27 +04:00
$(HTMLDIR)/howto : $( HTMLDIR ) $( HTMLDIR ) /howto /samba .css Samba -HOWTO -Collection .xml
2004-04-27 02:46:47 +04:00
$( XSLTPROC) --stringparam base.dir " $( HTMLDIR) /howto/ " xslt/html-chunk.xsl Samba-HOWTO-Collection.xml
2004-04-27 03:05:31 +04:00
-mkdir $( HTMLDIR) /howto/images
cp -R $( HOWTODIR_IMAGES_PNG) $( HTMLDIR) /howto/images
2004-04-27 01:09:39 +04:00
2004-04-27 17:52:27 +04:00
$(HTMLDIR)/devel : $( HTMLDIR ) $( HTMLDIR ) /devel /samba .css Samba -Developers -Guide .xml
2004-04-27 02:46:47 +04:00
$( XSLTPROC) --stringparam base.dir " $( HTMLDIR) /devel/ " xslt/html-chunk.xsl Samba-Developers-Guide.xml
2004-04-27 17:52:27 +04:00
$(HTMLDIR)/guide : $( HTMLDIR ) $( HTMLDIR ) /guide /samba .css Samba -Guide .xml
2004-04-27 03:05:31 +04:00
$( XSLTPROC) --stringparam base.dir " $( HTMLDIR) /guide/ " xslt/html-chunk.xsl Samba-Guide.xml
-mkdir $( HTMLDIR) /guide/images
cp -R $( GUIDEDOC_IMAGES_PNG) $( HTMLDIR) /guide/images
2004-04-07 14:15:11 +04:00
manpages : $( MANDIR ) $( MANPAGES )
tex : Samba -HOWTO -Collection .tex Samba -Developers -Guide .tex gpl .tex
2004-04-09 02:19:02 +04:00
plucker : html -single htmlman $( PLUCKERDIR ) $( MANPAGES_PLUCKER ) $( PLUCKERDIR ) /Samba -Developers -Guide .pdb $( PLUCKERDIR ) /Samba -HOWTO -Collection .pdb
2004-04-07 14:15:11 +04:00
2004-04-07 14:40:50 +04:00
Samba-HOWTO-Collection.xml : $( HOWTODIR ) /index .xml $( HOWTODIR_DEPS )
2004-04-07 14:15:11 +04:00
$( XSLTPROC) --stringparam noreference 1 --xinclude --output $@ xslt/expand-sambadoc.xsl $<
Samba-Guide.xml : $( GUIDEDOC ) /guide -main .xml
$( XSLTPROC) --stringparam noreference 1 --xinclude --output $@ xslt/expand-sambadoc.xsl $<
2004-04-09 02:19:02 +04:00
Samba-Developers-Guide.xml : $( DEVDOCDIR ) /index .xml $( DEVDOCDIR_DEPS )
2004-04-07 14:15:11 +04:00
$( XSLTPROC) --stringparam noreference 1 --xinclude --output $@ xslt/expand-sambadoc.xsl $<
2004-04-07 14:40:50 +04:00
$(HOWTODIR)/attributions.xml : $( HOWTODIR ) /index .xml
2004-04-07 14:15:11 +04:00
@echo > $@ # Make sure we don't get recursive dependencies, etc!
$( XSLTPROC) --output $@ xslt/generate-attributions.xsl $<
2004-04-09 02:19:02 +04:00
$(DEVDOCDIR)/attributions.xml : $( DEVDOCDIR ) /index .xml
2004-04-07 14:15:11 +04:00
@echo > $@ # Make sure we don't get recursive dependencies, etc!
$( XSLTPROC) --output $@ xslt/generate-attributions.xsl $<
clean :
2004-04-27 17:52:27 +04:00
rm -rf $( OUTPUTDIR) /*
2004-04-07 14:15:11 +04:00
rm -f *.xml $( MANPAGES) $( TXTDIR) /*.txt $( PSDIR) /*.ps \
2004-04-09 02:19:02 +04:00
$( PDFDIR) /*.pdf $( HTMLDIR) /*html $( HTMLDIR) /samba.css
2004-04-07 14:15:11 +04:00
rm -f xslt/figures/*pdf
rm -f $( SMBDOTCONFDOC) /parameters.*.xml $( DVIDIR) /*.dvi
2004-04-09 02:19:02 +04:00
rm -f samba-doc.* index.* $( HOWTODIR) /changelog.xml $( HOWTODIR) /attributions.xml $( DEVDOCDIR) /attributions.xml
2004-04-07 14:15:11 +04:00
rm -f Samba-HOWTO-Collection.*
rm -f Samba-Developers-Guide.*
rm -f Samba-Guide.*
2004-04-07 14:40:50 +04:00
rm -f $( IMAGEPROJDIR) /*.eps $( MANPAGEDIR) /smb.conf.5.xml
2004-04-07 14:15:11 +04:00
rm -f $( PLUCKERDIR) /*.pdb
# Text files
2004-04-09 02:19:02 +04:00
$(TXTDIR) :
2004-04-07 14:15:11 +04:00
mkdir $( TXTDIR)
$(TXTDIR)/%.txt : %.xml
$( XMLTO) txt -o $( TXTDIR) $< > $@
# Tex files
%.tex : %.xml
$( XSLTPROC) --output $@ xslt/latex.xsl $<
gpl.tex :
$( WGET) http://www.gnu.org/licenses/gpl.tex
latexfigures : $( LATEX_FIGURES )
# Adobe PDF files
$(PDFDIR)/%.pdf : %.tex latexfigures gpl .tex
-$( PDFLATEX) $<
$( MAKEINDEX) ` echo $< | sed -e 's/.tex//' `
-$( PDFLATEX) $<
-$( PDFLATEX) $<
mv $( patsubst %.tex,%.pdf,$<) $@
2004-04-07 14:40:50 +04:00
epsimages : $( HOWTODIR_IMAGES_EPS )
2004-04-07 14:15:11 +04:00
# DVI files
$(DVIDIR)/%.dvi : %.tex epsimages gpl .tex
-$( LATEX) $<
$( MAKEINDEX) ` echo $< | sed -e 's/.tex//' `
-$( LATEX) $<
-$( LATEX) $<
mv $( patsubst %.tex,%.dvi,$<) $@
%.eps : %.png
$( PNGTOPNM) $< | $( PNMTOPS) > $@
# PostScript files
$(PSDIR)/%.ps : $( DVIDIR ) /%.dvi
$( DVIPS) -o $@ $<
xslt/figures/%.pdf : xslt /figures /%.eps
$( EPSTOPDF) $<
# Single large HTML files
2004-04-09 02:19:02 +04:00
$(HTMLDIR) :
2004-04-07 14:15:11 +04:00
mkdir $( HTMLDIR)
2004-04-27 03:05:31 +04:00
mkdir $( HTMLDIR) /howto
2004-04-27 02:46:47 +04:00
mkdir $( HTMLDIR) /guide
mkdir $( HTMLDIR) /devel
2004-04-27 03:05:31 +04:00
mkdir $( HTMLDIR) /images
2004-04-27 02:46:47 +04:00
2004-04-09 02:19:02 +04:00
$(PLUCKERDIR) :
2004-04-07 14:15:11 +04:00
mkdir $( PLUCKERDIR)
2004-04-27 17:52:27 +04:00
%/samba.css : xslt /html /samba .css
2004-04-27 18:51:40 +04:00
if [ ! -d ` dirname $@ ` ] ; then mkdir -p ` dirname $@ ` ; fi
2004-04-27 03:05:31 +04:00
cp $< $@
2004-04-07 14:15:11 +04:00
2004-04-07 14:40:50 +04:00
$(HTMLDIR)/Samba-HOWTO-Collection.html : Samba -HOWTO -Collection .xml $( HOWTODIR_DEPS ) $( HOWTODIR_IMAGES_PNG )
2004-04-07 14:15:11 +04:00
$( XSLTPROC) --output $@ xslt/html.xsl $<
2004-04-27 01:09:39 +04:00
$(HTMLDIR)/Samba-Guide.html : Samba -Guide .xml $( GUIDEDOC_IMAGES_PNG )
$( XSLTPROC) --output $@ xslt/html.xsl $<
2004-04-09 02:19:02 +04:00
$(HTMLDIR)/Samba-Developers-Guide.html : Samba -Developers -Guide .xml $( DEVDOCDIR_DEPS )
2004-04-07 14:15:11 +04:00
$( XSLTPROC) --output $@ xslt/html.xsl $<
$(HTMLDIR)/%.html : %.xml
$( XSLTPROC) --output $@ xslt/html.xsl $<
$(PLUCKERDIR)/%.pdb : $( HTMLDIR ) /%.html
$( PLUCKERBUILD) -v -M1 --stayonhost --noimages --zlib-compression -H file:$< -f $( patsubst $( PLUCKERDIR) /%.pdb,%,$@ ) -p $( PLUCKERDIR)
2004-04-07 14:40:50 +04:00
%.xml : $( MANPAGEDIR ) /%.xml
2004-04-07 14:15:11 +04:00
$( XSLTPROC) --stringparam noreference 1 --output $@ xslt/expand-sambadoc.xsl $<
# Manpages
$(SMBDOTCONFDOC)/parameters.all.xml : $( SMBDOTCONFDOC ) /generate -file -list .sh
@cd $( SMBDOTCONFDOC) && \
/bin/sh generate-file-list.sh >parameters.all.xml && \
cd $( OUTPUTDIR)
$(SMBDOTCONFDOC)/parameters.global.xml : $( SMBDOTCONFDOC ) /parameters .all .xml $( SMBDOTCONFDOC ) /generate -context .xsl
@cd $( SMBDOTCONFDOC) && \
$( XSLTPROC) --xinclude \
--param smb.context "'G'" \
--output parameters.global.xml \
generate-context.xsl parameters.all.xml && \
cd $( OUTPUTDIR)
$(SMBDOTCONFDOC)/parameters.service.xml : $( SMBDOTCONFDOC ) /parameters .all .xml $( SMBDOTCONFDOC ) /generate -context .xsl
@cd $( SMBDOTCONFDOC) && \
$( XSLTPROC) --xinclude \
--param smb.context "'S'" \
--output parameters.service.xml \
generate-context.xsl parameters.all.xml && \
cd $( OUTPUTDIR)
smb.conf.5.xml : $( SMBDOTCONFDOC ) /smb .conf .5.xml $( SMBDOTCONFDOC ) /parameters .all .xml \
$( SMBDOTCONFDOC) /parameters.global.xml $( SMBDOTCONFDOC) /parameters.service.xml
$( XSLTPROC) --stringparam noreference 1 --xinclude --output $@ xslt/expand-sambadoc.xsl $<
2004-04-09 02:19:02 +04:00
$(MANDIR) :
2004-04-07 14:15:11 +04:00
mkdir $( MANDIR)
$(MANDIR)/% : %.xml
$( XSLTPROC) --output $@ xslt/man.xsl $<
# Find undocumented parameters
undocumented : $( SMBDOTCONFDOC ) /parameters .all .xml
$( PERL) scripts/find_missing_doc.pl ../..
# Examples and the like
$(EXAMPLESDIR) :
mkdir $( EXAMPLESDIR)
2004-04-07 14:40:50 +04:00
files : $( HOWTODIR ) /index .xml $( HOWTODIR ) /attributions .xml $( EXAMPLESDIR )
2004-04-07 14:15:11 +04:00
$( XSLTPROC) xslt/extract-smbfiles.xsl $< > /dev/null
samples : $( EXAMPLESDIR ) Samba -HOWTO -Collection .xml
$( XSLTPROC) xslt/extract-examples.xsl Samba-HOWTO-Collection.xml > /dev/null 2> examples/README
for I in examples/*.conf; do { ./scripts/indent-smb.conf.pl < $$ I > $$ I.tmp; mv $$ I.tmp $$ I; } done
howto : $( PDFDIR ) /Samba -HOWTO -Collection .pdf
guide : $( PDFDIR ) /Samba -Guide .pdf
%/changelog.xml : % $( wildcard %/CVS /*)
2004-04-22 03:53:18 +04:00
touch $@
# FIXME
2004-04-07 14:40:50 +04:00
$(ARCHIVEDIR) :
mkdir $( ARCHIVEDIR)
archive : $( ARCHIVEDIR ) guide howto
cp $( PDFDIR) /Samba-HOWTO-Collection.pdf $( ARCHIVEDIR) /TOSHARG-` date +%Y%m%d` .pdf
cp $( PDFDIR) /Samba-Guide.pdf $( ARCHIVEDIR) /S3bE-` date +%Y%m%d` .pdf