[i18n] improvement of po Makefile

Wenzhuo Zhang wenzhuo at zhmail.com
Thu Dec 2 20:28:49 PST 2004


Hi,

I suggest the following change to the po Makefiles (using
imp/po/Makefile as an example):

--- Makefile	2004-12-03 12:20:56.000000000 +0800
+++ Makefile.new	2004-12-03 12:19:39.000000000 +0800
@@ -8,15 +8,18 @@
 MSGFMT = msgfmt --statistics -c -v -o
 MSGFMTSOL = msgfmt -v -o
 MSGCOMM = msgcomm --more-than=0 -s -o -
+OBJECTS := $(wildcard *.po)
 
 all: install
 
-install: *.po
+install: $(OBJECTS)
+
+%.po: FORCE
 	@echo "Checking for os ... ${OSTYPE}"; \
 	if test "${OSTYPE}" = "solaris"; then \
 		echo "You'll probably get some warnings on Solaris. This is normal."; \
 	fi; \
-	for LOCALE in `ls *.po | sed 's/\.[^.]*$$//g'`; do \
+	for LOCALE in $*; do \
 		if test "$${LOCALE}.po" = "messages.po"; then \
 			continue; \
 		fi; \
@@ -54,3 +57,5 @@
 			echo "Could not create locale directory for $${LOCALE}."; \
 		fi \
 	done;
+
+FORCE:


The motivation is to enable the compilation of a single po file, e.g.:

$ make zh_CN.po
Checking for os ...
Compiling locale zh_CN:
612 translated messages, 5 fuzzy translations.
  ... done


It could help saving time for translators.

Best regards,

-- 
Wenzhuo Zhang <wenzhuo at zhmail.com>  GnuPG Key ID 0xBA586A68
Key fpr: 89C7 C6DE D956 F978 3F12  A8AF 5847 F840 BA58 6A68


More information about the i18n mailing list