# Makefile, used for the developers-reference in DocBook XML SOURCES := $(wildcard *.dbk) LANGS := fr TARGETS := $(foreach fmt,html txt pdf,developers-reference.$(fmt)) \ $(foreach langext,$(LANGS), \ $(foreach fmt,html txt pdf,developers-reference.$(langext).$(fmt))) # programs for creating output DEBIANDOC2HTML := debiandoc2html -c DEBIANDOC2TEXT := debiandoc2text DEBIANDOC2LATEX := debiandoc2latex DEBIANDOC2PS := debiandoc2latexps DEBIANDOC2PDF := debiandoc2latexpdf htmllink := echo "" > dynamic.ent nohtmllink := echo "" > dynamic.ent make_directory := install -d -m 755 install_file := install -m 644 -p XP=xsltproc --nonet --novalid --xinclude XL=xmllint --nonet --noout --postvalid --xinclude # note: the URL is used as identifier, no HTTP is used! DOCBOOK_XSL=http://docbook.sourceforge.net/release/xsl/current # one file per chapter DBK2HTML=--stringparam chunk.section.depth 0 \ --stringparam section.autolabel 1 \ --stringparam use.id.as.filename 1 \ $(DOCBOOK_XSL)/xhtml/chunk.xsl # all in one file DBK2HTML1=--stringparam section.autolabel 1 \ $(DOCBOOK_XSL)/xhtml/docbook.xsl DBK2FO=--stringparam double.sided 1 \ --stringparam draft.mode no \ --stringparam paper.type A4 \ $(DOCBOOK_XSL)/fo/docbook.xsl # fop is currently in contrib, but can go to main now, AFAIK # alternatives: docbook2pdf (seems to die on UTF-8), dblatex (0.2.4 # just hangs here) and xmllint (not mature enough, waits in NEW) FOP=fop .PHONY: all dropold all: $(TARGETS) dropold dropold: -rm -rf developers-reference.ja.html .PHONY: validate validate: $(XL) index.dbk .PHONY: developers-reference.html developers-reference.html: $(SOURCES) $(XP) $(DBK2HTML) index.dbk developers-reference.%.html: developers-reference.%.sgml $(htmllink) $(DEBIANDOC2HTML) -l $* $< developers-reference.txt: $(SOURCES) $(XP) $(DBK2HTML1) index.dbk \ | w3m -cols 65 -dump -T text/html > $@ developers-reference.%.txt: developers-reference.%.sgml $(nohtmllink) $(DEBIANDOC2TEXT) -l $* -O $< > $@ developers-reference.fo: $(SOURCES) $(XP) $(DBK2FO) index.dbk > $@ developers-reference.pdf: developers-reference.fo $(FOP) -fo $< -pdf $@ developers-reference.%.pdf: developers-reference.%.sgml $(nohtmllink) $(DEBIANDOC2PDF) -l $* $< version.ent: debian/changelog ./debian/rules $@ %.validate : % version.ent nsgmls -wall -gues $< touch $@ .PHONY: clean clean: rm -f *.fo *.html *.pdf *.txt rm -f version.ent rm -f `find . -name "*~" -o -name "*.bak"` rm -f *.validate rm -f *~ *.bak .#* core .PHONY: distclean distclean: clean rm -f *.rej *.orig # if rule bomb out, delete the target .DELETE_ON_ERROR: