diff options
-rw-r--r-- | po/Makefile | 33 |
1 files changed, 13 insertions, 20 deletions
diff --git a/po/Makefile b/po/Makefile index 17bc4a0..fb01e27 100644 --- a/po/Makefile +++ b/po/Makefile @@ -1,22 +1,19 @@ # Installation directories -localedir = $(prefix)/usr/share/locale +localedir = $(DESTDIR)/usr/share/locale PGOAL = transfugdrake # perl files to search translatable strings in -PL_FILES = ../transfugdrake ../transfugdrake.pm +PL_FILES = ../transfugdrake # C-like files to search translatable strings in #CFILES = ./placeholder.h -PL_CFILES = $(PL_FILES:%=%_.c) POFILES = $(shell ls *.po) MOFILES = $(POFILES:%.po=%.mo) +POTFILE= $(PGOAL).pot LANGS = $(POFILES:%.po=%) -GOALS = $(PGOAL).pot $(MOFILES) - - -all: $(GOALS) +all: $(MOFILES) install: all for l in $(LANGS); do \ @@ -25,21 +22,17 @@ install: all done clean: - @rm -rf *~ *.mo $(GOALS) $(PL_CFILES) + rm -f *~ *.[oas] *.mo $(POTFILE) $(MOFILES) TAGS %.mo: %.po msgfmt -o $@ $< -$(PL_CFILES): %_.c: % - ./fake_c.pl $< > $@ - -$(PGOAL).pot: $(PL_CFILES) $(CFILES) - xgettext --default-domain=$(PGOAL) -F -n \ - --add-comments='-PO' --add-comments=' Translator:'\ - --keyword=_ --keyword=__ --keyword=N_ --keyword=N \ - --keyword=I_ --keyword=i18n \ - --keyword=gettext \ - --language=C $(PL_CFILES) $(CFILES) - mv -f $(PGOAL).po $(PGOAL).pot - @rm -rf $(PL_CFILES) +$(POTFILE): $(PL_FILES) + perl_checker -q --generate-pot $@ $(PL_FILES) +merge: $(POTFILE) + @for n in $(POFILES); do \ + echo "Merging $$n"; \ + msgmerge -C "$$n" "$$n" $(PGOAL).pot > "$$n"t; \ + mv -f "$$n"t "$$n"; \ + done |