|
Revision 1, 1.1 kB
(checked in by mjoc, 2 years ago)
|
Initial import.
|
| Line | |
|---|
| 1 |
POFILES=$(wildcard *.po) |
|---|
| 2 |
MOFILES=$(POFILES:.po=.mo) |
|---|
| 3 |
|
|---|
| 4 |
all: messages.pot $(MOFILES) |
|---|
| 5 |
|
|---|
| 6 |
install: all |
|---|
| 7 |
for file in $(MOFILES); do \ |
|---|
| 8 |
lang=`echo $$file | sed 's/\.mo//'`; \ |
|---|
| 9 |
install -d $(prefix)/usr/share/locale/$$lang/LC_MESSAGES/; \ |
|---|
| 10 |
install -m 0644 $$file $(prefix)/usr/share/locale/$$lang/LC_MESSAGES/opendict.mo; \ |
|---|
| 11 |
done |
|---|
| 12 |
|
|---|
| 13 |
messages.pot: |
|---|
| 14 |
@echo "Rebuilding the pot file" |
|---|
| 15 |
rm -f *.pot |
|---|
| 16 |
test -f /usr/bin/pygettext && /usr/bin/pygettext -v ../opendict.py ../lib/*.py ../lib/gui/*.py || echo |
|---|
| 17 |
test -f /usr/bin/pygettext.py && /usr/bin/pygettext.py -v ../opendict.py ../lib/*.py ../lib/gui/*.py || echo |
|---|
| 18 |
cp messages.pot opendict.pot |
|---|
| 19 |
rm -f messages.pot |
|---|
| 20 |
|
|---|
| 21 |
%.mo: %.po |
|---|
| 22 |
msgfmt --verbose --check -o $@ $< |
|---|
| 23 |
|
|---|
| 24 |
%.po: messages.pot |
|---|
| 25 |
@echo -n "Merging opendict.pot and $@" |
|---|
| 26 |
@msgmerge $@ opendict.pot -o $@.new |
|---|
| 27 |
@if [ "`diff $@ $@.new | grep '[<>]' | wc -l`" -ne 2 ]; then \ |
|---|
| 28 |
mv -f $@.new $@; \ |
|---|
| 29 |
else \ |
|---|
| 30 |
rm -f $@.new; \ |
|---|
| 31 |
fi |
|---|
| 32 |
@msgfmt --statistics $@ |
|---|
| 33 |
|
|---|
| 34 |
clean: |
|---|
| 35 |
rm -f $(MOFILES) messages messages.mo |
|---|
| 36 |
|
|---|
| 37 |
uninstall: |
|---|
| 38 |
for file in $(MOFILES); do \ |
|---|
| 39 |
lang=`echo $$file | sed 's/\.mo//'`; \ |
|---|
| 40 |
rm -f $(prefix)/usr/share/locale/$$lang/LC_MESSAGES/opendict.mo; \ |
|---|
| 41 |
done |
|---|