raise upper limit
[clawsker.git] / po / Makefile
index ab9a31e1e5028eec56280d408654f2e04df39847..fc1686a39abe2d917f9d98d76b97acd036c867c2 100644 (file)
@@ -4,27 +4,37 @@
 #
 
 NAME = clawsker
+VERSION = $(shell cat ../VERSION)
 PREFIX ?= /usr/local
 DATADIR = ${PREFIX}/share
 LOCALEDIR = ${DATADIR}/locale
 
-XG_ARGS = "--keyword=_ --flag=_:1:pass-java-format -L Perl -w 80"
-LINGUAS = "es"
+XG_ARGS = --keyword=_ --flag=_:1:pass-java-format -L Perl -w 80 --package-name=${NAME} --package-version=${VERSION} --msgid-bugs-address=ricardo@mones.org
+LINGUAS = es sr sr@latin fr it id pt_BR
 
 all: build
 
-update-pot:
-       xgettext ${XG_ARGS} -f ./POTFILES -d ${NAME} -o ./${NAME}.pot
+${NAME}.pot.0:
+       xgettext ${XG_ARGS} -f ./POTFILES -d ${NAME} -o ./${NAME}.pot.0
+
+# remove bogus entry win_title
+update-pot: ${NAME}.pot.0
+       head -17 ./${NAME}.pot.0 > ./${NAME}.pot
+       tail -$(shell expr $(shell wc -l < ./${NAME}.pot.0) - 22 ) ./${NAME}.pot.0 >> ./${NAME}.pot
+       rm -f ./${NAME}.pot.0
+
+%.pox: %.po
+       msgmerge -o $@ --previous $< ${NAME}.pot 
 
 build:
        for po in ${LINGUAS}; \
-       do msgfmt -c -o t-$${po} $${po}.po && mv -f t-$${po} $${po}.mo; \
+       do msgfmt -v --statistics -c -o t-$${po} $${po}.po && mv -f t-$${po} $${po}.mo; \
        done
        
 
 install: all install-dirs
        for po in ${LINGUAS}; \
-       do install -m 0755 $${po}.mo ${DESTDIR}${LOCALEDIR}/$${po}/LC_MESSAGES/${NAME}.mo; \
+       do install -m 0644 $${po}.mo ${DESTDIR}${LOCALEDIR}/$${po}/LC_MESSAGES/${NAME}.mo; \
        done
 
 install-dirs:
@@ -38,9 +48,13 @@ uninstall:
        done
 
 clean-build:
+       rm -f *.mo
+
+clean-pox:
+       rm -f *.pox
 
-clean:
-       rm -f *.mo *~
+clean: clean-build
+       rm -f *~
 
-.PHONY: all build install install-dirs uninstall clean clean-build update-pot
+.PHONY: all build install install-dirs uninstall clean clean-pox clean-build update-pot