diff options
Diffstat (limited to 'po/Makefile')
-rw-r--r-- | po/Makefile | 45 |
1 files changed, 35 insertions, 10 deletions
diff --git a/po/Makefile b/po/Makefile index a51162e2..69eb4239 100644 --- a/po/Makefile +++ b/po/Makefile @@ -1,12 +1,43 @@ # Installation directories localedir = ${prefix}/share/locale -LANGS = $(shell ls *.po | xargs -i basename {} .po ) PGOAL = drakwizard -GOALS = $(foreach a, $(LANGS), $(a).mo) +# *.wiz files +WIZFILES = $(shell find .. -type f -name "*.wiz") +# perl files with translatable strings +PL_FILES = ../drakwizard.pl -all: $(GOALS) +WIZCFILES = $(WIZFILES:%=%_.c) +PL_CFILES = $(PL_FILES:%=%_.c) + +POFILES = $(shell ls *.po) +MOFILES = $(POFILES:%.po=%.mo) +LANGS = $(POFILES:%.po=%) + +all: $(PGOAL).pot $(MOFILES) + +$(WIZCFILES): %_.c: % + ../wiz2fake_c.pl $< > $@ + +$(PL_CFILES): %_.c: % + ./fake_c.pl $< > $@ + +%.mo: %.po + msgfmt -o $@ $< + +merge: $(PGOAL).pot + @for n in $(POFILES); do \ + echo "Merging $$n"; \ + msgmerge "$$n" $< > "$$n"t; \ + mv -f "$$n"t "$$n"; \ + done + +$(PGOAL).pot: $(PL_CFILES) $(WIZCFILES) + xgettext -F -n --add-comments='-PO' \ + --keyword=_ --keyword=__ --keyword=N_ \ + --language=C -o $@ $(PL_CFILES) $(WIZCFILES) + @rm -rf $(PL_CFILES) $(WIZCFILES) install: all for l in $(LANGS); do \ @@ -15,11 +46,5 @@ install: all done clean: - rm -f *~ *.[oas] *.mo $(GOALS) TAGS - -%.h: - @touch $@ - -%.mo: %.po - msgfmt -o $@ $< + @rm -rf *.mo $(POFILES:%=%t) $(PL_CFILES) $(WIZCFILES) $(PGOAL).pot |