Projet

Général

Profil

Télécharger (1,13 ko) Statistiques
| Branche: | Révision:

root / larpe / tags / release-1.1.1 / po / Makefile @ d03cb81c

1
prefix = /usr
2

    
3
POFILES=$(wildcard *.po)
4
MOFILES=$(POFILES:.po=.mo)
5
PYFILES=$(shell find -L ../larpe -name '*.py' -or -name '*.ptl')
6
RM=rm -f
7

    
8
all: $(MOFILES)
9

    
10
install: all
11
	for file in $(MOFILES); do \
12
		lang=`echo $$file | sed 's/\.mo//'`; \
13
		install -d $(DESTDIR)$(prefix)/share/locale/$$lang/LC_MESSAGES/; \
14
		install -m 0644 $$file $(DESTDIR)$(prefix)/share/locale/$$lang/LC_MESSAGES/larpe.mo; \
15
	done
16

    
17
uninstall:
18
	@for file in $(MOFILES); do \
19
		lang=`echo $$file | sed 's/\.mo//'`; \
20
		$(RM) $(DESTDIR)$(prefix)/share/locale/$$lang/LC_MESSAGES/larpe.mo; \
21
	done
22

    
23
clean:
24
	-$(RM) messages.mo $(MOFILES)
25

    
26
larpe.pot: $(PYFILES)
27
	@echo "Rebuilding the pot file"
28
	$(RM) larpe.pot tmp.*.pot
29
	cnt=0;
30
	for file in $(PYFILES); do \
31
		cnt=$$(expr $$cnt + 1); \
32
		bn=$$cnt.`basename $$file`; \
33
		xgettext --keyword=N_ -c -L Python -o tmp.$$bn.pot $$file; \
34
	done
35
	msgcat tmp.*.pot > larpe.pot
36
	$(RM) tmp.*.pot
37

    
38
%.mo: %.po
39
	msgfmt -o $@ $<
40

    
41
%.po: larpe.pot
42
	@echo -n "Merging larpe.pot and $@"
43
	@msgmerge $@ larpe.pot -o $@.new
44
	@if [ "`diff $@ $@.new | grep '[<>]' | wc -l`" -ne 2 ]; then \
45
		mv -f $@.new $@; \
46
	else \
47
		$(RM) $@.new; \
48
	fi
49
	@msgfmt --statistics $@
(1-1/3)