################################################################# # Makefile.in for Samba Documentation # Authors: # James Moore # Gerald Carter # Jelmer Vernooij # Programs WGET = @WGET@ XSLTPROC = @XSLTPROC@ XMLLINT = @XMLLINT@ DVIPS = @DVIPS@ PNGTOPNM = @PNGTOPNM@ EPSTOPNM = @EPSTOPNM@ PNMTOPNG = @PNMTOPNG@ PNMTOPS = @PNMTOPS@ HTML2TEXT = @HTML2TEXT@ PLUCKERBUILD = @PLUCKERBUILD@ THUMBPDF = @THUMBPDF@ PDFLATEX = TEXINPUTS=xslt/latex:.: @PDFLATEX@ --file-line-error-style LATEX = TEXINPUTS=xslt/latex:.: @LATEX@ --file-line-error-style RM = @RM@ ifndef DEBUG_LATEX PDFLATEX += --interaction nonstopmode LATEX += --interaction nonstopmode endif # Paths OUTPUTDIR = output ARCHIVEDIR = $(OUTPUTDIR)/archive SRCDIR = @SAMBASOURCEDIR@ MANDIR = $(OUTPUTDIR)/manpages EPSTOPDF = @EPSTOPDF@ MANPAGEDIR = manpages MAKEINDEX = @MAKEINDEX@ EXAMPLESDIR = examples SMBDOTCONFDOC = smbdotconf DOCBOOKDIR = tmp PSDIR = $(OUTPUTDIR) PDFDIR = $(OUTPUTDIR) DVIDIR = $(OUTPUTDIR) FODIR = $(OUTPUTDIR) HTMLHELPDIR = $(OUTPUTDIR)/htmlhelp VALIDATEDIR = $(OUTPUTDIR)/validate PEARSONDIR = $(OUTPUTDIR)/pearson TXTDIR = $(OUTPUTDIR)/textdocs HTMLDIR=$(OUTPUTDIR)/htmldocs PLUCKERDIR=$(OUTPUTDIR)/plucker # Docs to build MAIN_DOCS = $(patsubst %/index.xml,$(DOCBOOKDIR)/%.xml,$(wildcard */index.xml)) MANPAGES = $(wildcard $(MANPAGEDIR)/*.?.xml) # 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 MANPAGES_PLUCKER = $(patsubst $(MANPAGEDIR)/%.xml,$(PLUCKERDIR)/%.pdb,$(MANPAGES_SOURCES)) Samba_HOWTO_Collection_IMAGES_PNG = $(wildcard Samba-HOWTO-Collection/imagefiles/*.png) Samba_Guide_IMAGES_PNG = $(wildcard Samba-Guide/images/*.png) Samba_HOWTO_Collection_IMAGEDIR = Samba-HOWTO-Collection/imagefiles Samba_Guide_IMAGEDIR = Samba-Guide/images Samba_HOWTO_Collection_IMAGES_EPS = $(patsubst %.png,%.eps,$(Samba_HOWTO_Collection_IMAGES_PNG)) Samba_Guide_IMAGES_EPS = $(patsubst %.png,%.eps,$(Samba_Guide_IMAGES_PNG)) help: @echo "Supported make targets:" @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 all: @TARGETS@ everything: manpages pdf html-single html htmlman txt ps fo htmlhelp pearson verify release: manpages htmlman html pdf guide # 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)) # Intermediate docbook docs $(DOCBOOKDIR): mkdir $@ $(DOCBOOKDIR)/%.xml: %/index.xml $(DOCBOOKDIR) xslt/expand-sambadoc.xsl $(XSLTPROC) --stringparam noreference 1 --stringparam imagedir "$($(subst -,_,$*)_IMAGEDIR)/" --xinclude --output $@ xslt/expand-sambadoc.xsl $< $(DOCBOOKDIR)/%.xml: $(MANPAGEDIR)/%.xml $(DOCBOOKDIR) xslt/expand-sambadoc.xsl $(XSLTPROC) --stringparam noreference 1 --output $@ xslt/expand-sambadoc.xsl $< manpages.xml: $(MANPAGES_SOURCES) xslt/manpage-summary.xsl echo "
" > $@ for I in $(MANPAGES_SOURCES); do $(XSLTPROC) xslt/manpage-summary.xsl $$I >> $@; done echo "
" >> $@ # HTML docs $(HTMLDIR)/index.html: htmldocs.html $(HTMLDIR) cp $< $@ $(HTMLDIR)/%/index.html: $(DOCBOOKDIR)/%.xml $(HTMLDIR)/% $(HTMLDIR)/%/samba.css xslt/html-chunk.xsl $(XSLTPROC) --stringparam base.dir "$(HTMLDIR)/$*/" xslt/html-chunk.xsl $< -mkdir $(HTMLDIR)/$*/images # Single large HTML files $(HTMLDIR): mkdir $(HTMLDIR) mkdir $(HTMLDIR)/images $(OUTPUTDIR)/%/samba.css: xslt/html/samba.css cp $< $@ $(HTMLDIR)/%.html: $(DOCBOOKDIR)/%.xml $(HTMLDIR) $(HTMLDIR)/samba.css $(patsubst %.png,$(HTMLDIR)/images/%.png,$(%_IMAGES_PNG)) xslt/html.xsl echo $^ $(XSLTPROC) --output $@ xslt/html.xsl $< $(patsubst $(DOCBOOKDIR)/%.xml,$(HTMLDIR)/%,$(MAIN_DOCS)): $(HTMLDIR) -mkdir $@ %-attributions.xml: echo "" > $@ $(XSLTPROC) --xinclude xslt/generate-attributions.xsl $*/index.xml > $@ 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)) # Text files $(TXTDIR): mkdir $(TXTDIR) $(TXTDIR)/%.txt: $(HTMLDIR)/%.html $(TXTDIR) $(HTML2TEXT) -nobs -style pretty -o $@ $< # Tex files %.tex: $(DOCBOOKDIR)/%.xml xslt/latex.xsl $(XSLTPROC) --output $@ xslt/latex.xsl $< gpl.tex: $(WGET) http://www.gnu.org/licenses/gpl.tex latexfigures: $(LATEX_FIGURES) %.aux: %.tex -$(PDFLATEX) $< %.idx: %.aux $(MAKEINDEX) $* # Adobe PDF files $(PDFDIR)/%.pdf: %.tex %.aux %.idx latexfigures gpl.tex $(PDFDIR) $(%_IMAGES_PNG) -$(PDFLATEX) $< -$(PDFLATEX) $< $(THUMBPDF) $*.pdf -$(PDFLATEX) $< mv $*.pdf $@ # DVI files $(DVIDIR)/%.dvi: %.tex %.aux %.idx gpl.tex $(DVIDIR) $(%_IMAGES_EPS) -$(LATEX) $< -$(LATEX) $< mv $*.dvi $@ %.eps: %.png $(PNGTOPNM) $< | $(PNMTOPS) > $@ # PostScript files $(PSDIR)/%.ps: $(DVIDIR)/%.dvi $(PSDIR) $(DVIPS) -o $@ $< xslt/figures/%.pdf: xslt/figures/%.eps $(EPSTOPDF) $< # Fo $(FODIR): mkdir $(FODIR) $(FODIR)/%.fo: $(DOCBOOKDIR)/%.xml $(FODIR) $(XSLTPROC) --output $@ http://docbook.sourceforge.net/release/xsl/current/fo/docbook.xsl $< # HTML Help $(HTMLHELPDIR): mkdir $(HTMLHELPDIR) $(HTMLHELPDIR)/%/images/%.png: $(%_IMAGEDIR)/%.png cp $< $@ $(HTMLHELPDIR)/%/images: $(HTMLHELPDIR)/% mkdir -p $@ $(HTMLHELPDIR)/%/images/: $@ $(subst $($*_IMAGEDIR),$@/,$($*_IMAGES_PNG)) $(HTMLHELPDIR)/%: $(DOCBOOKDIR)/%.xml $(HTMLHELPDIR) $(HTMLHELPDIR)/%/images/ -mkdir $@ $(XSLTPROC) --stringparam htmlhelp.chm $*.chm --stringparam manifest.in.base.dir "$@/" --stringparam base.dir "$@/" http://docbook.sourceforge.net/release/xsl/current/htmlhelp/htmlhelp.xsl $< # Plucker docs $(PLUCKERDIR): mkdir $(PLUCKERDIR) $(PLUCKERDIR)/%.pdb: $(HTMLDIR)/%.html $(PLUCKERDIR) $(PLUCKERBUILD) -v -M1 --stayonhost --noimages --zlib-compression -H file:$< -f $* -p $(PLUCKERDIR) # Manpages $(MANPAGEDIR)/smb.conf.5.xml: $(SMBDOTCONFDOC)/parameters.all.xml $(SMBDOTCONFDOC)/parameters.service.xml $(SMBDOTCONFDOC)/parameters.global.xml $(SMBDOTCONFDOC)/parameters.all.xml: $(shell find $(SMBDOTCONFDOC) -type f -name '*.xml' -mindepth 2 | sort -t/ -k3 | xargs) $(SMBDOTCONFDOC)/generate-file-list.sh $(SMBDOTCONFDOC)/generate-file-list.sh $(SMBDOTCONFDOC) > $@ $(SMBDOTCONFDOC)/parameters.global.xml: $(SMBDOTCONFDOC)/parameters.all.xml $(SMBDOTCONFDOC)/generate-context.xsl $(XSLTPROC) --xinclude --param smb.context "'G'" --output $(SMBDOTCONFDOC)/parameters.global.xml $(SMBDOTCONFDOC)/generate-context.xsl $< $(SMBDOTCONFDOC)/parameters.service.xml: $(SMBDOTCONFDOC)/parameters.all.xml $(SMBDOTCONFDOC)/generate-context.xsl $(XSLTPROC) --xinclude --param smb.context "'S'" --output $(SMBDOTCONFDOC)/parameters.service.xml $(SMBDOTCONFDOC)/generate-context.xsl $< $(MANDIR): mkdir $(MANDIR) $(MANDIR)/%: $(DOCBOOKDIR)/%.xml xslt/man.xsl $(XSLTPROC) --output $@ xslt/man.xsl $< # Pearson compatible XML $(PEARSONDIR): mkdir $@ $(PEARSONDIR)/%.xml: $(DOCBOOKDIR)/%.xml $(PEARSONDIR) xslt/pearson.xsl $(XSLTPROC) --xinclude --output $@ xslt/pearson.xsl $< $(PEARSONDIR)/%.report.html: $(PEARSONDIR)/%.xml $(XMLLINT) --valid --noout --htmlout $< 2> $@ # Validation verification $(VALIDATEDIR): mkdir $@ $(VALIDATEDIR)/%.report.html: $(DOCBOOKDIR)/%.xml $(XMLLINT) --valid --noout --htmlout $< 2> $@ verify: $(VALIDATEDIR) $(VALIDATEDIR)/Samba-HOWTO-Collection.report.html $(VALIDATEDIR)/Samba-Developers-Guide.report.html $(VALIDATEDIR)/Samba-Guide.report.html # Find undocumented parameters undocumented: $(SMBDOTCONFDOC)/parameters.all.xml scripts/find_missing_doc.pl scripts/find_missing_manpages.pl @$(PERL) scripts/find_missing_doc.pl $(SRCDIR) @$(PERL) scripts/find_missing_manpages.pl $(SRCDIR) # Examples and the like $(EXAMPLESDIR): mkdir $(EXAMPLESDIR) files: $(HOWTODIR)/index.xml $(EXAMPLESDIR) xslt/extract-smbfiles.xsl $(XSLTPROC) xslt/extract-smbfiles.xsl $< > /dev/null samples: $(DOCBOOKDIR)/Samba-HOWTO-Collection.xml $(EXAMPLESDIR) xslt/extract-examples.xsl scripts/indent-smb.conf.pl $(XSLTPROC) --xinclude xslt/extract-examples.xsl $< > /dev/null 2> examples/README for I in examples/*.conf; do { ./scripts/indent-smb.conf.pl < $$I > $$I.tmp; mv $$I.tmp $$I; } done # Archiving $(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 # 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: