summaryrefslogtreecommitdiffstats
path: root/live/draklive-install/po/Makefile
blob: 31afe5c45418c77f998dfd87b1d908e025288c83 (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
NAME = draklive-install
localedir = ${prefix}/share/locale
PL_FILES = ../$(NAME) $(shell find .. -type f -name "*pm")

POFILES = $(shell for i in ../../../perl-install/share/po/*.po; do basename $$i; done)
MOFILES = $(POFILES:%.po=%.mo)
LANGS = $(POFILES:%.po=%)

all: $(NAME).pot $(POFILES) $(MOFILES)

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

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

$(NAME).pot:
	xgettext -F -n --from-code --add-comments='I18N' \
	--keyword=_ --keyword=__ --keyword=N_ --keyword=N \
	-o $@ $(PL_FILES)

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) $(NAME).pot