### Makefile.common ### ### Copyright (C) 2002 by the KDE developers ### All the real work is done by the shellscript cvs.sh SHELL=/bin/sh cvs dist cvs-clean configure.in configure.files subdirs package-messages package-merge: @admindir=$(admindir); \ if test "x$$admindir" = x; then \ admindir=.; until test -f $$admindir/admin/cvs.sh; do \ admindir=$$admindir/..; \ if test `cd $$admindir && pwd` = / ; then break; fi; \ done; \ admindir=$$admindir/admin; \ if test -f $$admindir/cvs.sh; then :; else \ echo "Can't find the admin/ directory in any parent of the"; \ echo "current directory. Please set it with admindir=..."; \ exit 1; \ fi; \ fi; \ if test "$@" = "package-merge"; then \ MAKE=$(MAKE) POFILES="$(POFILES)" PACKAGE="$(PACKAGE)" \ $(SHELL) $$admindir/cvs.sh package-merge ;\ else MAKE=$(MAKE) $(SHELL) $$admindir/cvs.sh $@ ;\ fi configure.in: configure.files $(shell test -f configure.files && cat configure.files) subdirs configure.files: subdirs package-messages: @rm -rf po.backup ;\ mkdir po.backup ;\ for i in `ls -1 po/*.pot 2>/dev/null | sed -e "s#po/##"`; do \ egrep -v '^#([^:]|$)' po/$$i | egrep '^.*[^ ]+.*$$' | grep -v "\"POT-Creation" > po.backup/$$i ; \ cp po/$$i po.backup/backup_$$i ; \ touch -r po/$$i po.backup/backup_$$i ;\ rm po/$$i ;\ done @podir=$${podir:-$$PWD/po} ;\ files=`find . -name Makefile.am | xargs egrep -l '^messages:' `; \ dirs=`for i in $$files; do echo \`dirname $$i\`; done`; \ tmpname="$$PWD/messages.log" ;\ if test -z "$$EXTRACTRC"; then EXTRACTRC=extractrc ; fi ;\ if test -z "$$PREPARETIPS"; then PREPARETIPS=preparetips ; fi ;\ export EXTRACTRC PREPARETIPS ;\ for subdir in $$dirs; do \ test -z "$$VERBOSE" || echo "Making messages in $$subdir"; \ (cd $$subdir ;\ if test -n "`grep -e '^messages:.*rc.cpp' Makefile.am`"; then \ $$EXTRACTRC *.rc *.ui > rc.cpp ;\ else \ candidates=`ls -1 *.rc *.ui 2>/dev/null` ;\ if test -n "$$candidates"; then \ echo "$$subdir has *.rc or *.ui files, but not correct messages line" ;\ fi ;\ fi ;\ if test -n "`grep -r KAboutData *.c* *.C* 2>/dev/null`"; then \ echo -e 'i18n("_: NAME OF TRANSLATORS\\n"\n"Your names")\ni18n("_: EMAIL OF TRANSLATORS\\n"\n"Your emails")' > _translatorinfo.cpp ;\ else echo " " > _translatorinfo.cpp ;\ fi; \ perl -e '$$mes=0; while () { if (/^messages:/) { $$mes=1; print $$_; next; } if ($$mes) { if (/$$\\(XGETTEXT\)/ && / -o/) { s/ -o \$$\(podir\)/ _translatorinfo.cpp -o \$$\(podir\)/ } print $$_; } else { print $$_; } }' < Makefile.am > _transMakefile ;\ $(MAKE) -s -f _transMakefile podir=$$podir EXTRACTRC="$$EXTRACTRC" PREPARETIPS="$$PREPARETIPS" \ XGETTEXT="$${XGETTEXT:-xgettext} -C -ki18n -ktr2i18n \ -kI18N_NOOP -ktranslate -kaliasLocale \ -x $${includedir:-$$KDEDIR/include}/kde.pot" \ messages ) 2>&1 | grep -v '^make\[1\]' > $$tmpname; \ test -s $$tmpname && (echo $$subdir ; cat $$tmpname) ;\ test ! -f $$subdir/rc.cpp || rm -f $$subdir/rc.cpp ;\ rm -f $$subdir/_translatorinfo.cpp ;\ rm -f $$subdir/_transMakefile ;\ done rm -f $$tmpname @for i in `ls -1 po.backup/*.pot 2>/dev/null | sed -e "s#po.backup/##" | egrep -v '^backup_'`; do \ if test ! -f po/$$i; then echo "disappeared: $$i"; fi ;\ done @for i in `ls -1 po/*.pot 2>/dev/null | sed -e "s#po/##"`; do \ egrep -v '^#([^:]|$)' po/$$i | egrep '^.*[^ ]+.*$$' | grep -v "\"POT-Creation" > temp.pot ;\ if test -f po.backup/$$i && test -n "`diff temp.pot po.backup/$$i`"; then \ echo "will update $$i"; \ msgmerge -q po.backup/backup_$$i po/$$i > temp.pot ;\ mv temp.pot po/$$i; \ else \ if test -f po.backup/backup_$$i; then \ test -z "$$VERBOSE" || echo "I'm restoring $$i" ;\ mv po.backup/backup_$$i po/$$i; \ rm po.backup/$$i; \ else \ echo "will add $$i" ;\ fi ;\ fi ;\ done @rm -f temp.pot @rm -rf po.backup .SILENT: .PHONY: cvs dist cvs-clean package-merge package-messages