OSDN Git Service

GNU_coreutils: Define a Makefile target to compile PO file.
authorAkihiro MOTOKI <motoki@da.jp.nec.com>
Fri, 13 Apr 2012 05:45:31 +0000 (14:45 +0900)
committerAkihiro MOTOKI <motoki@da.jp.nec.com>
Fri, 13 Apr 2012 05:45:31 +0000 (14:45 +0900)
If ja.po in coreutils source tree, this target generates ja.gmo
and copies it to source/locale/LC_MESSAGES/coreutils.mo.
By doing this, changes in ja.po are automatically incorporated into
translated help2man manpages.

Makefile
help2man.ja/Makefile

index d43505a..b3d7b4c 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -16,6 +16,8 @@ PACKAGE_STRING = $(PACKAGE_NAME) $(PACKAGE_VERSION)
 
 all:   build-man
 
+#------------------------------------------------------------
+
 tarball:       $(tarball)
 $(tarball):
        wget http://core.ring.gr.jp/pub/GNU/coreutils/$@
@@ -43,7 +45,21 @@ stamp-build: stamp-configure
        )
        touch $@
 
-build-man:
+#------------------------------------------------------------
+
+mo-ja = source/locale/$(LANG)/LC_MESSAGES/coreutils.mo
+gmo-ja = source/po/ja.gmo
+po-ja = source/po/ja.po
+
+$(mo-ja):      $(gmo-ja)
+       /bin/cp $^ $@
+
+$(gmo-ja):     $(po-ja)
+       $(MAKE) -C source/po $$(basename $@)
+
+catalog:       $(mo-ja)
+
+build-man:     catalog
        $(MAKE) -C help2man.ja $@ PACKAGE_VERSION=$(PACKAGE_VERSION)
 
 install:       build-man
index 8dcd16b..a696b03 100644 (file)
@@ -29,8 +29,10 @@ install:     build-man
 clean:
        $(RM) $(MANPAGES)
 
+$(MANPAGES):   $(srcdir)/locale/$(LANG)/LC_MESSAGES/coreutils.mo
+
 .x.1:
-       $(AM_V_GEN)rm -f $@ $@-t                                        \
+       $(AM_V_GEN)rm -f $@ $@-t                        \
        && {                                            \
             rm -rf $t;                                 \
             mkdir $t;                                  \