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
2018-01-04 18:19:13 +03:00
export XML_CATALOG_FILES := $( XML_CATALOG_FILES) /etc/xml/catalog $( shell pwd ) /build/catalog.xml
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) )
2017-06-26 10:46:18 +03:00
MANPAGES = $( sort $( wildcard $( MANPAGEDIR) /*.?.xml) )
2004-06-20 16:43:16 +04:00
2004-04-07 14:15:11 +04:00
# Lists of files to process
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)
2018-01-04 18:35:12 +03:00
XSLTPROC_DEPS = build/catalog.xml build/DTD/samba.build.version
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"
2020-06-03 03:33:50 +03:00
@echo " pdf,tex,ps,manpages,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"
2012-09-10 14:28:19 +04:00
@echo " htmlman - Build HTML version of manpages"
2004-06-20 16:43:16 +04:00
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
2004-06-20 16:43:16 +04:00
# Pseudo targets
2008-05-16 17:46:36 +04:00
all :: $( TARGETS )
2020-06-03 03:33:50 +03:00
everything :: manpages pdf html -single html htmlman ps fo htmlhelp
2012-09-10 14:28:19 +04:00
release :: manpages htmlman html pdf
2008-05-16 17:46:36 +04:00
clean ::
2007-06-06 17:43:17 +04:00
@echo "Cleaning up..."
rm -rf $( OUTPUTDIR) /* $( DOCBOOKDIR)
2009-05-02 02:39:49 +04:00
rm -f *-attributions.xml
2012-07-16 16:26:50 +04:00
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 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 ) )
tex :: $( addsuffix .tex ,$ ( MAIN_DOCS ) )
2012-09-03 23:49:25 +04:00
manpages :: $( patsubst $ ( MANPAGEDIR ) /%.xml ,$ ( OUTPUTDIR ) /manpages /%,$ ( MANPAGES ) )
2012-09-10 14:28:19 +04:00
htmlman :: $( patsubst $ ( MANPAGEDIR ) /%.xml ,$ ( HTMLDIR ) /manpages /%.html ,$ ( MANPAGES ) ) $( HTMLDIR ) /manpages /index .html
2008-05-16 17:46:36 +04: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 03:05:34 +04:00
.PHONY : test check validate manpages
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
#
2018-01-04 18:35:12 +03:00
$(DOCBOOKDIR)/%.xml : %/index .xml xslt /expand -sambadoc .xsl $( XSLTPROC_DEPS )
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
2018-01-04 18:35:12 +03:00
$(DOCBOOKDIR)/manpages/%.xml : $( MANPAGEDIR ) /%.xml xslt /expand -sambadoc .xsl Makefile .settings $( XSLTPROC_DEPS )
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
2018-01-04 18:35:12 +03:00
$(DOCBOOKDIR)/manpages/index.xml : $( MANPAGES ) xslt /manpage -summary .xsl $( XSLTPROC_DEPS )
2005-06-30 06:17:59 +04:00
@mkdir -p $( @D)
2004-06-20 16:43:16 +04:00
echo "<article><variablelist>" > $@
2012-09-03 23:49:25 +04:00
$( XSLTPROC) xslt/manpage-summary.xsl $( MANPAGES) >> $@
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 $< $@
2012-09-04 03:10:59 +04:00
2018-01-04 18:35:12 +03:00
$(HTMLDIR)/%/index.html : $( DOCBOOKDIR ) /%.xml $( HTMLDIR ) /%/samba .css xslt /html -chunk .xsl %-images -html -chunks $( XSLTPROC_DEPS )
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
2018-01-04 18:35:12 +03:00
$(OUTPUTDIR)/%/samba.css : xslt /html /samba .css $( XSLTPROC_DEPS )
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
2012-07-16 16:26:50 +04:00
$(patsubst %,$(HTMLDIR)/%.html,$(MAIN_DOCS)) : $( HTMLDIR ) /%.html : %-images -html -single
2005-03-17 03:13:11 +03:00
2018-01-04 18:35:12 +03:00
$(HTMLDIR)/%.html : $( DOCBOOKDIR ) /%.xml $( HTMLDIR ) /samba .css xslt /html .xsl $( XSLTPROC_DEPS )
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
2018-01-04 18:35:12 +03:00
%-attributions.xml : $( XSLTPROC_DEPS )
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
# 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
2012-07-16 16:26:50 +04:00
# Dependency files
2018-01-04 18:35:12 +03:00
%.d : $( DOCBOOKDIR ) /%.xml xslt /generate -dependencies .xsl $( XSLTPROC_DEPS )
2012-07-16 16:26:50 +04:00
@echo " Generating dependency file for $* "
@$( XSLTPROC) --novalid \
--stringparam target " $* " \
-o $@ xslt/generate-dependencies.xsl $<
@echo " $* -images-latex-eps: \$ $( addsuffix .eps, \$ $( $* -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 17:31:14 +04:00
# Adobe PDF files
2012-07-16 16:26:50 +04:00
$(PDFDIR)/%.pdf : %/index .xml $( PDFDIR ) xslt /latex .xsl %-images -latex -png %-images -latex -pdf
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
2012-07-16 16:26:50 +04:00
$(PSDIR)/%.ps : %/index .xml $( PSDIR ) xslt /latex .xsl %-images -latex -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
2004-04-07 14:15:11 +04:00
%.eps : %.png
$( PNGTOPNM) $< | $( PNMTOPS) > $@
2018-01-04 18:35:12 +03:00
$(HTMLHELPDIR)/% : $( DOCBOOKDIR ) /%.xml %-images -htmlhelp $( XSLTPROC_DEPS )
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-04-07 14:15:11 +04:00
# Manpages
2012-09-03 23:49:25 +04:00
$(MANPAGEDIR)/smb.conf.5.xml : parameters
2011-04-06 01:07:01 +04: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 03:35:25 +04:00
parameters : $( SMBDOTCONFDOC ) /parameters .all .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
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 ) )
2012-09-04 03:10:59 +04:00
2005-01-07 19:04:34 +03:00
$(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
# 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
2018-01-04 18:12:28 +03: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
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
2012-07-16 16:26:50 +04:00
xslt/latex.xsl :
xslt/expand-sambadoc.xsl :
xslt/generate-attributions.xsl :
xslt/man.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 :
2020-06-03 03:09:33 +03:00
.PHONY : clean clobber release everything all