summaryrefslogtreecommitdiffstats
path: root/perl-install/standalone/po/Makefile
blob: 6de29edf92498f533346b58fc752643b6f33641a (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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
include ../../Makefile.config

NAME = libDrakX-standalone
LOCALEDIR = $(DATADIR)/locale
PMSFILES = $(STANDALONEPMS_)
PMSFILES_HERE = $(wildcard $(PMSFILES:%=../%))
top_srcdir=..

MAIN_PO_FILES = ../../share/po/libDrakX.pot

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

default: $(MOFILES)

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

update_n_merge: $(NAME).pot merge

merge:
	for n in $(POFILES); do \
	  echo "Merging $$n"; \
	  msgmerge $$n $(NAME).pot > "$$n"t ; \
	  mv -f "$$n"t $$n ; \
	done

$(NAME).pot: $(PMSFILES_HERE) POTFILES.in
	intltool-update --gettext-package desktopstuff --pot
	cd .. ; perl_checker -q --generate-pot po/.$@ $(PMSFILES)
	xgettext $(MAIN_PO_FILES:%=-x %) -o ..$@ .$@
	msgcat --use-first .$@ desktopstuff.pot > $@
	rm -f desktopstuff.pot $(NAME)_tmp.pot .$@ ..$@

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

POTFILES.in:
	(cd .. ; /bin/ls menu/*.desktop.in) > POTFILES.in


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