1 |
include ../Makefile.config |
2 |
|
3 |
# Installation directories |
4 |
localedir = $(DESTDIR)/usr/share/locale |
5 |
|
6 |
PGOAL = $(NAME) |
7 |
|
8 |
# perl files to search translatable strings in |
9 |
PL_FILES:= ../tools/* ../lib/*.pm ../lib/*/*.pm |
10 |
|
11 |
POFILES = $(shell ls *.po) |
12 |
MOFILES = $(POFILES:%.po=%.mo) |
13 |
POTFILE= $(PGOAL).pot |
14 |
LANGS = $(POFILES:%.po=%) |
15 |
|
16 |
PREFIX = $(RPM_BUILD_ROOT)/usr |
17 |
DATADIR = $(PREFIX)/share |
18 |
LOCALEDIR=$(DATADIR)/locale |
19 |
|
20 |
all: $(MOFILES) |
21 |
|
22 |
install: all |
23 |
for l in $(LANGS); do \ |
24 |
install -d $(localedir)/$$l/LC_MESSAGES; \ |
25 |
install -m 644 $$l.mo $(localedir)/$$l/LC_MESSAGES/$(PGOAL).mo; \ |
26 |
done |
27 |
|
28 |
clean: |
29 |
rm -f *~ *.[oas] *.mo TAGS |
30 |
|
31 |
%.mo: %.po |
32 |
msgfmt -o $@ $< |
33 |
|
34 |
$(POTFILE): $(PL_FILES) |
35 |
perl_checker -q --generate-pot $@ $(PL_FILES) |
36 |
|
37 |
|
38 |
update_n_merge: $(PGOAL).pot merge |
39 |
|
40 |
merge: |
41 |
@for n in $(POFILES); do \ |
42 |
echo "Merging $$n"; \ |
43 |
msgmerge -C "$$n" "$$n" $(PGOAL).pot > "$$n"t; \ |
44 |
mv -f "$$n"t "$$n"; \ |
45 |
done |
46 |
|