| 1 |
DESTDIR = |
| 2 |
|
| 3 |
SRCFILES = ../uhope.c ../mh-ide.py |
| 4 |
POFILES = $(wildcard *.po) |
| 5 |
MOFILES = $(patsubst %.po, %.mo, $(POFILES)) |
| 6 |
LANG = $(patsubst %.po, %, $(POFILES)) |
| 7 |
|
| 8 |
all: $(MOFILES) |
| 9 |
|
| 10 |
$(POFILES): messages.pot |
| 11 |
|
| 12 |
%.mo: %.po |
| 13 |
msgfmt $< -o $@ |
| 14 |
|
| 15 |
messages.pot: $(SRCFILES) |
| 16 |
if [ -f $@ ]; then \ |
| 17 |
xgettext --keyword=N_ --keyword=_ -o $@ $(SRCFILES) --join-existing; \ |
| 18 |
else \ |
| 19 |
xgettext --keyword=N_ --keyword=_ -o $@ $(SRCFILES); \ |
| 20 |
fi |
| 21 |
|
| 22 |
clean: |
| 23 |
rm -f *~ *.mo |
| 24 |
|
| 25 |
$(POFILES): messages.pot |
| 26 |
msgmerge --update --previous $@ $< |
| 27 |
|
| 28 |
install: all |
| 29 |
for l in $(LANG); do \ |
| 30 |
install -d $(DESTDIR)/usr/share/locale/$$l/LC_MESSAGES; \ |
| 31 |
install -m 644 $$l.mo $(DESTDIR)/usr/share/locale/$$l/LC_MESSAGES/uhope.mo; \ |
| 32 |
done |
| 33 |
|
| 34 |
.PHONY: all install clean |