summaryrefslogtreecommitdiffstats
path: root/perl-install/share/po/Makefile
blob: 0466e88ed6f9e4f86d5f0b3d4d82ec806c33d0b7 (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
include ../../Makefile.config

PMSFILES = $(wildcard $(PMS:%=../../%))
PMSCFILES = $(PMSFILES:%=%_.c)
POFILES = $(shell ls *.po)

all: $(POFILES)

clean:
	rm -f empty.po messages $(POFILES:%=%t) $(PMSCFILES)

verif:
	perl -ne '/^\s*#/ or $$i += my @l = /\b__?\(/g; END { print "$$i\n" }' $(PMSFILES)
	perl -ne '$$i += my @l = /\.c:/g; END { print "$$i\n" }' DrakX.pot

$(POFILES): DrakX.pot
	cp -f $@ $@t
	msgmerge $@t $< > $@
	rm $@t

DrakX.pot: $(PMSFILES)
	$(MAKE) $(PMSCFILES);
	xgettext -F -n --add-comments='-PO' --keyword=_ --keyword=__ -o $@ $(PMSCFILES)
	rm $(PMSCFILES)

$(PMSCFILES): %_.c: %
	perl -pe 's|^(__?\()| $$1|; s,(^|[^\$$])#([^+].*),\1/*\2*\/,; s|$$|\\n\\|' $< > $@

#	for i in *.po; do echo -n "$i "; msgfmt -v $i 2>&1; done | perl -e 'print map { $_->[0] } sort { $a->[1] <=> $b->[1] } map { [ $_, (split)[1] ] } <>'