| 1 |
# |
|---|
| 2 |
# Copyright (C) 2006-2007 Travis Shirk <travis@pobox.com> |
|---|
| 3 |
# |
|---|
| 4 |
# This program is free software; you can redistribute it and/or modify |
|---|
| 5 |
# it under the terms of the GNU General Public License as published by |
|---|
| 6 |
# the Free Software Foundation; either version 2 of the License, or |
|---|
| 7 |
# (at your option) any later version. |
|---|
| 8 |
# |
|---|
| 9 |
# This program is distributed in the hope that it will be useful, |
|---|
| 10 |
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
|---|
| 11 |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|---|
| 12 |
# GNU General Public License for more details. |
|---|
| 13 |
# |
|---|
| 14 |
# You should have received a copy of the GNU General Public License |
|---|
| 15 |
# along with this program; if not, write to the Free Software |
|---|
| 16 |
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
|---|
| 17 |
# |
|---|
| 18 |
NAME = mesk |
|---|
| 19 |
LANGS = sv |
|---|
| 20 |
LANGS_PO:=$(foreach LANG, ${LANGS}, ${LANG}.po) |
|---|
| 21 |
LANGS_MO:=$(foreach LANG, ${LANGS}, ${LANG}.mo) |
|---|
| 22 |
PYTHON_FILES = $(shell find ../src -name \*.py) |
|---|
| 23 |
GLADE_FILES = $(shell find ../src -name \*.glade) |
|---|
| 24 |
|
|---|
| 25 |
prefix=@prefix@ |
|---|
| 26 |
datadir:=$(subst //,/,${DESTDIR}/@datarootdir@) |
|---|
| 27 |
prefix:=$(subst //,/,${DESTDIR}/${prefix}) |
|---|
| 28 |
|
|---|
| 29 |
all: mesk.pot ${LANGS_PO} catalogs |
|---|
| 30 |
|
|---|
| 31 |
POTFILES.in: |
|---|
| 32 |
-rm $@ |
|---|
| 33 |
echo '[encoding: UTF-8]' >> $@ |
|---|
| 34 |
echo etc/mesk.desktop.in >> $@ |
|---|
| 35 |
cd .. && find src -name \*.glade | sort >> po/$@ |
|---|
| 36 |
cd .. && find src -name \*.py | sort >> po/$@ |
|---|
| 37 |
|
|---|
| 38 |
mesk.pot: POTFILES.in ../etc/mesk.desktop.in ${PYTHON_FILES} ${GLADE_FILES} |
|---|
| 39 |
intltool-update --pot --gettext-package=${NAME} |
|---|
| 40 |
|
|---|
| 41 |
%.po: mesk.pot |
|---|
| 42 |
intltool-update --dist --gettext-package=${NAME} $* |
|---|
| 43 |
|
|---|
| 44 |
catalogs: ${LANGS_MO} |
|---|
| 45 |
%.mo: %.po |
|---|
| 46 |
msgfmt $< -o $@ |
|---|
| 47 |
|
|---|
| 48 |
check: $(addprefix check-, ${LANGS}) |
|---|
| 49 |
|
|---|
| 50 |
check-%: %.po |
|---|
| 51 |
msgfmt -c $< |
|---|
| 52 |
|
|---|
| 53 |
clean: |
|---|
| 54 |
rm POTFILES.in |
|---|
| 55 |
-rm *.mo |
|---|
| 56 |
maintainer-clean: |
|---|
| 57 |
${MAKE} distclean |
|---|
| 58 |
|
|---|
| 59 |
# These are the only targets called from the top-level Makefile |
|---|
| 60 |
install: |
|---|
| 61 |
# Install language files |
|---|
| 62 |
for l in ${LANGS}; do\ |
|---|
| 63 |
dir=${datadir}/locale/$${l}/LC_MESSAGES;\ |
|---|
| 64 |
if test ! -d $${dir}; then\ |
|---|
| 65 |
install -m 755 -d $${dir};\ |
|---|
| 66 |
fi;\ |
|---|
| 67 |
install -m 644 $${l}.mo $${dir}/${NAME}.mo;\ |
|---|
| 68 |
done |
|---|
| 69 |
distclean: |
|---|
| 70 |
-rm Makefile |
|---|
| 71 |
|
|---|
| 72 |
.PHONY: check check-% clean distclean maintainer-clean |
|---|