From 584d2eca1f6fe74be87c371d99a713176965f9f9 Mon Sep 17 00:00:00 2001 From: Pablo Saratxaga Date: Fri, 23 Aug 2002 00:50:14 +0000 Subject: copied fake_c.pl from other modules, and converted wiz2pot into wiz2fake_c; so now the pot file can be easily rebuild to match the source files. --- po/Makefile | 45 +++++++++++++++++++++++++++++++++++---------- 1 file changed, 35 insertions(+), 10 deletions(-) (limited to 'po/Makefile') 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 -- cgit v1.2.1