fix version in pot
[clawsker.git] / po / Makefile
1 #
2 # Clawsker po makefile
3 # $Id$
4 #
5
6 NAME = clawsker
7 VERSION = $(shell cat ../VERSION)
8 PREFIX ?= /usr/local
9 DATADIR = ${PREFIX}/share
10 LOCALEDIR = ${DATADIR}/locale
11
12 XG_ARGS = --keyword=_ --flag=_:1:pass-java-format -L Perl -w 80 --package-name=${NAME} --package-version=${VERSION} --msgid-bugs-address=ricardo@mones.org
13 LINGUAS = es sr sr@latin fr it
14
15 all: build
16
17 ${NAME}.pot.0:
18         xgettext ${XG_ARGS} -f ./POTFILES -d ${NAME} -o ./${NAME}.pot.0
19
20 # remove bogus entry win_title
21 update-pot: ${NAME}.pot.0
22         head -17 ./${NAME}.pot.0 > ./${NAME}.pot
23         tail -$(shell expr $(shell wc -l < ./${NAME}.pot.0) - 21 ) ./${NAME}.pot.0 >> ./${NAME}.pot
24         rm -f ./${NAME}.pot.0
25
26 %.pox: %.po
27         msgmerge -o $@ --previous $< ${NAME}.pot 
28
29 build:
30         for po in ${LINGUAS}; \
31         do msgfmt -c -o t-$${po} $${po}.po && mv -f t-$${po} $${po}.mo; \
32         done
33         
34
35 install: all install-dirs
36         for po in ${LINGUAS}; \
37         do install -m 0644 $${po}.mo ${DESTDIR}${LOCALEDIR}/$${po}/LC_MESSAGES/${NAME}.mo; \
38         done
39
40 install-dirs:
41         for po in ${LINGUAS}; \
42         do install -d ${DESTDIR}${LOCALEDIR}/$${po}/LC_MESSAGES; \
43         done
44
45 uninstall:
46         for po in ${LINGUAS}; \
47         do rm -f  ${DESTDIR}${LOCALEDIR}/$${po}/LC_MESSAGES/${NAME}.mo; \
48         done
49
50 clean-build:
51         rm -f *.mo
52
53 clean-pox:
54         rm -f *.pox
55
56 clean: clean-build
57         rm -f *~
58
59 .PHONY: all build install install-dirs uninstall clean clean-pox clean-build update-pot
60