chiark / gitweb /
Fixed all examples, fixed many (not all, yet) entities.
[developers-reference.git] / Makefile
index 8dfc96d0efd28f729c5a3786b91f6718cb0b3e68..2dfbe39998ed8c11d1521fdcae819c004595fb2e 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,6 +1,6 @@
 # Makefile, used for the developers-reference in DocBook XML
 
-SOURCES                := $(wildcard *.dbk)
+SOURCES                := $(wildcard *.dbk *.ent)
 
 FORMATS                := html txt pdf
 LANGS           := fr ja
@@ -12,8 +12,11 @@ TARGETS              := $(foreach fmt,$(FORMATS),developers-reference.$(fmt)) \
 XP=xsltproc --nonet --novalid --xinclude
 XL=xmllint --nonet --noout --postvalid --xinclude
 # fop is currently in contrib, but can go to main, see #366783
-# alternatives: docbook2pdf (seems to die on UTF-8), dblatex (0.2.4
-# just hangs here) and xmllint (not mature enough, waits in NEW)
+# 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
 # The "-k 0" should be removed as soon as the translations are ready
 TRANSLATE=po4a-translate -f docbook -k 0
@@ -36,9 +39,12 @@ DBK2FO=$$TOP/fop.xsl
 all:    $(TARGETS)
 
 .PHONY: validate
-validate:
+validate:                      $(SOURCES)
        $(XL) index.dbk
 
+%/validate:                    $(addprefix %/,$(SOURCES))
+       cd $(@D) && $(XL) index.dbk
+
 .PHONY: developers-reference.html %/developers-reference.html
 developers-reference.html:     $(PWD)/index.html
 %/developers-reference.html:   $(addprefix %/,index.html)
@@ -47,18 +53,20 @@ developers-reference.html:  $(PWD)/index.html
 .PRECIOUS:                     %/index.html
 index.html:                    $(PWD)/developers-reference.html
 %/index.html:                  $(addprefix %/,$(SOURCES))
-       mkdir -p $(@D) || true
        cd $(@D) && $(XP) $(DBK2HTML) index.dbk
 
 # There must be an easier way than recursive make!
-.PRECIOUS:             %.dbk
+.PRECIOUS:             %.dbk %.ent
 ifndef LINGUA
-%.dbk: FORCE
-       [ "$$LINGUA" = . ] || make $@ LINGUA=$(@D)
+%.dbk %.ent: FORCE
+       [ "$$LINGUA" = . ] || $(MAKE) $@ LINGUA=$(@D)
 FORCE:
 else
 $(LINGUA)/%.dbk:       %.dbk $(patsubst %.dbk,po4a/$(LINGUA)/%.po,%.dbk)
        $(TRANSLATE) -m $< -p po4a/$(@:.dbk=.po) -l $@
+
+$(LINGUA)/%.ent:       %.ent
+       cd $(@D) && ln -sf ../$(@F) .
 endif
 
 developers-reference.txt:      $(PWD)/developers-reference.txt