summaryrefslogtreecommitdiffstats
path: root/perl-install/share/po/Makefile
blob: 9f3f08d30ff2728ac77a5a276d78e4626695044e (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
PMSFILES = $(shell find .. -name "*.pm" | grep -v "^../po" | grep -v "^../c/")
PMSCFILES = $(PMSFILES:%=%_.c)
POFILES = $(shell ls *.po | grep -v empty.po)
FROMPOFILES = $(POFILES:%.po=%.pm)

all: $(FROMPOFILES)

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

$(FROMPOFILES): %.pm: %.po
	./po2perl < $< > $@

$(POFILES): empty.po
	cp -f $@ $@t
	msgmerge $@t $< > $@
	rm $@t

empty.po: $(PMSFILES)
	$(MAKE) $(PMSCFILES);
	xgettext -F -n --omit-header --keyword=_ --keyword=__ -o empty.po $(PMSCFILES)
	rm $(PMSCFILES)

$(PMSCFILES): %_.c: %
	perl -pe 's|#(.*)|/*\1*\/|; s|$$|\\n\\|' $< > $@