chiark / gitweb /
"make developers-reference.{html,pdf,txt}" should work now
authordebacle <debacle@313b444b-1b9f-4f58-a734-7bb04f332e8d>
Wed, 27 Jun 2007 00:39:52 +0000 (00:39 +0000)
committerdebacle <debacle@313b444b-1b9f-4f58-a734-7bb04f332e8d>
Wed, 27 Jun 2007 00:39:52 +0000 (00:39 +0000)
git-svn-id: svn://anonscm.debian.org/ddp/developers-reference/trunk@4903 313b444b-1b9f-4f58-a734-7bb04f332e8d

Makefile

index c3f5a82..3af4f95 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,9 +1,6 @@
-# Makefile, used for the DDP manuals.sgml area
+# Makefile, used for the developers-reference in DocBook XML
 
-MANUAL         := $(notdir $(shell pwd))
-PUBLISHDIR     := /org/www.debian.org/www/doc/manuals
-
-SOURCES                := $(wildcard *.sgml)
+SOURCES                := $(wildcard *.dbk)
 
 LANGS           := fr
 TARGETS                := $(foreach fmt,html txt pdf,developers-reference.$(fmt)) \
@@ -23,7 +20,31 @@ nohtmllink   := echo "<!entity % htmltext \"IGNORE\">" > dynamic.ent
 make_directory := install -d -m 755
 install_file   := install -m 644 -p
 
-MAX_TEX_RECURSION := 5
+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
@@ -31,58 +52,31 @@ all:    $(TARGETS) dropold
 dropold:
        -rm -rf developers-reference.ja.html
 
-
 .PHONY: validate
-validate:      $(addsuffix .validate,$(SOURCES))
-
-# hmmm, this rule may need to be revised/tested
-.PHONY: publish
-publish:       all
-       [ -d $(PUBLISHDIR) ] || exit 1
-       rm -f $(PUBLISHDIR)/$(MANUAL)/*.html
-       $(make_directory) $(PUBLISHDIR)/$(MANUAL)
-       $(install_file) developers-reference*.html/*.html developers-reference*pdf      \
-          $(PUBLISHDIR)/$(MANUAL)
-       ln -sf index.en.html $(PUBLISHDIR)/$(MANUAL)/index.html
-       ln -sf developers-reference.pdf $(PUBLISHDIR)/$(MANUAL)/developers-reference.en.pdf
-
-developers-reference.html:     developers-reference.sgml
-       $(htmllink)
-       $(DEBIANDOC2HTML) -l en $<
+validate:
+       $(XL) index.dbk
 
-developers-reference.html/*:   developers-reference.html
+.PHONY: developers-reference.html
+developers-reference.html:     $(SOURCES)
+       $(XP) $(DBK2HTML) index.dbk
 
 developers-reference.%.html:   developers-reference.%.sgml
        $(htmllink)
        $(DEBIANDOC2HTML) -l $* $<
 
-developers-reference.txt:      developers-reference.sgml
-       $(nohtmllink)
-       $(DEBIANDOC2TEXT) -l en -O $< > $@
+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.tex:      developers-reference.sgml
-       $(nohtmllink)
-       $(DEBIANDOC2LATEX) -l en -O $< > $@
+developers-reference.fo:       $(SOURCES)
+       $(XP) $(DBK2FO) index.dbk > $@
 
-developers-reference.%.tex:    developers-reference.%.sgml
-       $(nohtmllink)
-       $(DEBIANDOC2LATEX) -l $* -O $< > $@
-
-developers-reference.ps:        developers-reference.sgml
-       $(nohtmllink)
-       $(DEBIANDOC2PS) -l en $<
-
-developers-reference.%.ps:      developers-reference.%.sgml
-       $(nohtmllink)
-       $(DEBIANDOC2PS) -l $* $<
-
-developers-reference.pdf:       developers-reference.sgml
-       $(nohtmllink)
-       $(DEBIANDOC2PDF) -l en $<
+developers-reference.pdf:       developers-reference.fo
+       $(FOP) -fo $< -pdf $@
 
 developers-reference.%.pdf:     developers-reference.%.sgml
        $(nohtmllink)
@@ -95,27 +89,9 @@ version.ent: debian/changelog
        nsgmls -wall -gues $<
        touch $@
 
-USERMAP        := ../../ddp/CVSROOT/users
-.PHONY: prepare
-prepare:       ChangeLog
-       cvs ci -m "update for next release" ChangeLog
-
-.PHONY: ChangeLog
-ChangeLog:
-       @[ -f CVS/Root -a -f $(USERMAP) ] || \
-               ( echo "usermap file '$(USERMAP)' not found" 1>&2; exit 1 )
-       cvs2cl -r --usermap $(USERMAP)
-
 .PHONY: clean
 clean:
-       rm -rf developers-reference*.html
-       rm -f developers-reference*.txt developers-reference*.pdf \
-             developers-reference*.ps developers-reference*.lout* lout.li \
-             developers-reference*.sasp* developers-reference*.tex \
-             developers-reference*.aux developers-reference*.toc \
-             developers-reference*.idx developers-reference*.log \
-             developers-reference*.out developers-reference*.dvi \
-             developers-reference*.tpt
+       rm -f *.fo *.html *.pdf *.txt
        rm -f version.ent
        rm -f `find . -name "*~" -o -name "*.bak"`
        rm -f *.validate
@@ -125,9 +101,5 @@ clean:
 distclean: clean
        rm -f *.rej *.orig
 
-developers-reference$(SRCEXT).sgml: version.ent common.ent
-
-html: $(MANUAL).html
-
 # if rule bomb out, delete the target
 .DELETE_ON_ERROR: