chiark / gitweb /
po4a: pairwise-pocheck: Better handling for missing tcl
[dgit.git] / po4a / Makefile
index 3a3310db223dbc8b497976ab57dbef3832f54f84..e88aded12a1c948671a5d0da835e32fceb5df6ac 100644 (file)
 #   tree.
 #
 #   make targets:  install
+#
+# Check:
+#
+#   make targets:  check
+#                  pairwise-pocheck.check
 
 
 default: pofiles
 
-all: translated-always
+include ../i18n-common.make
+PO4A ?= po4a
 
-pofiles: po4a.cfg
-       po4a --no-translations $<
+all update: translated
 
-e=set -e; exec >$@.tmp
-f=mv -f $@.tmp $@
-o= >$@.tmp && $f
+check: po4a.cfg.check pairwise-pocheck.check
 
-S=@
-# Set S='' to see commands being run
+pofiles: po4a.cfg
+       $(PO4A) --no-translations $<
 
 translated: po4a.cfg
-       po4a $<
+       $(PO4A) $<
 
 po4a.cfg: list-documents
        ./$< $o
@@ -101,13 +104,16 @@ po4a.cfg.check: list-documents
        ./$< >$@.tmp
        diff po4a.cfg $@.tmp
 
+pairwise-pocheck.check:
+       ./pairwise-pocheck
+
 t = ../.po4a.translated-only
 p = ../po4a
 
-translated-only: po4a.cfg
+translated-only: po4a.cfg pairwise-pocheck.check
        rm -rf $t && mkdir $t
        cd $t && ln -s $p/*.po $p/*.pot $p/po4a.cfg .
-       cd $t && po4a po4a.cfg
+       cd $t && $(PO4A) po4a.cfg
        ! test -d $t/translated || \
        cp -al --remove-destination $t/translated .
 
@@ -118,8 +124,12 @@ translated-only: po4a.cfg
 
 .PRECIOUS: .po4a.%.cfg
 
-preview.%: .po4a.%.cfg
-       $S po4a $<
+pairwise-pocheck.%.check:
+       @tclsh /dev/null || printf ':;:; Please run   apt-get install tcl\n'
+       ./pairwise-pocheck $*
+
+preview.%: .po4a.%.cfg pairwise-pocheck.%.check
+       $S $(PO4A) $<
        $S ./install-documents >/dev/null .$*.translated $@
        @ echo '# runes to preview the various final tranlated manpages:'
        $S find $@ -type f -printf 'man -l %p\n'