aboutsummaryrefslogtreecommitdiffstats
path: root/po/Makefile
blob: 5aeda3c4d279d1df442cd82ca30d2a1a0dd61edf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
NAME = qarepo

LOCALEDIR = $(DESTDIR)/usr/share/locale

PL_FILE = ../$(NAME)
DT_FILE = ../$(NAME).desktop.in

POFILES = $(wildcard *.po)
MOFILES = $(POFILES:%.po=%.mo)
LANGS = $(POFILES:%.po=%)

all: $(MOFILES)

%.mo: %.po
	msgfmt -o $@ $<

update: $(NAME).pot

$(NAME).pot: $(PL_FILE) $(DT_FILE)
	xgettext --language=perl --keyword=N --add-comments=PO: --output tmp1.pot $(PL_FILE)
	intltool-update --pot --gettext-package tmp2
	msgcat --use-first tmp1.pot tmp2.pot > $@
	@rm -r tmp*.pot

install: all
	for l in $(LANGS); do \
		install -d $(LOCALEDIR)/$$l/LC_MESSAGES; \
		install -m 644 $$l.mo $(LOCALEDIR)/$$l/LC_MESSAGES/$(NAME).mo; \
	done

clean:
	@rm -rf *.mo $(POFILES:%=%t)