- 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
-
-developers-reference.html: developers-reference.sgml
- $(htmllink)
- $(DEBIANDOC2HTML) -l en $<
-
-developers-reference.html/*: developers-reference.html
-
-developers-reference.%.html: developers-reference.%.sgml
- $(htmllink)
- $(DEBIANDOC2HTML) -l $* $<
-
-developers-reference.txt: developers-reference.sgml
- $(nohtmllink)
- $(DEBIANDOC2TEXT) -l en -O $< > $@
-
-developers-reference.%.txt: developers-reference.%.sgml
- $(nohtmllink)
- $(DEBIANDOC2TEXT) -l $* -O $< > $@
-
-developers-reference.tex: developers-reference.sgml
- $(nohtmllink)
- $(DEBIANDOC2LATEX) -l en -O $< > $@
-
-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.%.sgml
- $(nohtmllink)
- $(DEBIANDOC2PDF) -l $* $<
-
-version.ent: debian/changelog
- ./debian/rules $@
-
-%.validate : % version.ent
- 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)
+ install -d -m 755 $(PUBLISHDIR)/developers-reference
+ rm -f $(PUBLISHDIR)/developers-reference/*.html
+ rm -f en && ln -sf . en
+ $(foreach format,$(FORMATS),$(foreach lang,en $(LANGS),for file in $(lang)/*.$(format); do if [ -e "$$file" ]; then cp --preserve=timestamps $$file $(PUBLISHDIR)/developers-reference/$$(basename $$file .$(format)).$(lang).$(format); fi; done;))
+ ln -sf index.en.html $(PUBLISHDIR)/developers-reference/index.html
+ ln -sf developers-reference.en.pdf $(PUBLISHDIR)/developers-reference/developers-reference.pdf
+ ln -sf developers-reference.en.txt $(PUBLISHDIR)/developers-reference/developers-reference.txt
+
+.PHONY: developers-reference.html %/developers-reference.html
+developers-reference.html: $(CURDIR)/index.html
+%/developers-reference.html: $(addprefix %/,index.html)
+ @true
+
+.PRECIOUS: %/index.html
+index.html: $(CURDIR)/developers-reference.html
+%/index.html: $(addprefix %/,$(SOURCES))
+ cd $(@D) && $(XP) $(DBK2HTML) index.dbk
+
+# There must be an easier way than recursive make!
+.PRECIOUS: %.dbk %.ent
+ifndef LINGUA
+%.dbk %.ent: FORCE
+ $(MAKE) $@ LINGUA=`basename $(@D)`
+
+FORCE:
+else
+$(LINGUA)/%.dbk: %.dbk $(patsubst %.dbk,po4a/$(LINGUA)/%.po,%.dbk)
+# $(TRANSLATE) -m $< -p po4a/$(@:.dbk=.po) -l $@ -a ?po4a/$(@:.dbk=.add)
+# workaround to "-a ?" only possible with po4a version in Squeeze, otherwise build is broken in Lenny
+ if [ -f po4a/$(@:.dbk=.add) ]; then \
+ $(TRANSLATE) -m $< -p po4a/$(@:.dbk=.po) -l $@ -a po4a/$(@:.dbk=.add); else \
+ $(TRANSLATE) -m $< -p po4a/$(@:.dbk=.po) -l $@; fi
+
+$(LINGUA)/common.ent: common.ent
+ cd $(@D) && ln -sf ../$(@F) .
+endif
+
+developers-reference.txt: $(CURDIR)/developers-reference.txt
+%/developers-reference.txt: $(addprefix %/,$(SOURCES))
+ $(XP) $(DBK2HTML1) $(@D)/index.dbk \
+ | w3m -o display_charset=UTF-8 -cols 70 -dump -no-graph -T text/html > $@
+
+developers-reference.pdf: $(CURDIR)/developers-reference.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))
+po4a/po/%.pot: %.dbk
+ po4a-gettextize --format docbook --master $< --po $@
+
+ifdef LINGUA
+.PHONY: updatepo
+updatepo: $(patsubst %.dbk,po4a/$(LINGUA)/%.po,$(SOURCES))
+po4a/$(LINGUA)/%.po: %.dbk
+ po4a-updatepo --previous --format docbook --master $< --po $@
+endif
+
+tidypo:
+ for po in $(wildcard po4a/*/*.po po4a/*/*.pot); do \
+ msgcat $$po > $$po.tmp && mv $$po.tmp $$po; \
+ done
+
+checkpo:
+ @for po in $(wildcard po4a/*/*.po po4a/*/*.pot); do \
+ echo $$po; \
+ msgfmt --check --verbose $$po; \
+ done
+
+%/version.ent:
+ echo '<!ENTITY version "$(VERSION)">' > $@
+ echo '<!ENTITY pubdate "$(PUBDATE)">' >> $@