+SOURCES := $(wildcard *.dbk) common.ent version.ent
+
+FORMATS := html txt pdf
+LANGS := fr ja
+TARGETS := $(foreach fmt,$(FORMATS),developers-reference.$(fmt)) \
+ $(foreach lng,$(LANGS), \
+ $(foreach fmt,$(FORMATS), \
+ $(lng)/developers-reference.$(fmt)))
+# list of targets, that currently cannot build
+BLACKLIST := ja/developers-reference.pdf
+
+# hopefully overwritten by caller, e.g. debian/rules
+VERSION=unknown
+PUBDATE=unknown
+
+# programs for creating output
+XP=xsltproc --nonet --novalid --xinclude
+XL=xmllint --nonet --noout --postvalid --xinclude
+# dblatex 0.2.8 has some problems (e.g. #465221 and Japanese does
+# not build)
+# Alternatives:
+# - docbook2pdf (seems to die on UTF-8, #431085); and
+# - fop is currently in contrib, but can go to main, see #366783
+# - xmlroff (not mature enough, #182445)
+DBLATEX=dblatex --style=db2latex
+# The "--keep 0" should be removed as soon as the translations are ready
+TRANSLATE=po4a-translate --format docbook --keep 0
+
+# XSL files and parameters
+# note: the URL is used as identifier, no HTTP is used!
+DOCBOOK_XSL=http://docbook.sourceforge.net/release/xsl/current
+# for HTML output
+DBK2HTML=$(CURDIR)/html.xsl
+# all in one file for text output
+DBK2HTML1=$(CURDIR)/txt.xsl
+
+.PHONY: all
+all: $(filter-out $(BLACKLIST), $(TARGETS))
+
+.PHONY: validate
+validate: $(SOURCES)
+ $(XL) index.dbk
+
+%/validate: $(addprefix %/,$(SOURCES))
+ cd $(@D) && $(XL) index.dbk
+
+# This rule controls the build and installation on the website
+# Logs are here: http://www-master.debian.org/build-logs/ddp/
+.PHONY: publish
+publish: all