Drop Indonesian translation
[clawsker.git] / po / Makefile
1 #
2 # Clawsker po Makefile
3 # Copyright 2007-2018 Ricardo Mones <ricardo@mones.org>
4 #
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.
9 #
10 # See COPYING file for license details.
11 #
12
13 NAME = clawsker
14 TITLE = \# Translatable strings for Clawsker
15 COPYR = \# Copyright (C) 2007 Ricardo Mones <ricardo@mones.org>
16 VERSION ?= $(shell git describe)
17 PREFIX ?= /usr/local
18 DATADIR = ${PREFIX}/share
19 LOCALEDIR = ${DATADIR}/locale
20
21 XG_ARGS = --keyword=_ --flag=_:1:pass-java-format -L Perl -w 80 --package-name=${NAME} --package-version=${VERSION} --msgid-bugs-address=ricardo@mones.org --from-code=UTF-8
22 LINGUAS = es fr nl pt_BR sv nb de ca tr da zh_TW pt_PT
23
24 all: build
25
26 ${NAME}.pot.0:
27         xgettext ${XG_ARGS} -f ./POTFILES -d ${NAME} -o $@
28
29 # remove bogus entry about_title
30 ${NAME}.pot.1: ${NAME}.pot.0
31         head -17 $< > $@
32         tail -$(shell expr $(shell wc -l < $<) - 22 ) $< >> $@
33         rm -f $<
34
35 update-pot: ${NAME}.pot.1
36         sed 's,^# SOME DESC.*,${TITLE},;s,^# Copyright.*,${COPYR},' < $< > ${NAME}.pot
37         rm -f $<
38
39 %.pox: %.po
40         msgmerge -o $@ --previous $< ${NAME}.pot 
41
42 build:
43         for po in ${LINGUAS}; \
44         do msgfmt -v --statistics -c -o t-$${po} $${po}.po && mv -f t-$${po} $${po}.mo; \
45         done
46         
47
48 install: all install-dirs
49         for po in ${LINGUAS}; \
50         do install -m 0644 $${po}.mo ${DESTDIR}${LOCALEDIR}/$${po}/LC_MESSAGES/${NAME}.mo; \
51         done
52
53 install-dirs:
54         for po in ${LINGUAS}; \
55         do install -d ${DESTDIR}${LOCALEDIR}/$${po}/LC_MESSAGES; \
56         done
57
58 uninstall:
59         for po in ${LINGUAS}; \
60         do rm -f  ${DESTDIR}${LOCALEDIR}/$${po}/LC_MESSAGES/${NAME}.mo; \
61         done
62
63 clean-build:
64         rm -f *.mo
65
66 clean-pox:
67         rm -f *.pox
68
69 clean: clean-build
70         rm -f *~
71
72 .PHONY: all build install install-dirs uninstall clean clean-pox clean-build update-pot
73