chiark / gitweb /
Put in place the new developers-reference and the new refcard.
[developers-reference.git] / Makefile
index 17f21688a69176936d5214ce7d8bb022dbb5c4c4..8b3d3582e9879a1f46af67ce12daef92b22b8fd9 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -10,6 +10,8 @@ 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
@@ -18,32 +20,26 @@ PUBDATE=unknown
 # programs for creating output
 XP=xsltproc --nonet --novalid --xinclude
 XL=xmllint --nonet --noout --postvalid --xinclude
-# fop is currently in contrib, but can go to main, see #366783
+# dblatex 0.2.8 has some problems (e.g. #465221 and Japanese does
+# not build)
 # Alternatives:
-# - dblatex (0.2.6 has a minor problem with programlisting inside of
-#   footnote, and a major one with lang="ja");
 # - docbook2pdf (seems to die on UTF-8, #431085); and
-# - xmllint (not mature enough, waits in NEW, #182445)
-FOP=fop
+# - 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
-# 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=$$TOP/fop.xsl
-#    $(DOCBOOK_XSL)/fo/docbook.xsl
+# for HTML output
+DBK2HTML=$(PWD)/html.xsl
+# all in one file for text output
+DBK2HTML1=$(PWD)/txt.xsl
 
 .PHONY:        all
-all:    $(TARGETS)
+all:    $(filter-out $(BLACKLIST), $(TARGETS))
 
 .PHONY: validate
 validate:                      $(SOURCES)
@@ -73,7 +69,7 @@ else
 $(LINGUA)/%.dbk:       %.dbk $(patsubst %.dbk,po4a/$(LINGUA)/%.po,%.dbk)
        $(TRANSLATE) -m $< -p po4a/$(@:.dbk=.po) -l $@
 
-$(LINGUA)/%.ent:       %.ent
+$(LINGUA)/common.ent:  common.ent
        cd $(@D) && ln -sf ../$(@F) .
 endif
 
@@ -82,15 +78,10 @@ developers-reference.txt:   $(PWD)/developers-reference.txt
        $(XP) $(DBK2HTML1) $(@D)/index.dbk \
            | w3m -cols 65 -dump -T text/html > $@
 
-developers-reference.fo:       $(PWD)/developers-reference.fo
-       @true
-
-%/developers-reference.fo:     $(addprefix %/,$(SOURCES)) fop.xsl
-       TOP=`pwd` && cd $(@D) && $(XP) $(DBK2FO) index.dbk > $(@F)
-
 developers-reference.pdf:       $(PWD)/developers-reference.pdf
-%/developers-reference.pdf:     %/developers-reference.fo
-       $(FOP) -fo $< -pdf $@
+%/developers-reference.pdf:     $(addprefix %/,$(SOURCES))
+       TOP=`pwd` && cd $(@D) && $(DBLATEX) index.dbk \
+           && mv index.dbk.pdf $(@F)
 
 .PHONY: pot
 pot:                           $(patsubst %.dbk,po4a/po/%.pot,$(SOURCES))
@@ -104,14 +95,14 @@ po4a/$(LINGUA)/%.po:               %.dbk
        po4a-updatepo --format docbook --master $< --po $@
 endif
 
-version.ent:
+%/version.ent:
        echo '<!ENTITY version "$(VERSION)">' >  $@
        echo '<!ENTITY pubdate "$(PUBDATE)">' >> $@
 
 .PHONY: clean
 clean:
        rm -f *.fo *.html *.pdf *.txt
-       rm -rf $(LANGS)
+       for L in $(LANGS); do rm -rf `basename ./"$$L"/`; done
        rm -f version.ent
        rm -f `find . -name "*~" -o -name "*.bak"`
        rm -f *~ *.bak .#* core