summaryrefslogtreecommitdiff
path: root/docs-xml/Makefile
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2012-07-16 14:26:50 +0200
committerJelmer Vernooij <jelmer@samba.org>2012-07-16 16:18:46 +0200
commita7d5d08191550de3205699834164ec1f7ef8aa15 (patch)
treecc6879963acc363297b0f4d1d1920ad6dd4616d1 /docs-xml/Makefile
parentc92a5670e3d60decbc13bd8680de37184bc12815 (diff)
downloadsamba-a7d5d08191550de3205699834164ec1f7ef8aa15.tar.gz
samba-a7d5d08191550de3205699834164ec1f7ef8aa15.tar.bz2
samba-a7d5d08191550de3205699834164ec1f7ef8aa15.zip
Revert "Remove XSLT script to generate image dependencies, instead rely on make"
This reverts commit c4493c22f129b2c94f361e6f8657adc7cd2dc1c6. Bug: https://bugzilla.samba.org/show_bug.cgi?id=7562 Conflicts: docs-xml/Makefile Autobuild-User(master): Jelmer Vernooij <jelmer@samba.org> Autobuild-Date(master): Mon Jul 16 16:18:46 CEST 2012 on sn-devel-104
Diffstat (limited to 'docs-xml/Makefile')
-rw-r--r--docs-xml/Makefile70
1 files changed, 53 insertions, 17 deletions
diff --git a/docs-xml/Makefile b/docs-xml/Makefile
index 40aa16108b..8cf05f771c 100644
--- a/docs-xml/Makefile
+++ b/docs-xml/Makefile
@@ -53,10 +53,15 @@ release:: manpages3 htmlman3 html pdf
clean::
@echo "Cleaning up..."
rm -rf $(OUTPUTDIR)/* $(DOCBOOKDIR)
- rm -f $(patsubst %.svg,%.png,$(wildcard */images/*.svg)) \
- $(patsubst %.svg,%.eps,$(wildcard */images/*.svg)) \
- $(patsubst %.png,%.eps,$(wildcard */images/*.png))
rm -f *-attributions.xml
+ rm -f $(patsubst %.svg,%.png,$(foreach DOC,$(MAIN_DOCS),$($(DOC)-images-latex-dia))) \
+ $(patsubst %.svg,%.pdf,$(foreach DOC,$(MAIN_DOCS),$($(DOC)-images-latex-svg))) \
+ $(patsubst %.svg,%.eps,$(foreach DOC,$(MAIN_DOCS),$($(DOC)-images-latex-svg))) \
+ $(patsubst %.svg,%.png,$(foreach DOC,$(MAIN_DOCS),$($(DOC)-images-latex-svg)))
+ 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
rm -f $(SMBDOTCONFDOC)/parameters.*.xml
rm -f build/catalog.xml
@@ -104,7 +109,7 @@ $(HTMLDIR)/index.html: htmldocs.html
@mkdir -p $(@D)
cp $< $@
-$(HTMLDIR)/%/index.html: $(DOCBOOKDIR)/%.xml $(HTMLDIR)/%/samba.css xslt/html-chunk.xsl
+$(HTMLDIR)/%/index.html: $(DOCBOOKDIR)/%.xml $(HTMLDIR)/%/samba.css xslt/html-chunk.xsl %-images-html-chunks
@mkdir -p $(@D)
$(XSLTPROC) --stringparam base.dir "$(HTMLDIR)/$*/" xslt/html-chunk.xsl $<
@@ -113,16 +118,7 @@ $(OUTPUTDIR)/%/samba.css: xslt/html/samba.css
@mkdir -p $(@D)
cp $< $@
-$(patsubst %,$(HTMLDIR)/%.html,$(MAIN_DOCS)): $(HTMLDIR)/%.html: %-images-png
-
-define IMAGES_TEMPLATE
-$(1)-images-png:: $$(patsubst %.svg,%.png,$$(wildcard $(1)/images/*.svg)) ;
-$(1)-images-eps:: $$(patsubst %.svg,%.eps,$$(wildcard $(1)/images/*.svg)) ;
-$(1)-images-eps:: $$(patsubst %.png,%.eps,$$(wildcard $(1)/images/*.png)) ;
-
-endef
-
-$(eval $(foreach DOC, $(MAIN_DOCS),$(call IMAGES_TEMPLATE,$(DOC))))
+$(patsubst %,$(HTMLDIR)/%.html,$(MAIN_DOCS)): $(HTMLDIR)/%.html: %-images-html-single
$(HTMLDIR)/%.html: $(DOCBOOKDIR)/%.xml $(HTMLDIR)/samba.css xslt/html.xsl
$(XSLTPROC) --output $@ xslt/html.xsl $<
@@ -144,12 +140,47 @@ $(TXTDIR)/%.txt: $(HTMLDIR)/%.html
@mkdir -p $(@D)
@$(DBLATEX) $(DBLATEX_OPTIONS) -t tex -o $@ $<
+# Dependency files
+%.d: $(DOCBOOKDIR)/%.xml xslt/generate-dependencies.xsl
+ @echo "Generating dependency file for $*"
+ @$(XSLTPROC) --novalid \
+ --stringparam txtbasedir "$(TXTDIR)/$*/" \
+ --stringparam target "$*" \
+ -o $@ xslt/generate-dependencies.xsl $<
+ @echo "$*-images-latex-svg = \$$(wildcard \$$(addsuffix .svg, \$$($*-images-latex)))" >> $@
+ @echo "$*-images-latex-eps: \$$(addsuffix .eps, \$$($*-images-latex))" >> $@
+ @echo "$*-images-latex-pdf: \$$(patsubst %.svg, %.pdf, \$$($*-images-latex-svg))" >> $@
+ @echo "$*-images-latex-png: \$$(filter-out \$$(patsubst %.svg,%.png,\$$($*-images-latex-svg)), \$$(addsuffix .png, \$$($*-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))" >> $@
+
+ifdef OUTPUTDIR
+ifneq ($(MAKECMDGOALS),clobber)
+-include $(addsuffix .d,$(MAIN_DOCS))
+endif
+endif
+
# Adobe PDF files
-$(PDFDIR)/%.pdf: %/index.xml $(PDFDIR) xslt/latex.xsl %-images-png
+$(PDFDIR)/%.pdf: %/index.xml $(PDFDIR) xslt/latex.xsl %-images-latex-png %-images-latex-pdf
$(DBLATEX) $(DBLATEX_OPTIONS) -I $*/images -t pdf -o $@ $<
# PostScript files
-$(PSDIR)/%.ps: %/index.xml $(PSDIR) xslt/latex.xsl %-images-eps
+$(PSDIR)/%.ps: %/index.xml $(PSDIR) xslt/latex.xsl %-images-latex-eps
$(DBLATEX) $(DBLATEX_OPTIONS) -I $*/images -t ps -o $@ $<
%.eps: %.svg
@@ -161,7 +192,7 @@ $(PSDIR)/%.ps: %/index.xml $(PSDIR) xslt/latex.xsl %-images-eps
%.eps: %.png
$(PNGTOPNM) $< | $(PNMTOPS) > $@
-$(HTMLHELPDIR)/%: $(DOCBOOKDIR)/%.xml %-images-png
+$(HTMLHELPDIR)/%: $(DOCBOOKDIR)/%.xml %-images-htmlhelp
$(XSLTPROC) --stringparam htmlhelp.chm $*.chm \
--stringparam manifest.in.base.dir "$@/" \
--stringparam base.dir "$@/" \
@@ -248,6 +279,11 @@ archive: pdf
# XSL scripts
xslt/html.xsl: xslt/html-common.xsl
xslt/html-chunk.xsl: xslt/html-common.xsl
+xslt/latex.xsl:
+xslt/expand-sambadoc.xsl:
+xslt/generate-attributions.xsl:
+xslt/man.xsl:
+xslt/pearson.xsl:
distclean clobber:: clean
rm -f Makefile.settings config.status config.log