3 # Copyright 2007-2016 Ricardo Mones <ricardo@mones.org>
5 # This program is free software: you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation, either version 3 of the License, or
8 # (at your option) any later version.
10 # See COPYING file for license details.
14 VERSION ?= $(shell git describe)
16 DATADIR = ${PREFIX}/share
17 LOCALEDIR = ${DATADIR}/locale
19 XG_ARGS = --keyword=_ --flag=_:1:pass-java-format -L Perl -w 80 --package-name=${NAME} --package-version=${VERSION} --msgid-bugs-address=ricardo@mones.org
20 LINGUAS = es fr nl pt_BR sv nb de ca tr da id
25 xgettext ${XG_ARGS} -f ./POTFILES -d ${NAME} -o ./${NAME}.pot.0
27 # remove bogus entry win_title
28 update-pot: ${NAME}.pot.0
29 head -17 ./${NAME}.pot.0 > ./${NAME}.pot
30 tail -$(shell expr $(shell wc -l < ./${NAME}.pot.0) - 22 ) ./${NAME}.pot.0 >> ./${NAME}.pot
34 msgmerge -o $@ --previous $< ${NAME}.pot
37 for po in ${LINGUAS}; \
38 do msgfmt -v --statistics -c -o t-$${po} $${po}.po && mv -f t-$${po} $${po}.mo; \
42 install: all install-dirs
43 for po in ${LINGUAS}; \
44 do install -m 0644 $${po}.mo ${DESTDIR}${LOCALEDIR}/$${po}/LC_MESSAGES/${NAME}.mo; \
48 for po in ${LINGUAS}; \
49 do install -d ${DESTDIR}${LOCALEDIR}/$${po}/LC_MESSAGES; \
53 for po in ${LINGUAS}; \
54 do rm -f ${DESTDIR}${LOCALEDIR}/$${po}/LC_MESSAGES/${NAME}.mo; \
66 .PHONY: all build install install-dirs uninstall clean clean-pox clean-build update-pot