57086f9b316bdbf0574ab72b8b238ec587e4a675
[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 update-pot:
18         xgettext ${XG_ARGS} -f ./POTFILES -d ${NAME} -o ./${NAME}.pot
19
20 %.pox: %.po
21         msgmerge -o $@ --previous $< ${NAME}.pot 
22
23 build:
24         for po in ${LINGUAS}; \
25         do msgfmt -c -o t-$${po} $${po}.po && mv -f t-$${po} $${po}.mo; \
26         done
27         
28
29 install: all install-dirs
30         for po in ${LINGUAS}; \
31         do install -m 0644 $${po}.mo ${DESTDIR}${LOCALEDIR}/$${po}/LC_MESSAGES/${NAME}.mo; \
32         done
33
34 install-dirs:
35         for po in ${LINGUAS}; \
36         do install -d ${DESTDIR}${LOCALEDIR}/$${po}/LC_MESSAGES; \
37         done
38
39 uninstall:
40         for po in ${LINGUAS}; \
41         do rm -f  ${DESTDIR}${LOCALEDIR}/$${po}/LC_MESSAGES/${NAME}.mo; \
42         done
43
44 clean-build:
45         rm -f *.mo
46
47 clean-pox:
48         rm -f *.pox
49
50 clean: clean-build
51         rm -f *~
52
53 .PHONY: all build install install-dirs uninstall clean clean-pox clean-build update-pot
54